target-is-revoked-function-proxy.js (686B)
1 // Copyright (C) 2020 Alexey Shvayka. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-proxycreate 5 description: > 6 A Proxy is created with its [[ProxyTarget]] as revoked function Proxy. 7 info: | 8 ProxyCreate ( target, handler ) 9 10 [...] 11 3. Let P be ! MakeBasicObject(« [[ProxyHandler]], [[ProxyTarget]] »). 12 [...] 13 6. Set P.[[ProxyTarget]] to target. 14 [...] 15 8. Return P. 16 features: [Proxy] 17 ---*/ 18 19 var revocableTarget = Proxy.revocable(function() {}, {}); 20 revocableTarget.revoke(); 21 22 var revocable = Proxy.revocable(revocableTarget.proxy, {}); 23 assert.sameValue(typeof revocable.proxy, "function"); 24 25 reportCompare(0, 0);