summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/lexical-environment/block-scoped-functions-annex-b-generators.js
blob: dbef82bcfc62e4d7ac8a882c3d5d8b904f71d9e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Tests by André Bargull <andrebargull@googlemail.com>

// Annex B.3.3.1
function f1() {
    { function* g() {} }
    assertEq(typeof g, "undefined");
}
f1();

// Annex B.3.3.2
{ function* g() {} }
assertEq(typeof g, "undefined");

// Annex B.3.3.3
function f2() {
    eval("{ function* g() {} }");
    assertEq(typeof g, "undefined");
}
f2();

// Annex B.3.3.3
eval("{ function* g() {} }");
assertEq(typeof g, "undefined");

if (typeof reportCompare === "function")
    reportCompare(true, true);