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-183.js (750B)


      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-183
      6 description: >
      7    Object.defineProperties - TypeError is not thrown if 'O' is an
      8    Array, 'P' is an array index named property, [[Writable]]
      9    attribute of the length property in 'O' is false, value of 'P' is
     10    less than value of the length property in'O'  (15.4.5.1 step 4.b)
     11 ---*/
     12 
     13 var arr = [1, 2, 3];
     14 
     15 Object.defineProperty(arr, "length", {
     16  writable: false
     17 });
     18 
     19 Object.defineProperties(arr, {
     20  "1": {
     21    value: "abc"
     22  }
     23 });
     24 
     25 assert.sameValue(arr[0], 1, 'arr[0]');
     26 assert.sameValue(arr[1], "abc", 'arr[1]');
     27 assert.sameValue(arr[2], 3, 'arr[2]');
     28 
     29 reportCompare(0, 0);