mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 642022 - Deal with the return value being in a different compartment. r=gal
--HG-- extra : rebase_source : b924c99e830cdafd7e1471cf087e69cfc7e33e23
This commit is contained in:
parent
f82a68b669
commit
697524ea29
4
content/base/crashtests/642022-1.html
Normal file
4
content/base/crashtests/642022-1.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
InstallTrigger.constructor.create(window).setTimeout(Array, 0);
|
||||
</script>
|
@ -86,5 +86,6 @@ load 593302-2.html
|
||||
load 610571-1.html
|
||||
load 604262-1.html
|
||||
load 628599-1.html
|
||||
load 642022-1.html
|
||||
load 637214-1.svg
|
||||
load 637214-2.svg
|
||||
|
@ -1925,10 +1925,16 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler
|
||||
// Convert to variant before calling ScriptEvaluated, as it may GC, meaning
|
||||
// we would need to root rval.
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (rval == JSVAL_NULL)
|
||||
if (rval == JSVAL_NULL) {
|
||||
*arv = nsnull;
|
||||
else
|
||||
rv = nsContentUtils::XPConnect()->JSToVariant(mContext, rval, arv);
|
||||
} else {
|
||||
if (!JS_WrapValue(mContext, &rval)) {
|
||||
ReportPendingException();
|
||||
rv = NS_ERROR_FAILURE;
|
||||
} else {
|
||||
rv = nsContentUtils::XPConnect()->JSToVariant(mContext, rval, arv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ScriptEvaluated needs to come after we pop the stack
|
||||
|
Loading…
Reference in New Issue
Block a user