ExportNamedDeclaration always has attributes property#1346
Merged
marijnh merged 1 commit intoacornjs:masterfrom Mar 5, 2025
Merged
ExportNamedDeclaration always has attributes property#1346marijnh merged 1 commit intoacornjs:masterfrom
ExportNamedDeclaration always has attributes property#1346marijnh merged 1 commit intoacornjs:masterfrom
Conversation
This was referenced Mar 4, 2025
Member
|
Looks reasonable. Can you add a regression test please? |
graphite-app bot
pushed a commit
to oxc-project/oxc
that referenced
this pull request
Mar 5, 2025
…tributes` field (#9546) Acorn does not include an `attributes` field on `ExportNamedDeclaration` when `source == null`. I think that's an oversight - acornjs/acorn#1346. Bump `acorn-test262` to include commit oxc-project/estree-conformance@96faefa which adds the missing `attributes` field to Acorn's AST. This allows simplifying serialization/deserialization code, as we now don't need to deal with this special case.
0a6ecfd to
3595489
Compare
Contributor
Author
|
Thanks for coming back so swiftly. Have added tests. They don't cover every possible form of |
Member
|
Thanks! Merged. |
Contributor
Author
|
Thanks very much for merging my 3 PRs so swiftly. Really appreciate it. If I can make a request... When you have time, could you possibly make a release including these changes? |
Member
|
Sure. I've tagged a version 8.14.1! |
Contributor
Author
Brilliant. Thank you! |
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.
ESTree spec for ES2025 states about
ExportNamedDeclaration:Acorn's AST currently does not include an
attributesfield at all whensourceisnull.This PR fixes that, by adding an
attributes: []property in this case.This may improve performance slightly in consuming code, as consistent object shape across all
ExportNamedDeclarationnodes allows the JS engine to monomorphize functions that deal in these nodes.