S11.2.1_A3_T4.js (1015B)
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: | 6 MemberExpression calls ToObject(MemberExpression) and 7 ToString(Expression). CallExpression calls ToObject(CallExpression) and 8 ToString(Expression) 9 es5id: 11.2.1_A3_T4 10 description: Checking "undefined" case 11 ---*/ 12 13 //CHECK#1 14 try { 15 undefined.toString(); 16 throw new Test262Error('#1.1: undefined.toString() throw TypeError. Actual: ' + (undefined.toString())); 17 } 18 catch (e) { 19 if ((e instanceof TypeError) !== true) { 20 throw new Test262Error('#1.2: undefined.toString() throw TypeError. Actual: ' + (e)); 21 } 22 } 23 24 //CHECK#2 25 try { 26 undefined["toString"](); 27 throw new Test262Error('#2.1: undefined["toString"]() throw TypeError. Actual: ' + (undefined["toString"]())); 28 } 29 catch (e) { 30 if ((e instanceof TypeError) !== true) { 31 throw new Test262Error('#2.2: undefined["toString"]() throw TypeError. Actual: ' + (e)); 32 } 33 } 34 35 reportCompare(0, 0);