aboutsummaryrefslogtreecommitdiff
path: root/test/compress/issue-1770.js
blob: 9008c6f42f40f838cc83fed37c9795e16cd6738b (about) (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
mangle_props: {
    mangle_props = {}
    input: {
        var obj = {
            undefined: 1,
            NaN: 2,
            Infinity: 3,
            "-Infinity": 4,
            "-0": 5,
        };
        console.log(
            obj[void 0],
            obj[undefined],
            obj["undefined"],
            obj[0/0],
            obj[NaN],
            obj["NaN"],
            obj[1/0],
            obj[Infinity],
            obj["Infinity"],
            obj[-1/0],
            obj[-Infinity],
            obj["-Infinity"],
            obj[-0],
            obj[-""],
            obj["-0"]
        );
    }
    expect: {
        var obj = {
            undefined: 1,
            NaN: 2,
            Infinity: 3,
            "-Infinity": 4,
            a: 5,
        };
        console.log(
            obj[void 0],
            obj[void 0],
            obj["undefined"],
            obj[0/0],
            obj[NaN],
            obj["NaN"],
            obj[1/0],
            obj[1/0],
            obj["Infinity"],
            obj[-1/0],
            obj[-1/0],
            obj["-Infinity"],
            obj[-0],
            obj[-""],
            obj["a"]
        );
    }
    expect_stdout: "1 1 1 2 2 2 3 3 3 4 4 4 undefined undefined 5"
}

identifier: {
    mangle_props = {}
    input: {
        var obj = {
            abstract: 1,
            boolean: 2,
            byte: 3,
            char: 4,
            class: 5,
            double: 6,
            enum: 7,
            export: 8,
            extends: 9,
            final: 10,
            float: 11,
            goto: 12,
            implements: 13,
            import: 14,
            int: 15,
            interface: 16,
            let: 17,
            long: 18,
            native: 19,
            package: 20,
            private: 21,
            protected: 22,
            public: 23,
            short: 24,
            static: 25,
            super: 26,
            synchronized: 27,
            this: 28,
            throws: 29,
            transient: 30,
            volatile: 31,
            yield: 32,
            false: 33,
            null: 34,
            true: 35,
            break: 36,
            case: 37,
            catch: 38,
            const: 39,
            continue: 40,
            debugger: 41,
            default: 42,
            delete: 43,
            do: 44,
            else: 45,
            finally: 46,
            for: 47,
            function: 48,
            if: 49,
            in: 50,
            instanceof: 51,
            new: 52,
            return: 53,
            switch: 54,
            throw: 55,
            try: 56,
            typeof: 57,
            var: 58,
            void: 59,
            while: 60,
            with: 61,
        };
    }
    expect: {
        var obj = {
            a: 1,
            b: 2,
            c: 3,
            d: 4,
            e: 5,
            f: 6,
            g: 7,
            h: 8,
            i: 9,
            j: 10,
            k: 11,
            l: 12,
            m: 13,
            n: 14,
            o: 15,
            p: 16,
            q: 17,
            r: 18,
            s: 19,
            t: 20,
            u: 21,
            v: 22,
            w: 23,
            x: 24,
            y: 25,
            z: 26,
            A: 27,
            B: 28,
            C: 29,
            D: 30,
            F: 31,
            G: 32,
            H: 33,
            I: 34,
            J: 35,
            K: 36,
            L: 37,
            M: 38,
            N: 39,
            O: 40,
            P: 41,
            Q: 42,
            R: 43,
            S: 44,
            T: 45,
            U: 46,
            V: 47,
            W: 48,
            X: 49,
            Y: 50,
            Z: 51,
            $: 52,
            _: 53,
            aa: 54,
            ba: 55,
            ca: 56,
            da: 57,
            ea: 58,
            fa: 59,
            ga: 60,
            ha: 61
        };
    }
}