forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1851416 - Properly guard that the proxy hasn't been revoked r=iain
Maybe a little bit alarming how simple this testcase is. Differential Revision: https://phabricator.services.mozilla.com/D187511
- Loading branch information
1 parent
83f8a62
commit fd2c6e6
Showing
9 changed files
with
42 additions
and
15 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,22 @@ | ||
load(libdir + "asserts.js"); | ||
|
||
var target = {x: 5}; | ||
var returnValue = 42; | ||
var handler = { | ||
get(t, p) { | ||
return returnValue; | ||
} | ||
}; | ||
var {proxy, revoke} = Proxy.revocable(target, handler); | ||
|
||
function testGet(p) { | ||
return p.x; | ||
} | ||
|
||
for (i = 0; i < 200; i++) { | ||
assertEq(testGet(proxy), returnValue); | ||
} | ||
|
||
assertEq(testGet(proxy), returnValue); | ||
revoke(); | ||
assertThrowsInstanceOf(function () { testGet(proxy) }, TypeError); |
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
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
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
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
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
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
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
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