tor-browser

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

define-own-prop-length-overflow-realm.js (677B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-array-exotic-objects-defineownproperty-p-desc
      5 es6id: 9.4.2.1
      6 description: >
      7  Error when setting a length larger than 2**32 (honoring the Realm of the
      8  current execution context)
      9 info: |
     10  [...]
     11  2. If P is "length", then
     12     a. Return ? ArraySetLength(A, Desc).
     13 features: [cross-realm]
     14 ---*/
     15 
     16 var OArray = $262.createRealm().global.Array;
     17 var array = new OArray();
     18 
     19 assert.throws(RangeError, function() {
     20  array.length = 4294967296;
     21 }, 'array.length = 4294967296 throws a RangeError exception');
     22 
     23 reportCompare(0, 0);