| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
These were missed in the big conversion to fast natives in
c78646ed3f24bd915c7cfe4aca
|
|
|
|
|
|
|
|
|
|
| |
"slow" natives were removed in the mozjs commit:
http://hg.mozilla.org/mozilla-central/rev/66c8ad02543b
In order to work with both, add compatibility macros to compat.h,
and also update the ones in jsapi-util.h to use these.
Port all constructors to use these macros.
|
|
|
|
|
| |
This allows us to sanely install this header file, which will allow
us to make jsapi-util.h depend on it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
boxed_new previously called gjs_invoke_c_function_uncached() on
the first C constructor it found; this recursed and we would
wrap the boxed, creating a JSObject etc., only to unwrap it
and get the native pointer again.
For a reason I'm not going to debug in depth, this started failing
with xulrunner 2. Regardless, we should avoid this insanity and
call the C function more directly with g_function_info_invoke,
which gives us the raw pointer we wanted anyways.
|
| |
|
|
|
|
|
|
| |
See upstraem commit 38cbd4e02afc. We can detect the difference
by checking for JS_EndPC, which was introduced around the same
time.
|
|
|
|
|
|
| |
The verison of g-i we require itself needs 2.24. Now, I'm not
actually going to claim we work with 2.18, but doing this allows me to
drop the glib stuff from compat.h at least.
|
|
|
|
| |
We need the .typelibs too.
|
|
|
|
| |
We fail this check in my current wip/xulrunner-2 branch.
|
|
|
|
|
|
|
| |
Have the test timeout behavior be controlled by the GJS_TEST_TIMEOUT
environment variable, and the "gdb-check" target set that to 0. This
ensures the process won't suicide when you're in the middle of
investigating a crash.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to link explicitly against GObject, since we use The
commit 25681375970de9 intentionally removed the dependency on all
the "internal" GJS libraries like libmozjs.so from gjs-console,
but first, we need to explicitly link against libgobject, because
we do use it.
Secondly, to make things more clear here, drop the random unnecessary
use of "internal" GJS API like gjs_debug and gjs_memory_report (
the memory report could be an environment variable).
https://bugzilla.gnome.org/show_bug.cgi?id=632844
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously <gjs/gjs.h> pulled in a lot of stuff, and in particular,
<gjs/jsapi-util.h>, which in turn required <jsapi.h>. For a simple
app that wants to embed GJS we should not be pulling that in.
So <gjs/gjs.h> is now the "simple" API that actually just includes
<gjs/context.h>, suitable for creating a context and calling eval().
<gjs/gjs-module.h> is now equivalent to the old <gjs/gjs.h>, it
pulls in the world.
Also, create a corresponding .pc file, gjs-internals-1.0.pc. This one
includes mozjs as Requires, and adds the requisite Cflags. For
gjs-1.0.pc, change the Requires to simply be gobject-2.0.
Conceptually, a gjs-devel RPM should not Require
gobject-introspection-devel or xulrunner-devel, and a simple embedder
program just using gjs_context_new()/gjs_context_eval() should not
have DT_NEEDED on gobject-introspection-1.0.so or mozjs.so.
https://bugzilla.gnome.org/show_bug.cgi?id=632795
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=632485
|
|
|
|
|
|
|
|
|
| |
"slow" natives have been removed in mozjs; this prepares us for
a patch which adapts to their removal.
See upstream commit: http://hg.mozilla.org/mozilla-central/rev/66c8ad02543b
https://bugzilla.gnome.org/show_bug.cgi?id=632159
|
|
|
|
| |
This ensures we work with a pre-2.0 snapshot.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=632529
|
|
|
|
|
| |
Remove the base library checks, and just differentiate between
xulrunner 1.9.x and 2.
|
| |
|
|
|
|
| |
Also switch to building a dist tarball in bzip2 format.
|
|
|
|
| |
Add Regress and GIMarshallingTests typelibs and girs to CLEANFILES
|
|
|
|
| |
Taken from the xulrunner 1.9.2 headers.
|
|
|
|
|
|
|
|
|
|
|
|
| |
GDataset is slow - it requires thread locking and hash table lookups.
Since we don't support foreign JSRuntimes at the moment we can use
JS_SetRuntimePrivate() which will have better performance.
The public API functions gjs_runtime_get/set_data() are removed; if
they were being used outside of GJS the users will have to track their
data themselves.
https://bugzilla.gnome.org/show_bug.cgi?id=630964
|
|
|
|
|
|
|
|
|
| |
For gjs_runtime_push_context() keep track of the number of times
an identical context has been pushed. This allows avoiding allocating
a GSList node for the most common case of repeatedly pushing the
default context.
https://bugzilla.gnome.org/show_bug.cgi?id=630964
|
|
|
|
|
|
|
| |
In values with a transfer != None are still supported, but no
longer tested because using them is discouraged.
https://bugzilla.gnome.org/show_bug.cgi?id=630963
|
|
|
|
|
|
|
|
|
| |
In XULRunner 1.9.3, passing a custom prototype or parent to
JS_ConstructObject for Object fails, so work around with a separate calls
to SetPrototype()/SetParent().
See https://bugzilla.mozilla.org/show_bug.cgi?id=599651.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea of the load context was to have a single context where modules
and native were defined and shared between different JSContexts in the
same runtime.
But this caused context switching when loading modules, which isn't very
tested in Spidermonkey and caused lots of use of gjs_move_exception()
and other complications.
Instead, switch to the idea of a "import global" object; this is the global
object that is used in the scope chain for modules, and is also where the
constructors for our native classes are stored, allowing native classes
to be shared between different contexts.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using multiple nested contexts on the same thread isn't normal usage of
Spidermonkey and triggers bugs in Spidermonkey that might not be caught
in upstream testing. (It is theoretically supported, to at least some extent.)
When calling a callback, the best context to use is the current context.
If that's not available, then using the default context from the GjsContext
is usually sensible.
Add functions:
gjs_runtime_push_context()
gjs_runtime_pop_context()
gjs_runtime_get_current_context()
One potential concern here is the extensive use of GDataset to get data
from a context, which involves locking overhead and hash table lookups and
can be slow; since we can't use GJS with multiple JS_Runtimes in the same
process due to the limitations of toggle references, perhaps we should enforce
that and use global variables.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
| |
Also, the first entry should be JSID(0) technically, to indicate
"unknown length".
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently enumeration changed so that (for v in importer) now
*also* loops over the prototype properties. However, the code
didn't handle this, because the _INIT case for prototype just
stuffed JSVAL_NULL into the custom data.
Handle this by simply ignoring JSVAL_NULL in ENUMERATE_NEXT, and finish
the iteration.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
| |
We don't have any non-enumerable properties on the importer
object, so just handle this like JSENUMERATE_INIT.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
|
|
|
|
| |
In Xulrunner 1.9.3, this is now a no-op. See
upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=519949
Now in theory, we should be checking the return value and handling
that. I wrote a nontrivial patch to do this, but decided it
wasn't worth it, since in newer xulrunners it's just pointless
code spaghetti, and in older, it's not like we're really
going to go OOM in reality.
|
|
|
|
|
|
|
|
| |
JS_PushArgumentsVA vanished in 1.9.3; since it was only used in
debugger.c, which was itself just removed, delete it.
Separated from a larger patch by
Colin Walters <walters@verbum.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 1.9.3, we need to explicitly say when we're making the global
object. Clean this up by introducing a wrapper function; while
we're at it, also call JS_InitStandardClasses here since everything
else creating a global did too.
Note that rooting the global object is not necessary, so remove
that. From a grep of the sources (going back to at least 1.9.2):
./src/jsgc.cpp: if (acx->globalObject && !JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL))
./src/jsgc.cpp: JS_CALL_OBJECT_TRACER(trc, acx->globalObject, "global object");
|
|
|
|
|
|
|
|
|
|
| |
The two have always been conceptually distinct types. Even in 1.9.3,
they are still the same in implementation, but to avoid a pile of
warnings, we should avoid confusing them. Unfortunately, even the
SpiderMonkey docs are wrong in a few places, so gjs' code confusing
them is understandable.
Anyways, fix up places that made this assumption.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
| |
|
|
|
|
|
|
|
|
|
|
| |
While -Wfloat-equal warns on dubious constructs, it also warns on
valid constructs, and there is no way to suppress the warning.
In particular, it's currently warning for every single file because of
JS_CANONICALIZE_NAN() in the xulrunner headers.
https://bugzilla.gnome.org/show_bug.cgi?id=630853
|
|
|
|
|
|
| |
Use C NULL where it's expected, not JSVAL_NULL.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
| |
This function isn't intended for normal numeric conversions: see
https://developer.mozilla.org/en/JS_NewNumberValue
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
| |
Found by visual inspection.
https://bugzilla.gnome.org/show_bug.cgi?id=630423
|
|
|
|
|
|
| |
Just found by visual auditing while looking for mismatched pairs.
https://bugzilla.gnome.org/show_bug.cgi?id=630423
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=630423
|
|
|
|
|
|
| |
Octal appears to be deprecated in XULRunner 1.9.3.
https://bugzilla.gnome.org/show_bug.cgi?id=630416
|