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-112.js (820B)


      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-112
      6 description: >
      7    Object.defineProperties - 'O' is an Array, test the length
      8    property of 'O' is own data property (15.4.5.1 step 1)
      9 ---*/
     10 
     11 var arr = [0, 1];
     12 Object.defineProperty(arr, "1", {
     13  value: 1,
     14  configurable: false
     15 });
     16 assert.throws(TypeError, function() {
     17  Object.defineProperties(arr, {
     18    length: {
     19      value: 1
     20    }
     21  });
     22 });
     23 var desc = Object.getOwnPropertyDescriptor(arr, "length");
     24 
     25 assert.sameValue(desc.value, 2, 'desc.value');
     26 assert(desc.writable, 'desc.writable !== true');
     27 assert.sameValue(desc.enumerable, false, 'desc.enumerable');
     28 assert.sameValue(desc.configurable, false, 'desc.configurable');
     29 
     30 reportCompare(0, 0);