-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f10557
commit be5e243
Showing
4 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
require('../../common'); | ||
|
||
const spawnSync = require('child_process').spawnSync; | ||
|
||
const queue = [ | ||
'enum Foo{};', | ||
'throw new SyntaxError("hello")', | ||
'const foo;', | ||
'let x: number = 100;x;', | ||
'const foo: string = 10;', | ||
'function foo(){};foo<Number>(1);', | ||
'interface Foo{};const foo;', | ||
'function foo(){ await Promise.resolve(1)};', | ||
]; | ||
|
||
for (const cmd of queue) { | ||
const args = ['--disable-warning=ExperimentalWarning', '-p', cmd]; | ||
const result = spawnSync(process.execPath, args, { | ||
stdio: 'pipe' | ||
}); | ||
process.stdout.write(result.stdout); | ||
process.stdout.write(result.stderr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[eval]:1 | ||
enum Foo{}; | ||
^^^^ | ||
x TypeScript enum is not supported in strip-only mode | ||
,---- | ||
1 | enum Foo{}; | ||
: ^^^^^^^^^^ | ||
`---- | ||
|
||
SyntaxError: Unexpected reserved word | ||
|
||
Node.js * | ||
[eval]:1 | ||
throw new SyntaxError("hello") | ||
^ | ||
|
||
SyntaxError: hello | ||
|
||
Node.js * | ||
[eval]:1 | ||
const foo; | ||
^^^ | ||
|
||
SyntaxError: Missing initializer in const declaration | ||
|
||
Node.js * | ||
100 | ||
undefined | ||
false | ||
[eval]:1 | ||
;const foo; | ||
^^^ | ||
|
||
SyntaxError: Missing initializer in const declaration | ||
|
||
Node.js * | ||
[eval]:1 | ||
function foo(){ await Promise.resolve(1)}; | ||
^^^^^ | ||
x await isn't allowed in non-async function | ||
,---- | ||
1 | function foo(){ await Promise.resolve(1)}; | ||
: ^^^^^^^ | ||
`---- | ||
|
||
Caused by: | ||
failed to parse | ||
|
||
SyntaxError: await is only valid in async functions and the top level bodies of modules | ||
|
||
Node.js * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters