S15.3_A2_T2.js (631B)
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 Since applying the "call" method to Function constructor themself leads 7 to creating a new function instance, the second argument must be a valid 8 function body 9 es5id: 15.3_A2_T2 10 description: Checking if executing "Function.call(this, "var #x = 1;")" fails 11 ---*/ 12 13 try { 14 Function.call(this, "var #x = 1;"); 15 } catch (e) { 16 assert( 17 e instanceof SyntaxError, 18 'The result of evaluating (e instanceof SyntaxError) is expected to be true' 19 ); 20 } 21 22 reportCompare(0, 0);