S12.6.1_A10.js (908B)
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 FunctionExpression within a "do-while" statement is allowed, but no 7 function with the given name will appear in the global context 8 es5id: 12.6.1_A10 9 description: Also this a test on FunctionExpression 10 ---*/ 11 12 var check = 0; 13 do { 14 if(typeof(f) === "function"){ 15 check = -1; 16 break; 17 } else { 18 check = 1; 19 break; 20 } 21 } while(function f(){}); 22 23 ////////////////////////////////////////////////////////////////////////////// 24 //CHECK#1 25 if (check !== 1) { 26 throw new Test262Error('#1: FunctionExpression within a "do-while" statement is allowed, but no function with the given name will appear in the global context'); 27 } 28 // 29 ////////////////////////////////////////////////////////////////////////////// 30 31 reportCompare(0, 0);