tor-browser

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

S11.1.4_A1.5.js (1726B)


      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 info: "Evaluate the production ArrayLiteral: [ AssignmentExpression, Elision ]"
      6 es5id: 11.1.4_A1.5
      7 description: >
      8    Checking various properteis and contents of the array defined with
      9    "var array = [4,5,,,,]"
     10 ---*/
     11 
     12 var array = [4,5,,,,];
     13 
     14 //CHECK#1
     15 if (typeof array !== "object") {
     16  throw new Test262Error('#1: var array = [4,5,,,,]; typeof array === "object". Actual: ' + (typeof array));
     17 }
     18 
     19 //CHECK#2
     20 if (array instanceof Array !== true) {
     21  throw new Test262Error('#2: var array = [4,5,,,,]; array instanceof Array === true');
     22 }
     23 
     24 //CHECK#3
     25 if (array.toString !== Array.prototype.toString) {
     26  throw new Test262Error('#3: var array = [4,5,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
     27 }
     28 
     29 //CHECK#4
     30 if (array.length !== 5) {
     31  throw new Test262Error('#4: var array = [4,5,,,,]; array.length === 5. Actual: ' + (array.length));
     32 }
     33 
     34 //CHECK#5
     35 if (array[0] !== 4) {
     36  throw new Test262Error('#5: var array = [4,5,,,,]; array[0] === 4. Actual: ' + (array[0]));
     37 }
     38 
     39 //CHECK#6
     40 if (array[1] !== 5) {
     41  throw new Test262Error('#6: var array = [4,5,,,,]; array[1] === 5. Actual: ' + (array[1]));
     42 }
     43 
     44 //CHECK#7
     45 if (array[2] !== undefined) {
     46  throw new Test262Error('#7: var array = [4,5,,,,]; array[2] === undefined. Actual: ' + (array[2]));
     47 }
     48 
     49 //CHECK#8
     50 if (array[3] !== undefined) {
     51  throw new Test262Error('#8: var array = [4,5,,,,]; array[3] === undefined. Actual: ' + (array[3]));
     52 }
     53 
     54 //CHECK#9
     55 if (array[4] !== undefined) {
     56  throw new Test262Error('#9: var array = [4,5,,,,]; array[4] === undefined. Actual: ' + (array[4]));
     57 }
     58 
     59 reportCompare(0, 0);