+80
-97
lines changedFilter options
+80
-97
lines changed Original file line number Diff line number Diff line change
@@ -8,16 +8,11 @@ with(this){__filename}
8
8
: ^^^^
9
9
`----
10
10
11
-
12
11
Caused by:
13
12
failed to parse
14
13
15
14
SyntaxError: Strict mode code may not include a with statement
16
15
17
-
18
-
19
-
20
-
21
16
Node.js *
22
17
42
23
18
42
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
1
+
'use strict';
2
+
3
+
require('../../common');
4
+
5
+
const spawnSync = require('child_process').spawnSync;
6
+
7
+
const queue = [
8
+
'enum Foo{};',
9
+
'throw new SyntaxError("hello")',
10
+
'const foo;',
11
+
'let x: number = 100;x;',
12
+
'const foo: string = 10;',
13
+
'function foo(){};foo<Number>(1);',
14
+
'interface Foo{};const foo;',
15
+
'function foo(){ await Promise.resolve(1)};',
16
+
];
17
+
18
+
for (const cmd of queue) {
19
+
const args = ['--disable-warning=ExperimentalWarning', '-p', cmd];
20
+
const result = spawnSync(process.execPath, args, {
21
+
stdio: 'pipe'
22
+
});
23
+
process.stdout.write(result.stdout);
24
+
process.stdout.write(result.stderr);
25
+
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
1
+
[eval]:1
2
+
enum Foo{};
3
+
^^^^
4
+
x TypeScript enum is not supported in strip-only mode
5
+
,----
6
+
1 | enum Foo{};
7
+
: ^^^^^^^^^^
8
+
`----
9
+
10
+
SyntaxError: Unexpected reserved word
11
+
12
+
Node.js *
13
+
[eval]:1
14
+
throw new SyntaxError("hello")
15
+
^
16
+
17
+
SyntaxError: hello
18
+
19
+
Node.js *
20
+
[eval]:1
21
+
const foo;
22
+
^^^
23
+
24
+
SyntaxError: Missing initializer in const declaration
25
+
26
+
Node.js *
27
+
100
28
+
undefined
29
+
false
30
+
[eval]:1
31
+
;const foo;
32
+
^^^
33
+
34
+
SyntaxError: Missing initializer in const declaration
35
+
36
+
Node.js *
37
+
[eval]:1
38
+
function foo(){ await Promise.resolve(1)};
39
+
^^^^^
40
+
x await isn't allowed in non-async function
41
+
,----
42
+
1 | function foo(){ await Promise.resolve(1)};
43
+
: ^^^^^^^
44
+
`----
45
+
46
+
Caused by:
47
+
failed to parse
48
+
49
+
SyntaxError: await is only valid in async functions and the top level bodies of modules
50
+
51
+
Node.js *
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ with(this){__filename}
8
8
: ^^^^
9
9
`----
10
10
11
-
12
11
Caused by:
13
12
failed to parse
14
13
Original file line number Diff line number Diff line change
@@ -7,17 +7,8 @@ enum Foo{};
7
7
: ^^^^^^^^^^
8
8
`----
9
9
10
-
11
10
SyntaxError: Unexpected reserved word
12
11
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
12
Node.js *
22
13
[stdin]:1
23
14
enum Foo{};
@@ -28,81 +19,36 @@ enum Foo{};
28
19
: ^^^^^^^^^^
29
20
`----
30
21
31
-
32
22
SyntaxError: Unexpected reserved word
33
23
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
24
Node.js *
43
25
[stdin]:1
44
26
throw new SyntaxError("hello")
45
27
^
46
28
47
29
SyntaxError: hello
48
30
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
31
Node.js *
60
32
[stdin]:1
61
33
throw new SyntaxError("hello")
62
34
^
63
35
64
36
SyntaxError: hello
65
37
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
38
Node.js *
77
39
[stdin]:1
78
40
const foo;
79
41
^^^
80
42
81
43
SyntaxError: Missing initializer in const declaration
82
44
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
45
Node.js *
92
46
[stdin]:1
93
47
const foo;
94
48
^^^
95
49
96
50
SyntaxError: Missing initializer in const declaration
97
51
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
52
Node.js *
107
53
100
108
54
100
@@ -116,29 +62,13 @@ false
116
62
117
63
SyntaxError: Missing initializer in const declaration
118
64
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
65
Node.js *
128
66
[stdin]:1
129
67
;const foo;
130
68
^^^
131
69
132
70
SyntaxError: Missing initializer in const declaration
133
71
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
72
Node.js *
143
73
[stdin]:1
144
74
function foo(){ await Promise.resolve(1)};
@@ -149,20 +79,11 @@ function foo(){ await Promise.resolve(1)};
149
79
: ^^^^^^^
150
80
`----
151
81
152
-
153
82
Caused by:
154
83
failed to parse
155
84
156
85
SyntaxError: await is only valid in async functions and the top level bodies of modules
157
86
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
87
Node.js *
167
88
[stdin]:1
168
89
function foo(){ await Promise.resolve(1)};
@@ -173,19 +94,10 @@ function foo(){ await Promise.resolve(1)};
173
94
: ^^^^^^^
174
95
`----
175
96
176
-
177
97
Caused by:
178
98
failed to parse
179
99
180
100
SyntaxError: await is only valid in async functions and the top level bodies of modules
181
101
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
102
Node.js *
191
103
done
Original file line number Diff line number Diff line change
@@ -10,12 +10,12 @@ describe('eval output', { concurrency: true }, () => {
10
10
}
11
11
12
12
const defaultTransform = snapshot.transform(
13
-
removeStackTraces,
14
-
filterEmptyLines,
15
13
normalize,
16
14
snapshot.replaceWindowsLineEndings,
17
15
snapshot.replaceWindowsPaths,
18
-
snapshot.replaceNodeVersion
16
+
snapshot.replaceNodeVersion,
17
+
removeStackTraces,
18
+
filterEmptyLines,
19
19
);
20
20
21
21
function removeStackTraces(output) {
@@ -30,6 +30,7 @@ describe('eval output', { concurrency: true }, () => {
30
30
{ name: 'eval/eval_messages.js' },
31
31
{ name: 'eval/stdin_messages.js' },
32
32
{ name: 'eval/stdin_typescript.js' },
33
+
{ name: 'eval/eval_typescript.js' },
33
34
];
34
35
35
36
for (const { name } of tests) {
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4