mirror of https://github.com/tc39/test262.git
Avoid using destructuring in tco-fn-realm.js
This commit is contained in:
parent
ab809f8f0c
commit
954d6370f9
|
@ -27,13 +27,15 @@ assert.sameValue(Array.prototype.toString.call({ join: {} }), "[object Object]")
|
|||
|
||||
let revokeOnGet = false;
|
||||
const proxyTarget = [];
|
||||
const { proxy, revoke } = Proxy.revocable(proxyTarget, {
|
||||
var proxyObj = Proxy.revocable(proxyTarget, {
|
||||
get: (target, key, receiver) => {
|
||||
if (revokeOnGet)
|
||||
revoke();
|
||||
return Reflect.get(target, key, receiver);
|
||||
},
|
||||
});
|
||||
var proxy = proxyObj.proxy;
|
||||
var revoke = proxyObj.revoke;
|
||||
|
||||
proxyTarget.join = undefined;
|
||||
assert.sameValue(Array.prototype.toString.call(proxy), "[object Array]");
|
||||
|
|
|
@ -12,7 +12,9 @@ features: [Proxy, tail-call-optimization]
|
|||
var other = $262.createRealm();
|
||||
var F = other.evalScript(`
|
||||
(function() {
|
||||
var { proxy, revoke } = Proxy.revocable(function() {}, {});
|
||||
var proxyObj = Proxy.revocable(function() {}, {});
|
||||
var proxy = proxyObj.proxy;
|
||||
var revoke = proxyObj.revoke;
|
||||
revoke();
|
||||
return proxy();
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue