Repository navigation
fix(parser): accept of and async as default import bindings - #5593
Closed
andreasrosdal wants to merge 1 commit into
Closed
andreasrosdal wants to merge 1 commit into
andreasrosdal wants to merge 1 commit into
Conversation
The lexer produces `Keyword::Of` and `Keyword::Async` for these contextual keywords, and `ImportDeclaration` only let an identifier name or the `await`/`yield` keywords start a default import, so `import of from "m"` and `import async from "m"` were SyntaxErrors although both are valid `ImportedBinding`s. `ImportedBinding` already accepts them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
PR spamming is not allowed. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It changes the following:
ImportDeclarationaccepts the contextual keywordsofandasyncas the default import binding (import of from "m",import async from "m").The lexer produces
Keyword::Of/Keyword::Asyncfor these words, and the import clause only started on an identifier name orawait/yield, so these validImportedBindings were SyntaxErrors. Minifiers do hand outofas a name: a production site's advertising module (import of from ".../react.production.min.js") failed to compile. Found while embedding Boa in the Southstar browser.Tested with
cargo test -p boa_parser import_default_binding.Implemented for https://github.com/nordstjernen-web/southstar-browser