tor-browser

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

nonconfigurable-nonwritable-descriptors-basic.js (845B)


      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 with non-configurable and non-writable property
      6 info: |
      7    Mapping stop working when property is set to non-writable. The
      8    descriptor's value need to be the one set before the property be configured as
      9    writable: false.
     10 flags: [noStrict]
     11 esid: sec-arguments-exotic-objects-defineownproperty-p-desc
     12 includes: [propertyHelper.js]
     13 ---*/
     14 
     15 function fn(a) {
     16  Object.defineProperty(arguments, "0", {configurable: false, writable: false});
     17 
     18  // Postcondition: Arguments mapping is removed.
     19  a = 2;
     20 
     21  verifyProperty(arguments, "0", {
     22    value: 1,
     23    writable: false,
     24    enumerable: true,
     25    configurable: false,
     26  });
     27 }
     28 fn(1);
     29 
     30 
     31 reportCompare(0, 0);