S11.2.3_A4_T3.js (932B)
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_T3 9 description: Checking String object case 10 ---*/ 11 12 //CHECK#1 13 try { 14 new String("1")(); 15 throw new Test262Error('#1.1: new String("1")() throw TypeError. Actual: ' + (new String("1")())); 16 } 17 catch (e) { 18 if ((e instanceof TypeError) !== true) { 19 throw new Test262Error('#1.2: new String("1")() throw TypeError. Actual: ' + (e)); 20 } 21 } 22 23 //CHECK#2 24 try { 25 var x = new String("1"); 26 x(); 27 throw new Test262Error('#2.1: var x = new String("1"); x() throw TypeError. Actual: ' + (x())); 28 } 29 catch (e) { 30 if ((e instanceof TypeError) !== true) { 31 throw new Test262Error('#2.2: var x = new String("1"); x() throw TypeError. Actual: ' + (e)); 32 } 33 } 34 35 reportCompare(0, 0);