summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/lazy-flag-consistency.js
blob: 06096beaa64bee79ce0a84b482ec4be4e356a7ef (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// These tests highlight potential differences between the lazy and non-lazy
// parse modes. The delazification process should be able to assert that script
// flags are consistent.

function dead_inner_function_1() {
    (function() {})
}
dead_inner_function_1();

function dead_inner_function_2() {
    if (false) {
        function inner() {}
    }
}
dead_inner_function_2();

function inner_eval_1() {
    eval("");
}
inner_eval_1();

function inner_eval_2() {
    (function() {
        eval("");
    })
}
inner_eval_2();

function inner_eval_3() {
    (() => eval(""));
}
inner_eval_3();

function inner_delete_1() {
    var x;
    (function() { delete x; })
}
inner_delete_1();

function inner_delete_2() {
    var x;
    (() => delete x);
}
inner_delete_2();

function inner_this_1() {
    (() => this);
}
inner_this_1();

function inner_arguments_1() {
    (() => arguments);
}
inner_arguments_1();

function constructor_wrapper_1() {
    return (function() {
        this.initialize.apply(this, arguments);
    });
}
constructor_wrapper_1();

var runonce_lazy_1 = function (){}();

var runonce_lazy_2 = function* (){}();