tor-browser

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

trap-is-null-target-is-proxy.js (880B)


      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 /*---
      5 esid: sec-proxy-object-internal-methods-and-internal-slots-isextensible
      6 description: >
      7  If "isExtensible" trap is null or undefined, [[IsExtensible]] call is
      8  properly forwarded to [[ProxyTarget]] (which is also a Proxy object).
      9 info: |
     10  [[IsExtensible]] ( )
     11 
     12  [...]
     13  4. Let target be O.[[ProxyTarget]].
     14  5. Let trap be ? GetMethod(handler, "isExtensible").
     15  6. If trap is undefined, then
     16    a. Return ? IsExtensible(target).
     17 
     18  IsExtensible ( O )
     19 
     20  1. Assert: Type(O) is Object.
     21  2. Return ? O.[[IsExtensible]]().
     22 features: [Proxy]
     23 ---*/
     24 
     25 var plainObjectTarget = new Proxy({}, {});
     26 var plainObjectProxy = new Proxy(plainObjectTarget, {
     27  isExtensible: null,
     28 });
     29 
     30 assert(Object.isExtensible(plainObjectProxy));
     31 
     32 reportCompare(0, 0);