Skip to content

Commit 2a6dec4

Browse files
committed
Add test of toplevel return in JS script
1 parent 6291ae3 commit 2a6dec4

File tree

4 files changed

+12
-48
lines changed

4 files changed

+12
-48
lines changed
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1-
//// [tests/cases/conformance/salsa/plainJSGrammarErrors2.ts] ////
2-
31
//// [plainJSGrammarErrors2.js]
4-
5-
//// [a.js]
6-
export default 1;
7-
8-
//// [b.js]
9-
/**
10-
* @deprecated
11-
*/
12-
export { default as A } from "./a";
2+
// top-level return allowed in JS script files
3+
return
134

145

156
//// [plainJSGrammarErrors2.js]
16-
//// [a.js]
17-
export default 1;
18-
//// [b.js]
19-
/**
20-
* @deprecated
21-
*/
22-
export { default as A } from "./a";
7+
// top-level return allowed in JS script files
8+
return;
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
=== tests/cases/conformance/salsa/plainJSGrammarErrors2.js ===
2-
3-
No type information for this code.=== /a.js ===
4-
export default 1;
2+
// top-level return allowed in JS script files
3+
No type information for this code.return
54
No type information for this code.
6-
No type information for this code.=== /b.js ===
7-
/**
8-
* @deprecated
9-
*/
10-
export { default as A } from "./a";
11-
>default : Symbol(default, Decl(a.js, 0, 0))
12-
>A : Symbol(A, Decl(b.js, 3, 8))
13-
5+
No type information for this code.
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
=== tests/cases/conformance/salsa/plainJSGrammarErrors2.js ===
2-
3-
No type information for this code.=== /a.js ===
4-
export default 1;
2+
// top-level return allowed in JS script files
3+
No type information for this code.return
54
No type information for this code.
6-
No type information for this code.=== /b.js ===
7-
/**
8-
* @deprecated
9-
*/
10-
export { default as A } from "./a";
11-
>default : 1
12-
>A : 1
13-
5+
No type information for this code.

tests/cases/conformance/salsa/plainJSGrammarErrors2.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,5 @@
44
// @allowJs: true
55
// @filename: plainJSGrammarErrors2.js
66

7-
// @filename: /a.js
8-
export default 1;
9-
10-
// @filename: /b.js
11-
/**
12-
* @deprecated
13-
*/
14-
export { default as A } from "./a";
7+
// top-level return allowed in JS script files
8+
return

0 commit comments

Comments
 (0)