From 954d6370f99b22fbce174562f6718dd69afd3094 Mon Sep 17 00:00:00 2001 From: tannal Date: Wed, 9 Oct 2024 10:08:04 +0800 Subject: [PATCH] Avoid using destructuring in tco-fn-realm.js --- .../Array/prototype/toString/non-callable-join-string-tag.js | 4 +++- test/built-ins/Proxy/revocable/tco-fn-realm.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/built-ins/Array/prototype/toString/non-callable-join-string-tag.js b/test/built-ins/Array/prototype/toString/non-callable-join-string-tag.js index 24d86d7902..d3628a9436 100644 --- a/test/built-ins/Array/prototype/toString/non-callable-join-string-tag.js +++ b/test/built-ins/Array/prototype/toString/non-callable-join-string-tag.js @@ -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]"); diff --git a/test/built-ins/Proxy/revocable/tco-fn-realm.js b/test/built-ins/Proxy/revocable/tco-fn-realm.js index 493fca63c6..b6f08acfc6 100644 --- a/test/built-ins/Proxy/revocable/tco-fn-realm.js +++ b/test/built-ins/Proxy/revocable/tco-fn-realm.js @@ -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(); })