-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use module.export(getters, true) for const ExportNamedDeclaration.
These changes let the runtime know that the values returned by the getter functions for export const a = 1, b = 2; will never change. Unfortunately, it's more difficult to detect that the same is true for const a = 1, b = 2; export { a, b }; though that's an area for future improvement. Part of #134.
- Loading branch information
Showing
3 changed files
with
46 additions
and
13 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"use strict";module.export({id:()=>id,name:()=>name});const path = require("path"); | ||
"use strict";module.export({id:()=>id,name:()=>name},true);const path = require("path"); | ||
|
||
const id = module.id, | ||
name = path.basename(__filename); |