S11.8.6_A3.js (1569B)
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: If ShiftExpression is not an object, throw TypeError 6 es5id: 11.8.6_A3 7 description: Checking all the types of primitives 8 ---*/ 9 10 //CHECK#1 11 try { 12 true instanceof true; 13 throw new Test262Error('#1: true instanceof true throw TypeError'); 14 } 15 catch (e) { 16 if (e instanceof TypeError !== true) { 17 throw new Test262Error('#1: true instanceof true throw TypeError'); 18 } 19 } 20 21 //CHECK#2 22 try { 23 1 instanceof 1; 24 throw new Test262Error('#2: 1 instanceof 1 throw TypeError'); 25 } 26 catch (e) { 27 if (e instanceof TypeError !== true) { 28 throw new Test262Error('#2: 1 instanceof 1 throw TypeError'); 29 } 30 } 31 32 //CHECK#3 33 try { 34 "string" instanceof "string"; 35 throw new Test262Error('#3: "string" instanceof "string" throw TypeError'); 36 } 37 catch (e) { 38 if (e instanceof TypeError !== true) { 39 throw new Test262Error('#3: "string" instanceof "string" throw TypeError'); 40 } 41 } 42 43 //CHECK#4 44 try { 45 undefined instanceof undefined; 46 throw new Test262Error('#4: undefined instanceof undefined throw TypeError'); 47 } 48 catch (e) { 49 if (e instanceof TypeError !== true) { 50 throw new Test262Error('#4: undefined instanceof undefined throw TypeError'); 51 } 52 } 53 54 //CHECK#5 55 try { 56 null instanceof null; 57 throw new Test262Error('#5: null instanceof null throw TypeError'); 58 } 59 catch (e) { 60 if (e instanceof TypeError !== true) { 61 throw new Test262Error('#5: null instanceof null throw TypeError'); 62 } 63 } 64 65 reportCompare(0, 0);