[webkit-changes] [WebKit/WebKit] 587c5d: [JSC] Enable import-attributes
Yusuke Suzuki
noreply at github.com
Wed Aug 16 13:36:49 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 587c5d440b8fe773c11da11e276689f9188bb5d0
https://github.com/WebKit/WebKit/commit/587c5d440b8fe773c11da11e276689f9188bb5d0
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2023-08-16 (Wed, 16 Aug 2023)
Changed paths:
A JSTests/modules/import-attributes-empty.js
A JSTests/modules/import-attributes-trailing.js
A JSTests/modules/import-attributes-unsupported.js
A JSTests/modules/resources/import-attributes-unsupported-1.js
A JSTests/modules/resources/import-attributes-unsupported-2.js
A JSTests/modules/resources/import-attributes-unsupported-3.js
A JSTests/modules/resources/x.js
A JSTests/modules/resources/x.json
A JSTests/modules/resources/y.js
A JSTests/modules/resources/z.js
M JSTests/stress/invalid-import-assertion.js
M JSTests/stress/modules-syntax-import-assertion-error.js
M JSTests/stress/modules-syntax-import-assertion.js
M JSTests/test262/config.yaml
M JSTests/test262/expectations.yaml
M LayoutTests/TestExpectations
M LayoutTests/imported/w3c/resources/import-expectations.json
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/charset-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/cors-crossorigin-requests-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/css-module-worker-test-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/import-css-module-dynamic-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.html
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.sharedworker-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.sharedworker.html
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.worker-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.worker.html
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-attributes-clause-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-attributes-clause.html
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-attributes-clause.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-type-attribute.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/export-hello.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/hello.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/invalid-type-attribute-error-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/invalid-type-attribute-error.html
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/invalid-type-attribute.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/javascript-type-attribute.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/js-type-attribute.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/unsupported-attribute-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/unsupported-attribute.html
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/unsupported-attribute.js
A LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/w3c-import.log
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/charset-2.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/charset-bom.any.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/charset.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/credentials-iframe.sub.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/crossorigin-import-parse-error-with-cors.sub.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/crossorigin-import-with-cors.sub.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/crossorigin-import-without-cors.sub.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/integrity-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/integrity-matches.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/integrity-mismatches.js
R LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/invalid-content-type-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/invalid-content-type.any.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/load-error-events.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/load-error-events.py
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/module.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/referrer-policies.sub.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any.sharedworker-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any.worker-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/serviceworker-dynamic-import.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/serviceworker.js
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/valid-content-type-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/valid-content-type.html
M LayoutTests/platform/gtk/TestExpectations
M LayoutTests/platform/wpe/TestExpectations
M Source/JavaScriptCore/API/JSAPIGlobalObject.mm
M Source/JavaScriptCore/jsc.cpp
M Source/JavaScriptCore/parser/ASTBuilder.h
M Source/JavaScriptCore/parser/ModuleAnalyzer.cpp
M Source/JavaScriptCore/parser/ModuleAnalyzer.h
M Source/JavaScriptCore/parser/NodeConstructors.h
M Source/JavaScriptCore/parser/Nodes.h
M Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp
M Source/JavaScriptCore/parser/Parser.cpp
M Source/JavaScriptCore/parser/Parser.h
M Source/JavaScriptCore/parser/SyntaxChecker.h
M Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp
M Source/JavaScriptCore/runtime/AbstractModuleRecord.h
M Source/JavaScriptCore/runtime/Completion.cpp
M Source/JavaScriptCore/runtime/Completion.h
M Source/JavaScriptCore/runtime/JSModuleLoader.cpp
M Source/JavaScriptCore/runtime/OptionsList.h
M Source/WebCore/bindings/js/ScriptModuleLoader.cpp
Log Message:
-----------
[JSC] Enable import-attributes
https://bugs.webkit.org/show_bug.cgi?id=260238
rdar://113940597
Reviewed by Mark Lam.
This patch updates import-attributes from import-assertions and enable it.
Currently, this is kind of aligned to existing import-assertions implementation,
replacing "assert" with "with".
* JSTests/modules/import-attributes-empty.js: Added.
* JSTests/modules/import-attributes-trailing.js: Added.
* JSTests/modules/import-attributes-unsupported.js: Added.
(catch):
(shouldBe.String):
(shouldBe):
* JSTests/modules/resources/import-attributes-unsupported-1.js: Added.
* JSTests/modules/resources/import-attributes-unsupported-2.js: Added.
* JSTests/modules/resources/import-attributes-unsupported-3.js: Added.
* JSTests/modules/resources/x.js: Added.
* JSTests/modules/resources/y.js: Added.
* JSTests/modules/resources/z.js: Added.
* JSTests/stress/modules-syntax-import-assertion-error.js:
* JSTests/stress/modules-syntax-import-assertion.js:
* JSTests/test262/config.yaml:
* JSTests/test262/expectations.yaml:
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/resources/import-expectations.json:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/charset-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/cors-crossorigin-requests-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/css-module-worker-test-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/import-css-module-dynamic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js: Added.
(promise_test.async test):
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.sharedworker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.sharedworker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.worker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.worker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-attributes-clause-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-attributes-clause.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-attributes-clause.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/empty-type-attribute.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/export-hello.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/hello.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/invalid-type-attribute-error-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/invalid-type-attribute-error.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/invalid-type-attribute.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/javascript-type-attribute.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/js-type-attribute.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/unsupported-attribute-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/unsupported-attribute.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/unsupported-attribute.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/import-attributes/w3c-import.log: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/charset-2.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/charset-bom.any.js:
(promise_test.async const):
(promise_test):
(promise_test.async test):
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/charset.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/credentials-iframe.sub.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/crossorigin-import-parse-error-with-cors.sub.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/crossorigin-import-with-cors.sub.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/crossorigin-import-without-cors.sub.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/integrity-matches.js:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/integrity-mismatches.js:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/invalid-content-type-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/invalid-content-type.any.js:
(const.content_type.of.content_types.promise_test.async test):
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/load-error-events.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/load-error-events.py:
(main):
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/module.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js:
(string_appeared_here.promise_test.async t):
(promise_test.async t):
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/referrer-policies.sub.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any.js:
(promise_test.async test):
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any.sharedworker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/repeated-imports.any.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/serviceworker-dynamic-import.js:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/serviceworker.js:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/valid-content-type.html:
* Source/JavaScriptCore/API/JSAPIGlobalObject.mm:
(JSC::JSAPIGlobalObject::moduleLoaderImportModule):
* Source/JavaScriptCore/jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
(GlobalObject::moduleLoaderFetch):
* Source/JavaScriptCore/parser/ASTBuilder.h:
(JSC::ASTBuilder::createImportAttributesList):
(JSC::ASTBuilder::appendImportAttribute):
(JSC::ASTBuilder::createImportDeclaration):
(JSC::ASTBuilder::createExportAllDeclaration):
(JSC::ASTBuilder::createExportNamedDeclaration):
(JSC::ASTBuilder::createImportAssertionList): Deleted.
(JSC::ASTBuilder::appendImportAssertion): Deleted.
* Source/JavaScriptCore/parser/ModuleAnalyzer.cpp:
(JSC::ModuleAnalyzer::appendRequestedModule):
(JSC::ModuleAnalyzer::analyze):
* Source/JavaScriptCore/parser/ModuleAnalyzer.h:
(JSC::ModuleAnalyzer::fail):
* Source/JavaScriptCore/parser/NodeConstructors.h:
(JSC::ImportDeclarationNode::ImportDeclarationNode):
(JSC::ExportAllDeclarationNode::ExportAllDeclarationNode):
(JSC::ExportNamedDeclarationNode::ExportNamedDeclarationNode):
* Source/JavaScriptCore/parser/Nodes.h:
* Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp:
(JSC::tryCreateAttributes):
(JSC::ImportDeclarationNode::analyzeModule):
(JSC::ExportAllDeclarationNode::analyzeModule):
(JSC::ExportNamedDeclarationNode::analyzeModule):
(JSC::tryCreateAssertion): Deleted.
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::parseImportAttributes):
(JSC::Parser<LexerType>::parseImportDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseImportAssertions): Deleted.
* Source/JavaScriptCore/parser/Parser.h:
* Source/JavaScriptCore/parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createImportAttributesList):
(JSC::SyntaxChecker::appendImportAssertion):
(JSC::SyntaxChecker::createImportDeclaration):
(JSC::SyntaxChecker::createExportAllDeclaration):
(JSC::SyntaxChecker::createExportNamedDeclaration):
(JSC::SyntaxChecker::createImportAssertionList): Deleted.
* Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::appendRequestedModule):
(JSC::AbstractModuleRecord::dump):
* Source/JavaScriptCore/runtime/AbstractModuleRecord.h:
* Source/JavaScriptCore/runtime/Completion.cpp:
(JSC::retrieveImportAttributesFromDynamicImportOptions):
(JSC::retrieveTypeImportAttribute):
(JSC::retrieveAssertionsFromDynamicImportOptions): Deleted.
(JSC::retrieveTypeAssertion): Deleted.
* Source/JavaScriptCore/runtime/Completion.h:
* Source/JavaScriptCore/runtime/JSModuleLoader.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/OptionsList.h:
* Source/WebCore/bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::importModule):
Canonical link: https://commits.webkit.org/266957@main
More information about the webkit-changes
mailing list