Bug 1773324 - Pass ErrorContext parameter to CompileModuleToStencil functions r=arai

Fixes jit-test. Probably needs coordination with ESMification efforts.

It looks like JS::CompileModule() would be called from the main thread, so
it should use GeneralErrorContext.

Differential Revision: https://phabricator.services.mozilla.com/D151178
This commit is contained in:
Bryan Thrall
2022-07-25 18:57:31 +00:00
parent f920457a2e
commit 7faf57ca9b
7 changed files with 51 additions and 37 deletions

View File

@@ -5315,7 +5315,8 @@ static bool ParseModule(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
RootedObject module(cx, frontend::CompileModule(cx, options, srcBuf));
GeneralErrorContext ec(cx);
RootedObject module(cx, frontend::CompileModule(cx, &ec, options, srcBuf));
if (!module) {
return false;
}
@@ -5810,13 +5811,14 @@ template <typename Unit>
return false;
}
GeneralErrorContext ec(cx);
UniquePtr<frontend::ExtensibleCompilationStencil> stencil;
if (goal == frontend::ParseGoal::Script) {
GeneralErrorContext ec(cx);
stencil = frontend::CompileGlobalScriptToExtensibleStencil(
cx, &ec, input.get(), srcBuf, ScopeKind::Global);
} else {
stencil = frontend::ParseModuleToExtensibleStencil(cx, input.get(), srcBuf);
stencil =
frontend::ParseModuleToExtensibleStencil(cx, &ec, input.get(), srcBuf);
}
if (!stencil) {