Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 46479ddbd5e62989ff599a26d7917735a9f293d3
https://github.com/WebKit/WebKit/commit/46479ddbd5e62989ff599a26d7917735a9f293d3
Author: Sosuke Suzuki <[email protected]>
Date: 2026-04-08 (Wed, 08 Apr 2026)
Changed paths:
A JSTests/modules/arbitrary-module-names-star.js
A JSTests/modules/arbitrary-module-names-star/export.js
M JSTests/test262/expectations.yaml
M Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp
M Source/JavaScriptCore/parser/Parser.cpp
M Source/JavaScriptCore/runtime/CommonIdentifiers.cpp
M Source/JavaScriptCore/runtime/CommonIdentifiers.h
Log Message:
-----------
[JSC] `import { "*" as x }` should not be treated as a namespace import
https://bugs.webkit.org/show_bug.cgi?id=311509
Reviewed by Yusuke Suzuki.
ES2022 introduced ModuleExportName, allowing arbitrary string literals as
import/export binding names. JSC was using the public string "*" as a
sentinel to mark NamespaceImport (`import * as ns`) in ImportSpecifier
nodes, which collides with the user-written `import { "*" as x }`.
The export side (`export * as ns`) was already fixed to use
starNamespacePrivateName when ModuleExportName was implemented, but the
import side was missed. This patch aligns the import side to use the same
PrivateName sentinel, and removes the now-unused timesIdentifier.
Tests: JSTests/modules/arbitrary-module-names-star.js
JSTests/modules/arbitrary-module-names-star/export.js
* JSTests/modules/arbitrary-module-names-star.js: Added.
* JSTests/modules/arbitrary-module-names-star/export.js: Added.
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp:
(JSC::ImportDeclarationNode::analyzeModule):
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::parseImportClauseItem):
* Source/JavaScriptCore/runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::CommonIdentifiers):
* Source/JavaScriptCore/runtime/CommonIdentifiers.h:
Canonical link: https://commits.webkit.org/310776@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications