Debian Codegraph @

js/src/tests/test262/language/statements/while/S12.6.2_A10.js

raw
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 "while" IterationStatement is allowed, but no
7 function with the given name will appear in the global context
8 es5id: 12.6.2_A10
9 description: Testing FunctionExpression too
10 ---*/
11
12 var check=0;
13 while(function f(){}){
14 if(typeof(f) === "function") {
15 check = -1;
16 break;
17 } else {
18 check = 1;
19 break;
20 }
21 }
22
23 //////////////////////////////////////////////////////////////////////////////
24 //CHECK#1
25 if (check !== 1) {
26 throw new Test262Error('#1: FunctionExpression inside while construction expression allowed but function not declare');
27 }
28 //
29 //////////////////////////////////////////////////////////////////////////////
30
31 reportCompare(0, 0);