S11.2.3_A4_T1.js (949B)
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 If MemberExpression does not implement the internal [[Call]] method, 7 throw TypeError 8 es5id: 11.2.3_A4_T1 9 description: Checking Boolean object case 10 ---*/ 11 12 //CHECK#1 13 try { 14 new Boolean(true)(); 15 throw new Test262Error('#1.1: new Boolean(true)() throw TypeError. Actual: ' + (new Boolean(true)())); 16 } 17 catch (e) { 18 if ((e instanceof TypeError) !== true) { 19 throw new Test262Error('#1.2: new Boolean(true)() throw TypeError. Actual: ' + (e)); 20 } 21 } 22 23 //CHECK#2 24 try { 25 var x = new Boolean(true); 26 x(); 27 throw new Test262Error('#2.1: var x = new Boolean(true); x() throw TypeError. Actual: ' + (x())); 28 } 29 catch (e) { 30 if ((e instanceof TypeError) !== true) { 31 throw new Test262Error('#2.2: var x = new Boolean(true); x() throw TypeError. Actual: ' + (e)); 32 } 33 } 34 35 reportCompare(0, 0);