tor-browser

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

nonwritable-nonconfigurable-descriptors-set-by-param.js (1005B)


      1 // Copyright (C) 2017 Caio Lima. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 description: Mapped arguments property descriptor change to non-writable and non-configurable
      6 info: |
      7    Mapping just stop working when property is set to non-writable. Change the
      8    descriptor using [[DefineOwnProperty]] to {writable: false}, set a = 2 and then
      9    change property descriptor to {configurable: false}.
     10    The descriptor's value is the one set before the property be
     11    configured as {writable: false} because mapping was removed.
     12 flags: [noStrict]
     13 esid: sec-arguments-exotic-objects-defineownproperty-p-desc
     14 includes: [propertyHelper.js]
     15 ---*/
     16 
     17 function fn(a) {
     18  Object.defineProperty(arguments, "0", {writable: false});
     19  a = 2;
     20  Object.defineProperty(arguments, "0", {configurable: false});
     21 
     22  verifyProperty(arguments, "0", {
     23    value: 1,
     24    writable: false,
     25    enumerable: true,
     26    configurable: false,
     27  });
     28 }
     29 fn(1);
     30 
     31 
     32 reportCompare(0, 0);