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 1850744 - Actually use the result of EmitReadSlotGuard r=iain
So, I wasn't handling traps on the proto chain correctly. As far as I can tell though this should generally just be resulting in us failing to perform optimally, as we should usually just load garbage out of the handler object and then fail in guardSpecificFunction. The only way this could deviate from that that I can think of is us segfaulting trying to load a bad slot from the object. Differential Revision: https://phabricator.services.mozilla.com/D188107
- Loading branch information
1 parent
47dda0e
commit 3684a39
Showing
2 changed files
with
28 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,25 @@ | ||
var target = {x: 5}; | ||
var returnValue = 42; | ||
var handlerProto = {}; | ||
var handler = {}; | ||
handlerProto.get = function(t, p) { | ||
return returnValue; | ||
} | ||
handler.foo = handlerProto.get; | ||
handler.__proto__ = handlerProto; | ||
|
||
var proxy = new Proxy(target, handler); | ||
|
||
function testGet(p) { | ||
return p.x; | ||
} | ||
|
||
for (i = 0; i < 500; i++) { | ||
assertEq(testGet(proxy), returnValue); | ||
} | ||
|
||
handlerProto.get = function() { | ||
return returnValue - 1; | ||
} | ||
|
||
assertEq(testGet(proxy), returnValue - 1); |
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