tor-browser

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

S15.4.5.1_A1.3_T1.js (1002B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-array-exotic-objects-defineownproperty-p-desc
      6 info: Set the value of property length of A to Uint32(length)
      7 es5id: 15.4.5.1_A1.3_T1
      8 description: length is object or primitve
      9 ---*/
     10 
     11 var x = [];
     12 x.length = true;
     13 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
     14 
     15 x = [0];
     16 x.length = null;
     17 assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
     18 
     19 x = [0];
     20 x.length = new Boolean(false);
     21 assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
     22 
     23 x = [];
     24 x.length = new Number(1);
     25 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
     26 
     27 x = [];
     28 x.length = "1";
     29 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
     30 
     31 x = [];
     32 x.length = new String("1");
     33 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
     34 
     35 reportCompare(0, 0);