mirror of
https://github.com/tc39/test262.git
synced 2025-07-20 12:34:41 +02:00
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;
|
let revokeOnGet = false;
|
||||||
const proxyTarget = [];
|
const proxyTarget = [];
|
||||||
const { proxy, revoke } = Proxy.revocable(proxyTarget, {
|
var proxyObj = Proxy.revocable(proxyTarget, {
|
||||||
get: (target, key, receiver) => {
|
get: (target, key, receiver) => {
|
||||||
if (revokeOnGet)
|
if (revokeOnGet)
|
||||||
revoke();
|
revoke();
|
||||||
return Reflect.get(target, key, receiver);
|
return Reflect.get(target, key, receiver);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
var proxy = proxyObj.proxy;
|
||||||
|
var revoke = proxyObj.revoke;
|
||||||
|
|
||||||
proxyTarget.join = undefined;
|
proxyTarget.join = undefined;
|
||||||
assert.sameValue(Array.prototype.toString.call(proxy), "[object Array]");
|
assert.sameValue(Array.prototype.toString.call(proxy), "[object Array]");
|
||||||
|
@ -12,7 +12,9 @@ features: [Proxy, tail-call-optimization]
|
|||||||
var other = $262.createRealm();
|
var other = $262.createRealm();
|
||||||
var F = other.evalScript(`
|
var F = other.evalScript(`
|
||||||
(function() {
|
(function() {
|
||||||
var { proxy, revoke } = Proxy.revocable(function() {}, {});
|
var proxyObj = Proxy.revocable(function() {}, {});
|
||||||
|
var proxy = proxyObj.proxy;
|
||||||
|
var revoke = proxyObj.revoke;
|
||||||
revoke();
|
revoke();
|
||||||
return proxy();
|
return proxy();
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user