tor-browser

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

15.2.3.7-6-a-161.js (885B)


      1 // Copyright (c) 2012 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 es5id: 15.2.3.7-6-a-161
      6 description: >
      7    Object.defineProperties - 'O' is an Array, 'P' is the length
      8    property of 'O', the [[Value]] field of 'desc' is less than value
      9    of  the length property,  test the [[Writable]] attribute of the
     10    length property is set to true at last after deleting properties
     11    with large index named if the [[Writable]] field of 'desc' is
     12    absent (15.4.5.1 step 3.h)
     13 ---*/
     14 
     15 var arr = [0, 1];
     16 
     17 Object.defineProperties(arr, {
     18  length: {
     19    value: 1
     20  }
     21 });
     22 
     23 arr.length = 10; //try to overwrite length value of arr
     24 
     25 assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")');
     26 assert.sameValue(arr.length, 10, 'arr.length');
     27 assert.sameValue(arr[0], 0, 'arr[0]');
     28 
     29 reportCompare(0, 0);