tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

create-target-is-revoked-function-proxy.js (656B)


      1 // Copyright (C) 2015 the V8 project authors. 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 revocable = Proxy.revocable(function() {}, {});
     20 revocable.revoke();
     21 
     22 var proxy = new Proxy(revocable.proxy, {});
     23 assert.sameValue(typeof proxy, "function");
     24 
     25 reportCompare(0, 0);