Add test of toplevel return in JS script

This commit is contained in:
Nathan Shively-Sanders
2022-05-02 14:47:01 -07:00
parent 6291ae3ba2
commit 2a6dec475a
4 changed files with 12 additions and 48 deletions

View File

@@ -1,22 +1,8 @@
//// [tests/cases/conformance/salsa/plainJSGrammarErrors2.ts] ////
//// [plainJSGrammarErrors2.js]
//// [a.js]
export default 1;
//// [b.js]
/**
* @deprecated
*/
export { default as A } from "./a";
// top-level return allowed in JS script files
return
//// [plainJSGrammarErrors2.js]
//// [a.js]
export default 1;
//// [b.js]
/**
* @deprecated
*/
export { default as A } from "./a";
// top-level return allowed in JS script files
return;

View File

@@ -1,13 +1,5 @@
=== tests/cases/conformance/salsa/plainJSGrammarErrors2.js ===
No type information for this code.=== /a.js ===
export default 1;
// top-level return allowed in JS script files
No type information for this code.return
No type information for this code.
No type information for this code.=== /b.js ===
/**
* @deprecated
*/
export { default as A } from "./a";
>default : Symbol(default, Decl(a.js, 0, 0))
>A : Symbol(A, Decl(b.js, 3, 8))
No type information for this code.

View File

@@ -1,13 +1,5 @@
=== tests/cases/conformance/salsa/plainJSGrammarErrors2.js ===
No type information for this code.=== /a.js ===
export default 1;
// top-level return allowed in JS script files
No type information for this code.return
No type information for this code.
No type information for this code.=== /b.js ===
/**
* @deprecated
*/
export { default as A } from "./a";
>default : 1
>A : 1
No type information for this code.

View File

@@ -4,11 +4,5 @@
// @allowJs: true
// @filename: plainJSGrammarErrors2.js
// @filename: /a.js
export default 1;
// @filename: /b.js
/**
* @deprecated
*/
export { default as A } from "./a";
// top-level return allowed in JS script files
return