Commit b84c6033 authored by Simon McVittie's avatar Simon McVittie

New upstream version 1.54.2

parents 69c874a7 4e817177
......@@ -64,13 +64,13 @@ check_PROGRAMS += gjs-tests.gtester minijasmine
gjs_tests_gtester_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DGJS_COMPILATION \
$(GJSTESTS_CFLAGS) \
$(GJS_CFLAGS) \
$(gjs_directory_defines) \
-I$(top_srcdir)/test
gjs_tests_gtester_LDADD = \
libgjs.la \
$(GJSTESTS_LIBS)
$(GJS_LIBS)
gjs_tests_gtester_SOURCES = \
test/gjs-tests.cpp \
......
......@@ -794,9 +794,8 @@ am__DIST_COMMON = $(srcdir)/Makefile-examples.am \
$(srcdir)/config.h.in $(srcdir)/gjs-1.0.pc.in \
$(srcdir)/gjs-modules-srcs.mk $(srcdir)/gjs-srcs.mk \
$(top_srcdir)/win32/config.h.win32.in AUTHORS COPYING \
ChangeLog INSTALL NEWS README compile config.guess \
config.rpath config.sub depcomp install-sh ltmain.sh missing \
tap-driver.sh
ChangeLog INSTALL NEWS README compile config.guess config.sub \
depcomp install-sh ltmain.sh missing tap-driver.sh
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
......@@ -861,8 +860,6 @@ GCOV = @GCOV@
GENHTML = @GENHTML@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GI_DATADIR = @GI_DATADIR@
GJSTESTS_CFLAGS = @GJSTESTS_CFLAGS@
GJSTESTS_LIBS = @GJSTESTS_LIBS@
GJS_CAIRO_CFLAGS = @GJS_CAIRO_CFLAGS@
GJS_CAIRO_LIBS = @GJS_CAIRO_LIBS@
GJS_CAIRO_XLIB_CFLAGS = @GJS_CAIRO_XLIB_CFLAGS@
......@@ -1326,13 +1323,13 @@ jsunit_resources_files := $(shell glib-compile-resources --sourcedir=$(srcdir)/i
gjs_tests_gtester_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DGJS_COMPILATION \
$(GJSTESTS_CFLAGS) \
$(GJS_CFLAGS) \
$(gjs_directory_defines) \
-I$(top_srcdir)/test
gjs_tests_gtester_LDADD = \
libgjs.la \
$(GJSTESTS_LIBS)
$(GJS_LIBS)
gjs_tests_gtester_SOURCES = \
test/gjs-tests.cpp \
......
Version 1.54.2
--------------
- Closed bugs and merge requests:
* context: Defer and therefore batch forced GC runs [performance] [!236,
Daniel van Vugt]
* context: use timeout with seconds to schedule a gc trigger [!239, Marco
Trevisan]
* fundamental: Check if gtype is valid before using it [!242, Georges Basile
Stavracas Neto]
- Backported a fix for a crash in the interactive interpreter when executing
something like `throw "foo"` [Philip Chimento]
- Backported various maintenance from 3.31 [Philip Chimento]
Version 1.54.1
--------------
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gjs 1.54.1.
# Generated by GNU Autoconf 2.69 for gjs 1.54.2.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gjs>.
#
......@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gjs'
PACKAGE_TARNAME='gjs'
PACKAGE_VERSION='1.54.1'
PACKAGE_STRING='gjs 1.54.1'
PACKAGE_VERSION='1.54.2'
PACKAGE_STRING='gjs 1.54.2'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gjs'
PACKAGE_URL='https://wiki.gnome.org/Projects/Gjs'
......@@ -668,8 +668,6 @@ ENABLE_CAIRO_FALSE
ENABLE_CAIRO_TRUE
GJS_CAIRO_LIBS
GJS_CAIRO_CFLAGS
GJSTESTS_LIBS
GJSTESTS_CFLAGS
GJS_CONSOLE_LIBS
GJS_CONSOLE_CFLAGS
GJS_GDBUS_LIBS
......@@ -904,8 +902,6 @@ GJS_GDBUS_CFLAGS
GJS_GDBUS_LIBS
GJS_CONSOLE_CFLAGS
GJS_CONSOLE_LIBS
GJSTESTS_CFLAGS
GJSTESTS_LIBS
GJS_CAIRO_CFLAGS
GJS_CAIRO_LIBS
GJS_CAIRO_XLIB_CFLAGS
......@@ -1453,7 +1449,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gjs 1.54.1 to adapt to many kinds of systems.
\`configure' configures gjs 1.54.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1523,7 +1519,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gjs 1.54.1:";;
short | recursive ) echo "Configuration of gjs 1.54.2:";;
esac
cat <<\_ACEOF
......@@ -1619,10 +1615,6 @@ Some influential environment variables:
C compiler flags for GJS_CONSOLE, overriding pkg-config
GJS_CONSOLE_LIBS
linker flags for GJS_CONSOLE, overriding pkg-config
GJSTESTS_CFLAGS
C compiler flags for GJSTESTS, overriding pkg-config
GJSTESTS_LIBS
linker flags for GJSTESTS, overriding pkg-config
GJS_CAIRO_CFLAGS
C compiler flags for GJS_CAIRO, overriding pkg-config
GJS_CAIRO_LIBS
......@@ -1705,7 +1697,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gjs configure 1.54.1
gjs configure 1.54.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2256,7 +2248,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gjs $as_me 1.54.1, which was
It was created by gjs $as_me 1.54.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3119,7 +3111,7 @@ fi
# Define the identity of the package.
PACKAGE='gjs'
VERSION='1.54.1'
VERSION='1.54.2'
cat >>confdefs.h <<_ACEOF
......@@ -3346,10 +3338,10 @@ ac_config_headers="$ac_config_headers config.h"
GJS_VERSION=15401
GJS_VERSION=15402
$as_echo "#define GJS_VERSION (1 * 100 + 54) * 100 + 1" >>confdefs.h
$as_echo "#define GJS_VERSION (1 * 100 + 54) * 100 + 2" >>confdefs.h
GETTEXT_PACKAGE=gjs
......@@ -21388,8 +21380,6 @@ common_packages="gthread-2.0 gio-2.0 >= 2.54.0 mozjs-60"
gjs_packages="gobject-introspection-1.0 libffi $common_packages"
gjs_cairo_packages="cairo cairo-gobject $common_packages"
gjs_gtk_packages="gtk+-3.0 >= 3.20"
# gjs-tests links against everything
gjstests_packages="gio-unix-2.0 $gjs_packages"
......@@ -21677,97 +21667,6 @@ $as_echo "yes" >&6; }
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gjstests_packages" >&5
$as_echo_n "checking for $gjstests_packages... " >&6; }
if test -n "$GJSTESTS_CFLAGS"; then
pkg_cv_GJSTESTS_CFLAGS="$GJSTESTS_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gjstests_packages\""; } >&5
($PKG_CONFIG --exists --print-errors "$gjstests_packages") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GJSTESTS_CFLAGS=`$PKG_CONFIG --cflags "$gjstests_packages" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$GJSTESTS_LIBS"; then
pkg_cv_GJSTESTS_LIBS="$GJSTESTS_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gjstests_packages\""; } >&5
($PKG_CONFIG --exists --print-errors "$gjstests_packages") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GJSTESTS_LIBS=`$PKG_CONFIG --libs "$gjstests_packages" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GJSTESTS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$gjstests_packages" 2>&1`
else
GJSTESTS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$gjstests_packages" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GJSTESTS_PKG_ERRORS" >&5
as_fn_error $? "Package requirements ($gjstests_packages) were not met:
$GJSTESTS_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GJSTESTS_CFLAGS
and GJSTESTS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables GJSTESTS_CFLAGS
and GJSTESTS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
GJSTESTS_CFLAGS=$pkg_cv_GJSTESTS_CFLAGS
GJSTESTS_LIBS=$pkg_cv_GJSTESTS_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$GJS_CFLAGS"
LIBS_save="$LIBS"
......@@ -21780,7 +21679,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#include <js-config.h>
#ifdef JS_DEBUG
#error debug yes, if we didn't already error out due to DEBUG not being defined
#error debug yes, if we did not already error out due to DEBUG not being defined
#endif
_ACEOF
......@@ -23916,7 +23815,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gjs $as_me 1.54.1, which was
This file was extended by gjs $as_me 1.54.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -23987,7 +23886,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gjs config.status 1.54.1
gjs config.status 1.54.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -3,7 +3,7 @@
m4_define(pkg_major_version, 1)
m4_define(pkg_minor_version, 54)
m4_define(pkg_micro_version, 1)
m4_define(pkg_micro_version, 2)
m4_define(pkg_version, pkg_major_version.pkg_minor_version.pkg_micro_version)
m4_define(pkg_int_version, (pkg_major_version * 100 + pkg_minor_version) * 100 + pkg_micro_version)
......@@ -69,14 +69,11 @@ common_packages="gthread-2.0 gio-2.0 >= glib_required_version mozjs-60"
gjs_packages="gobject-introspection-1.0 libffi $common_packages"
gjs_cairo_packages="cairo cairo-gobject $common_packages"
gjs_gtk_packages="gtk+-3.0 >= 3.20"
# gjs-tests links against everything
gjstests_packages="gio-unix-2.0 $gjs_packages"
AX_PKG_CHECK_MODULES([GJS], [$GOBJECT_REQUIREMENT], [$gjs_packages])
dnl These don't need to be put in the .pc file so use regular PKG_CHECK_MODULES
PKG_CHECK_MODULES([GJS_GDBUS], [$gjs_base_packages])
PKG_CHECK_MODULES([GJS_CONSOLE], [$gjs_base_packages])
PKG_CHECK_MODULES([GJSTESTS], [$gjstests_packages])
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$GJS_CFLAGS"
......@@ -89,7 +86,7 @@ AC_MSG_CHECKING([whether SpiderMonkey was configured with --enable-debug])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <js-config.h>
#ifdef JS_DEBUG
#error debug yes, if we didn't already error out due to DEBUG not being defined
#error debug yes, if we did not already error out due to DEBUG not being defined
#endif
]])], [
AC_MSG_RESULT([no])
......
......@@ -623,23 +623,16 @@ static JSObject*
gjs_lookup_fundamental_prototype_from_gtype(JSContext *context,
GType gtype)
{
GIObjectInfo *info;
JSObject *proto;
GjsAutoInfo<GIObjectInfo> info;
/* A given gtype might not have any definition in the introspection
* data. If that's the case, try to look for a definition of any of the
* parent type. */
while ((info = (GIObjectInfo *)
g_irepository_find_by_gtype(g_irepository_get_default(),
gtype)) == NULL &&
gtype != G_TYPE_INVALID)
while (gtype != G_TYPE_INVALID &&
!(info = g_irepository_find_by_gtype(nullptr, gtype)))
gtype = g_type_parent(gtype);
proto = gjs_lookup_fundamental_prototype(context, info, gtype);
if (info)
g_base_info_unref((GIBaseInfo*)info);
return proto;
return gjs_lookup_fundamental_prototype(context, info, gtype);
}
bool
......
......@@ -636,9 +636,9 @@ _gjs_context_schedule_gc_internal(GjsContext *js_context,
if (js_context->auto_gc_id > 0)
return;
js_context->auto_gc_id = g_idle_add_full(G_PRIORITY_LOW,
trigger_gc_if_needed,
js_context, NULL);
js_context->auto_gc_id = g_timeout_add_seconds_full(G_PRIORITY_LOW, 10,
trigger_gc_if_needed,
js_context, NULL);
}
void
......
......@@ -28,12 +28,12 @@
#ifdef G_OS_WIN32
# ifdef GJS_COMPILATION
# define GJS_EXPORT __attribute__((visibility("default"))) __declspec(dllexport)
# define GJS_EXPORT __declspec(dllexport)
# else
# define GJS_EXPORT __attribute__((visibility("default"))) __declspec(dllimport)
# define GJS_EXPORT __declspec(dllimport)
# endif
#else
# define GJS_EXPORT __attribute__((visibility("default")))
# define GJS_EXPORT
#endif
#endif /* GJS_MACROS_H */
......@@ -52,6 +52,8 @@
#include <glib.h>
#include <glib/gprintf.h>
#include <string>
#include "console.h"
#include "gjs/context.h"
#include "gjs/context-private.h"
......@@ -142,6 +144,20 @@ gjs_console_warning_reporter(JSContext *cx, JSErrorReport *report)
class AutoReportException {
JSContext *m_cx;
JSErrorReport* error_from_exception_value(JS::HandleValue v_exn) const {
if (!v_exn.isObject())
return nullptr;
JS::RootedObject exn(m_cx, &v_exn.toObject());
return JS_ErrorFromException(m_cx, exn);
}
JSObject* stack_from_exception_value(JS::HandleValue v_exn) const {
if (!v_exn.isObject())
return nullptr;
JS::RootedObject exn(m_cx, &v_exn.toObject());
return ExceptionStackOrNull(exn);
}
public:
explicit AutoReportException(JSContext *cx) : m_cx(cx) {}
......@@ -153,22 +169,17 @@ public:
JS::RootedValue v_exn(m_cx);
(void) JS_GetPendingException(m_cx, &v_exn);
JS::RootedObject exn(m_cx, &v_exn.toObject());
JSErrorReport *report = JS_ErrorFromException(m_cx, exn);
JSErrorReport* report = error_from_exception_value(v_exn);
if (report) {
g_assert(!JSREPORT_IS_WARNING(report->flags));
gjs_console_print_error(report);
} else {
JS::RootedString message(m_cx, JS::ToString(m_cx, v_exn));
if (!message) {
g_printerr("(could not convert thrown exception to string)\n");
} else {
GjsAutoJSChar message_utf8 = JS_EncodeStringToUTF8(m_cx, message);
g_printerr("%s\n", message_utf8.get());
}
GjsAutoChar string = gjs_value_debug_string(m_cx, v_exn);
g_printerr("error: %s\n", string.get());
return;
}
JS::RootedObject stack(m_cx, ExceptionStackOrNull(exn));
JS::RootedObject stack(m_cx, stack_from_exception_value(v_exn));
if (stack) {
GjsAutoChar stack_str = gjs_format_stack_trace(m_cx, stack);
if (!stack_str)
......
......@@ -35,7 +35,6 @@
#include <glib.h>
#include <gio/gio.h>
#include <gio/gunixoutputstream.h>
#include <gjs/gjs.h>
#include "gjs/coverage.h"
......
......@@ -88,91 +88,3 @@ gjs_unit_test_exception_message(GjsUnitTestFixture *fx)
JS_ClearPendingException(fx->cx);
return retval;
}
/* Fork a process that waits the given time then
* sends us ABRT
*/
void
gjs_crash_after_timeout(int seconds)
{
pid_t parent_pid;
int pipe_fds[2];
fd_set read_fds;
struct timeval term_time;
struct timeval remaining;
struct timeval now;
int old_flags;
/* We use a pipe to know in the child when the parent exited */
if (pipe(pipe_fds) != 0) {
fprintf(stderr, "Failed to create pipe to crash-in-timeout process: %s\n",
strerror(errno));
return;
}
/* We want pipe_fds[1] to only be open in the parent process; when it closes
* the child will see an EOF. Setting FD_CLOEXEC is protection in case the
* parent spawns off some process without properly closing fds.
*/
old_flags = fcntl(pipe_fds[1], F_GETFD);
if (old_flags == -1 ||
fcntl(pipe_fds[1], F_SETFD, old_flags | FD_CLOEXEC) != 0) {
fprintf(stderr, "Couldn't make crash-timeout pipe FD_CLOEXEC: %s\n",
strerror(errno));
return;
}
parent_pid = getpid();
switch (fork()) {
case -1:
fprintf(stderr, "Failed to fork crash-in-timeout process: %s\n",
strerror(errno));
return;
case 0:
/* child */
break;
default:
/* parent */
close(pipe_fds[0]);
return;
}
close (pipe_fds[1]);
gettimeofday (&now, NULL);
term_time = now;
term_time.tv_sec += seconds;
FD_ZERO(&read_fds);
FD_SET(pipe_fds[0], &read_fds);
while (true) {
remaining.tv_sec = term_time.tv_sec - now.tv_sec;
remaining.tv_usec = term_time.tv_usec - now.tv_usec;
if (remaining.tv_usec < 0) {
remaining.tv_usec += 1000;
remaining.tv_sec -= 1;
}
if (remaining.tv_sec < 0) /* expired */
break;
select(pipe_fds[0] + 1, &read_fds, NULL, NULL, &remaining);
if (FD_ISSET(pipe_fds[0], &read_fds)) {
/* The parent exited */
_exit(0);
}
gettimeofday(&now, NULL);
}
if (kill(parent_pid, 0) == 0) {
fprintf(stderr, "Timeout of %d seconds expired; aborting process %d\n",
seconds, (int) parent_pid);
kill(parent_pid, SIGABRT);
}
_exit(1);
}
......@@ -46,8 +46,6 @@ void gjs_unit_test_fixture_teardown(GjsUnitTestFixture *fx,
char *gjs_unit_test_exception_message(GjsUnitTestFixture *fx);
void gjs_crash_after_timeout(int seconds);
void gjs_test_add_tests_for_coverage ();
void gjs_test_add_tests_for_parse_call_args(void);
......
......@@ -406,11 +406,6 @@ int
main(int argc,
char **argv)
{
/* give the unit tests 7 minutes to complete, unless an environment variable
* is set; use this when running under GDB, for example */
if (!g_getenv("GJS_TEST_SKIP_TIMEOUT"))
gjs_crash_after_timeout(60 * 7);
/* Avoid interference in the tests from stray environment variable */
g_unsetenv("GJS_ENABLE_PROFILER");
......
......@@ -13,7 +13,7 @@
#define GETTEXT_PACKAGE "gjs"
/* The gjs version as an integer */
#define GJS_VERSION 15401
#define GJS_VERSION 15402
/* define if the compiler supports basic C++11 syntax */
#define HAVE_CXX11 1
......@@ -74,7 +74,7 @@
#define PACKAGE_NAME "gjs"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "gjs 1.54.1"
#define PACKAGE_STRING "gjs 1.54.2"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gjs"
......@@ -83,10 +83,10 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.54.1"
#define PACKAGE_VERSION "1.54.2"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.54.1"
#define VERSION "1.54.2"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment