summaryrefslogtreecommitdiff
path: root/dom/xbl
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-04-23 17:53:38 -0500
committerBrian Smith <brian@dbsoft.org>2023-04-27 13:35:21 -0500
commit1adf442e9249afed3d557ba0c679150e4d85c60e (patch)
tree0f4e4d6c54b865064228f42b3307ec30c962b5ab /dom/xbl
parent7b42bc809de8cd925f413f39d5248c765bd56c43 (diff)
downloaduxp-1adf442e9249afed3d557ba0c679150e4d85c60e.tar.gz
Issue #1691 - Part 12: Fix return value in ExecScript() and debug assert in ParseTask.
https://bugzilla.mozilla.org/show_bug.cgi?id=1331662 Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. ExecutionContext: The mRetValue is not used even though it is checked in various asserts. This is how it is in the Mozilla code even years later, only the passed in value is used. ParseTask: JoinDecode() and JoinCompile() run the same code but the type is different causing a debug assert when it checks the type Script vs ScriptDecode. (cherry picked from commit 8f577428b7834b7d0f0d5afacbe060fbb1ff2136)
Diffstat (limited to 'dom/xbl')
-rw-r--r--dom/xbl/nsXBLProtoImplField.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/dom/xbl/nsXBLProtoImplField.cpp b/dom/xbl/nsXBLProtoImplField.cpp
index 2ace609cc9..a68ff67aea 100644
--- a/dom/xbl/nsXBLProtoImplField.cpp
+++ b/dom/xbl/nsXBLProtoImplField.cpp
@@ -434,17 +434,6 @@ 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)) {
- return NS_ERROR_OUT_OF_MEMORY;
- }
- 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;
@@ -456,7 +445,6 @@ nsXBLProtoImplField::InstallField(JS::Handle<JSObject*> aBoundNode,
exec.Compile(options, nsDependentString(mFieldText, mFieldTextLength));
rv = exec.ExecScript(&result);
}
-#endif
if (NS_FAILED(rv)) {
return rv;