S11.2.1_A3_T1.js (1043B)
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_T1 10 description: Checking Boolean case 11 ---*/ 12 13 //CHECK#1 14 if (true.toString() !== "true") { 15 throw new Test262Error('#1: true.toString() === "true". Actual: ' + (true.toString())); 16 } 17 18 //CHECK#2 19 if (false["toString"]() !== "false") { 20 throw new Test262Error('#2: false["toString"]() === "false". Actual: ' + (false["toString"]())); 21 } 22 23 //CHECK#3 24 if (new Boolean(true).toString() !== "true") { 25 throw new Test262Error('#3: new Boolean(true).toString() === "true". Actual: ' + (new Boolean(true).toString())); 26 } 27 28 //CHECK#4 29 if (new Boolean(false)["toString"]() !== "false") { 30 throw new Test262Error('#4: new Boolean(false)["toString"]() === "false". Actual: ' + (new Boolean(false)["toString"]())); 31 } 32 33 reportCompare(0, 0);