-
Notifications
You must be signed in to change notification settings - Fork 216
Add ES2020 string export/import name support #1188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bnoordhuis
merged 5 commits into
quickjs-ng:master
from
karlseguin:string_import_export_names
Oct 16, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bda6857
Add ES2020 string export/import name support
karlseguin 65adb6b
Enable test262 arbitrary-module-namespace-names feature
karlseguin 93ca3a1
reject export names with unmatched surrogate pairs
karlseguin 2a0eca1
don't allow string bindings without from clause
karlseguin 24a2edf
fix styling and apply other suggestions
karlseguin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // ES2020 string export names test fixture | ||
| export const regularExport = "regular"; | ||
| const value1 = "value-1"; | ||
| const value2 = "value-2"; | ||
|
|
||
| // String export names (ES2020) | ||
| export { value1 as "string-export-1" }; | ||
| export { value2 as "string-export-2" }; | ||
|
|
||
| // Mixed: regular and string exports | ||
| const mixed = "mixed-value"; | ||
| export { mixed as normalName, mixed as "string-name" }; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Test ES2020 string export/import names | ||
| import { assert } from "./assert.js"; | ||
| import * as mod from "./fixture_string_exports.js"; | ||
|
|
||
| // Test string import names | ||
| import { "string-export-1" as str1 } from "./fixture_string_exports.js"; | ||
| import { "string-export-2" as str2 } from "./fixture_string_exports.js"; | ||
| import { "string-name" as strMixed } from "./fixture_string_exports.js"; | ||
|
|
||
| // Test regular imports still work | ||
| import { regularExport, normalName } from "./fixture_string_exports.js"; | ||
|
|
||
| // Verify values | ||
| assert(str1, "value-1"); | ||
| assert(str2, "value-2"); | ||
| assert(strMixed, "mixed-value"); | ||
| assert(regularExport, "regular"); | ||
| assert(normalName, "mixed-value"); | ||
|
|
||
| // Verify module namespace has string-named exports | ||
| assert(mod["string-export-1"], "value-1"); | ||
| assert(mod["string-export-2"], "value-2"); | ||
| assert(mod["string-name"], "mixed-value"); | ||
| assert(mod.regularExport, "regular"); | ||
| assert(mod.normalName, "mixed-value"); |
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.
Uh oh!
There was an error while loading. Please reload this page.