1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-14 00:48:28 -04:00
elinks/src/ecmascript
Kalle Olavi Niemitalo b94657869b 1031: JS_SetErrorReporter only once per JSRuntime.
Previously, spidermonkey_get_interpreter() and init_smjs() each called
JS_SetErrorReporter on the JSContexts they created.  However,
JS_SetErrorReporter actually sets the error reporter of the JSRuntime
associated with the JSContext, and all of our JSContexts use the same
JSRuntime nowadays, so only the error_reporter() of
src/ecmascript/spidermonkey.c was left installed.  Because this
error_reporter() asserts that JS_GetContextPrivate(ctx) returns a
non-NULL pointer, and init_smjs() does not set a private pointer for
smjs_ctx, any error in smjs_ctx could cause an assertion failure, at
least in principle.

Fix this by making spidermonkey_runtime_addref() install a shared
error_reporter() when it creates the JSRuntime and the first JSContext.
The shared error_reporter() then checks the JSContext and calls the
appropriate function.

The two error reporters are quite similar with each other.  In the
future, we could move the common code into shared functions.  I'm not
doing that yet though, because fixing the bug doesn't require it.
2008-09-07 20:17:25 +03:00
..
see 1038: Remove remembering last 8 URLs. It did not work. 2008-07-21 00:39:30 +03:00
spidermonkey 1038: Remove remembering last 8 URLs. It did not work. 2008-07-21 00:39:30 +03:00
ecmascript.c 1038: Remove remembering last 8 URLs. It did not work. 2008-07-21 00:39:30 +03:00
ecmascript.h Rename cache_entry.id and related members. 2008-08-03 21:27:56 +03:00
Makefile 1031: Add spidermonkey-shared.c used for both web and user scripts 2008-07-16 12:32:24 +03:00
see.c ECMAScript: evaluating onclick, onsubmit etc. done in the right way. 2007-05-30 02:35:18 +03:00
see.h 952, 954: Finalize form_view.ecmascript_obj for SEE 2008-07-19 14:58:11 +03:00
spidermonkey-shared.c 1031: JS_SetErrorReporter only once per JSRuntime. 2008-09-07 20:17:25 +03:00
spidermonkey-shared.h 952, 954: Add spidermonkey_empty_context 2008-07-18 19:24:29 +03:00
spidermonkey.c 1031: JS_SetErrorReporter only once per JSRuntime. 2008-09-07 20:17:25 +03:00
spidermonkey.h 1031: JS_SetErrorReporter only once per JSRuntime. 2008-09-07 20:17:25 +03:00