-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move pure comment annotation to Graph.contextParse (#3981)
* Move pure comment annotation to Graph.contextParse If a plugin calls `PluginContext.parse` method to parse the AST of the module rollup ignored the `PURE` annotations. This commit fixes the issue by moving the annotation functionality to a central location - the `contextParse` method. Resolves #3979 * Remove unused import * Add test call-marked-pure-with-plugin-parse-ast * Improv test call-marked-pure-with-plugin-parse-ast Use the `onComment` feautre. This expands the coverage. * Change type CommentDescription -> acorn.Comment This change eliminates needless mapping between the types. * Rename annotations in acron.Node When parsing the JS code we add attributes to acorn.Node for later use: * annotations: acorn.Commnet - the comment that defined the annotation * annotatedPure: boolean - declares this node as pure call/new expression This commit puts all these attributes under one name: `_rollupAnnotations` with a strong type. Thus we clarify that these attributes are for internal use only and decrease the change of ever coliding with internal/future attributes of `acorn.Node`. * Remove '_rollupAnnotations' key from Node.keys * Remove dead code Co-authored-by: Yannay Livneh <you@example.com>
- Loading branch information
Showing
11 changed files
with
135 additions
and
76 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
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
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
Oops, something went wrong.