-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1823042 - Switch to bound function target's realm before creating…
… |this|. r=iain For non-constructing calls it's simpler and faster to switch after pushing the arguments and loading the bound function's target, but for constructor calls this needs to happen earlier. Differential Revision: https://phabricator.services.mozilla.com/D173281
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function f() { | ||
var g = newGlobal({sameCompartmentAs: this}); | ||
g.evaluate(`function f() {}`); | ||
var boundF = g.f.bind(null); | ||
for (var i = 0; i < 50; i++) { | ||
var obj = new boundF(); | ||
assertEq(objectGlobal(obj), g); | ||
} | ||
} | ||
f(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters