tor-browser

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

mapped-arguments-nonconfigurable-delete-2.js (808B)


      1 // Copyright (C) 2015 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: Mapped arguments object with non-configurable property
      6 description: >
      7    Mapping works when property is non-configurable, arguments property
      8    was not deleted. Variable is changed with SetMutableBinding.
      9 flags: [noStrict]
     10 ---*/
     11 
     12 function argumentsAndDeleteSetMutableBinding(a) {
     13  Object.defineProperty(arguments, "0", {configurable: false});
     14 
     15  // Precondition: Delete is unsuccessful and doesn't affect mapping.
     16  assert.sameValue(delete arguments[0], false);
     17  assert.sameValue(a, 1);
     18  assert.sameValue(arguments[0], 1);
     19 
     20  a = 2;
     21  assert.sameValue(a, 2);
     22  assert.sameValue(arguments[0], 2);
     23 }
     24 argumentsAndDeleteSetMutableBinding(1);
     25 
     26 reportCompare(0, 0);