S11.8.6_A5_T1.js (1588B)
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: TypeError is subclass of Error from instanceof operator point of view 6 es5id: 11.8.6_A5_T1 7 description: Checking Error case 8 ---*/ 9 10 var __err = new Error; 11 12 ////////////////////////////////////////////////////////////////////////////// 13 //CHECK#1 14 if (!(__err instanceof Error)) { 15 throw new Test262Error('#1: TypeError is subclass of Error from instanceof operator point of view'); 16 } 17 // 18 ////////////////////////////////////////////////////////////////////////////// 19 20 ////////////////////////////////////////////////////////////////////////////// 21 //CHECK#2 22 if (__err instanceof TypeError) { 23 throw new Test262Error('#2: TypeError is subclass of Error from instanceof operator point of view'); 24 } 25 // 26 ////////////////////////////////////////////////////////////////////////////// 27 28 var err__ = Error('failed'); 29 30 ////////////////////////////////////////////////////////////////////////////// 31 //CHECK#3 32 if (!(err__ instanceof Error)) { 33 throw new Test262Error('#3: TypeError is subclass of Error from instanceof operator point of view'); 34 } 35 // 36 ////////////////////////////////////////////////////////////////////////////// 37 38 ////////////////////////////////////////////////////////////////////////////// 39 //CHECK#4 40 if (err__ instanceof TypeError) { 41 throw new Test262Error('#4: TypeError is subclass of Error from instanceof operator point of view'); 42 } 43 // 44 ////////////////////////////////////////////////////////////////////////////// 45 46 reportCompare(0, 0);