SpiderMonkey 38 upgrade: 18/35

JS_SetErrorReporter now takes a JSRuntime instead of a JSContext. Patch
by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=981198

This was SVN commit r18673.
This commit is contained in:
Nicolas Auvray 2016-09-02 16:35:03 +00:00
parent 2aa75a05d4
commit 8f7ba9acf8

View File

@ -348,7 +348,7 @@ ScriptInterface_impl::ScriptInterface_impl(const char* nativeScopeName, const sh
JS_SetContextPrivate(m_cx, NULL);
JS_SetErrorReporter(m_cx, ErrorReporter);
JS_SetErrorReporter(m_runtime->m_rt, ErrorReporter);
JS_SetGlobalJitCompilerOption(m_runtime->m_rt, JSJITCOMPILER_ION_ENABLE, 1);
JS_SetGlobalJitCompilerOption(m_runtime->m_rt, JSJITCOMPILER_BASELINE_ENABLE, 1);
@ -1045,12 +1045,12 @@ std::string ScriptInterface::ToString(JS::MutableHandleValue obj, bool pretty)
JS::RootedValue indentVal(m->m_cx, JS::Int32Value(2));
// Temporary disable the error reporter, so we don't print complaints about cyclic values
JSErrorReporter er = JS_SetErrorReporter(m->m_cx, NULL);
JSErrorReporter er = JS_SetErrorReporter(m->m_runtime->m_rt, NULL);
bool ok = JS_Stringify(m->m_cx, obj, JS::NullPtr(), indentVal, &Stringifier::callback, &str);
// Restore error reporter
JS_SetErrorReporter(m->m_cx, er);
JS_SetErrorReporter(m->m_runtime->m_rt, er);
if (ok)
return str.stream.str();