Skip to content

Commit 82e15ad

Browse files
author
Max Schaefer
committed
JavaScript: Fix export default examples.
Only hoistable (function) declarations and class declarations can be default-exported (https://www.ecma-international.org/ecma-262/10.0/index.html#sec-exports).
1 parent 5fdf6a8 commit 82e15ad

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

javascript/ql/src/semmle/javascript/ES2015Modules.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ class SelectiveImportDeclaration extends ImportDeclaration {
218218
* ```
219219
* export * from 'a'; // bulk re-export declaration
220220
*
221-
* export default var x = 42; // default export declaration
222221
* export default function f() {}; // default export declaration
223222
* export default 42; // default export declaration
224223
*
@@ -310,7 +309,6 @@ private predicate isShadowedFromBulkExport(BulkReExportDeclaration reExport, str
310309
* Examples:
311310
*
312311
* ```
313-
* export default var x = 42;
314312
* export default function f() {};
315313
* export default 42;
316314
* ```
@@ -624,7 +622,6 @@ class SelectiveReExportDeclaration extends ReExportDeclaration, ExportNamedDecla
624622
* Examples:
625623
*
626624
* ```
627-
* export default var x = 42;
628625
* export default function f() {};
629626
* export default 42;
630627
* export { x, y as z };

0 commit comments

Comments
 (0)