Skip to content

Commit

Permalink
fix(48291): omit jsdoc modifiers (microsoft#48304)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tarasyuk authored Mar 17, 2022
1 parent 9a2868b commit c1cf901
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40540,7 +40540,7 @@ namespace ts {
return;
}

if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) {
if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) {
grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers);
}

Expand Down
22 changes: 22 additions & 0 deletions tests/baselines/reference/plainJSGrammarErrors2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//// [tests/cases/conformance/salsa/plainJSGrammarErrors2.ts] ////

//// [plainJSGrammarErrors2.js]

//// [a.js]
export default 1;

//// [b.js]
/**
* @deprecated
*/
export { default as A } from "./a";


//// [plainJSGrammarErrors2.js]
//// [a.js]
export default 1;
//// [b.js]
/**
* @deprecated
*/
export { default as A } from "./a";
13 changes: 13 additions & 0 deletions tests/baselines/reference/plainJSGrammarErrors2.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=== tests/cases/conformance/salsa/plainJSGrammarErrors2.js ===

No type information for this code.=== /a.js ===
export default 1;
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))

13 changes: 13 additions & 0 deletions tests/baselines/reference/plainJSGrammarErrors2.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=== tests/cases/conformance/salsa/plainJSGrammarErrors2.js ===

No type information for this code.=== /a.js ===
export default 1;
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

14 changes: 14 additions & 0 deletions tests/cases/conformance/salsa/plainJSGrammarErrors2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @outdir: out/
// @target: esnext
// @module: esnext
// @allowJs: true
// @filename: plainJSGrammarErrors2.js

// @filename: /a.js
export default 1;

// @filename: /b.js
/**
* @deprecated
*/
export { default as A } from "./a";

0 comments on commit c1cf901

Please sign in to comment.