diff options
author | Brian Smith <brian@dbsoft.org> | 2023-04-21 17:35:04 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2023-04-27 13:34:55 -0500 |
commit | 914299b8ba22bb40fc30f83fe5481ebf4598ab48 (patch) | |
tree | ca0a35c7573f80c33d74b2f3f6b5bde5d5649a2e /dom/xbl | |
parent | e29f4488b1d8d33f3ca04531177d1c1690f57577 (diff) | |
download | uxp-914299b8ba22bb40fc30f83fe5481ebf4598ab48.tar.gz |
Issue #1691 - Part 8: Fix --enable-debug builds and continue dynamic module import changes.
https://bugzilla.mozilla.org/show_bug.cgi?id=1342012
Support import from timeout handlers by associating the initiating script with the compiled JSScript.
Fix error message that covers all import() failures that don't throw a JS exception.
https://bugzilla.mozilla.org/show_bug.cgi?id=1331662
Partial - Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes.
Left EvaluateString() in nsXBLProtoImplField.cpp until ExecutionContext errors can be fixed.
(cherry picked from commit 22fcfc77971a9bb204df664c474681f4dcf54211)
Diffstat (limited to 'dom/xbl')
-rw-r--r-- | dom/xbl/nsXBLProtoImplField.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dom/xbl/nsXBLProtoImplField.cpp b/dom/xbl/nsXBLProtoImplField.cpp index b7c04c25ae..2ace609cc9 100644 --- a/dom/xbl/nsXBLProtoImplField.cpp +++ b/dom/xbl/nsXBLProtoImplField.cpp @@ -434,6 +434,7 @@ nsXBLProtoImplField::InstallField(JS::Handle<JSObject*> aBoundNode, JS::CompileOptions options(cx); options.setFileAndLine(uriSpec.get(), mLineNumber) .setVersion(JSVERSION_LATEST); +#if 1 nsJSUtils::EvaluateOptions evalOptions(cx); if (!nsJSUtils::GetScopeChainForElement(cx, boundElement, evalOptions.scopeChain)) { @@ -442,6 +443,21 @@ nsXBLProtoImplField::InstallField(JS::Handle<JSObject*> aBoundNode, rv = nsJSUtils::EvaluateString(cx, nsDependentString(mFieldText, mFieldTextLength), scopeObject, options, evalOptions, &result); +#endif +#if 0 + JS::AutoObjectVector scopeChain(cx); + if (!nsJSUtils::GetScopeChainForElement(cx, boundElement, scopeChain)) { + return NS_ERROR_OUT_OF_MEMORY; + } + rv = NS_OK; + { + nsJSUtils::ExecutionContext exec(cx, scopeObject); + exec.SetScopeChain(scopeChain); + exec.Compile(options, nsDependentString(mFieldText, mFieldTextLength)); + rv = exec.ExecScript(&result); + } +#endif + if (NS_FAILED(rv)) { return rv; } |