зеркало из https://github.com/mozilla/gecko-dev.git
Bug 636811 - Use JSSCRIPT_NO_SCRIPT_RVAL in js component loader, r=mrbkap
This commit is contained in:
Родитель
d390f7b37a
Коммит
f1fd210898
|
@ -1071,11 +1071,9 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
|
|||
// If |exception| is non-null, then our caller wants us to propagate
|
||||
// any exceptions out to our caller. Ensure that the engine doesn't
|
||||
// eagerly report the exception.
|
||||
uint32 oldopts = 0;
|
||||
if (exception) {
|
||||
oldopts = JS_GetOptions(cx);
|
||||
JS_SetOptions(cx, oldopts | JSOPTION_DONT_REPORT_UNCAUGHT);
|
||||
}
|
||||
uint32 oldopts = JS_GetOptions(cx);
|
||||
JS_SetOptions(cx, oldopts | JSOPTION_NO_SCRIPT_RVAL |
|
||||
(exception ? JSOPTION_DONT_REPORT_UNCAUGHT : 0));
|
||||
|
||||
if (realFile) {
|
||||
#ifdef HAVE_PR_MEMMAP
|
||||
|
@ -1189,14 +1187,12 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
|
|||
// exception on this context.
|
||||
// NB: The caller must stick exception into a rooted slot (probably on
|
||||
// its context) as soon as possible to avoid GC hazards.
|
||||
if (exception) {
|
||||
JS_SetOptions(cx, oldopts);
|
||||
if (!script) {
|
||||
if (!script && exception) {
|
||||
JS_GetPendingException(cx, exception);
|
||||
JS_ClearPendingException(cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!script) {
|
||||
#ifdef DEBUG_shaver_off
|
||||
|
@ -1241,8 +1237,7 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
|
|||
// See bug 384168.
|
||||
*aGlobal = global;
|
||||
|
||||
jsval retval;
|
||||
if (!JS_ExecuteScriptVersion(cx, global, script, &retval, JSVERSION_LATEST)) {
|
||||
if (!JS_ExecuteScriptVersion(cx, global, script, NULL, JSVERSION_LATEST)) {
|
||||
#ifdef DEBUG_shaver_off
|
||||
fprintf(stderr, "mJCL: failed to execute %s\n", nativePath.get());
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче