tor-browser

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

15.2.3.6-4-117.js (787B)


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