haikuwebkit/JSTests/modules
Yusuke Suzuki e7c8ad2d22 [JSC] Accept arbitrary module namespace identifier names
https://bugs.webkit.org/show_bug.cgi?id=217576
JSTests:

<rdar://problem/70416104>

Reviewed by Darin Adler.

* modules/arbitrary-module-names.js: Added.
* modules/arbitrary-module-names/export.js: Added.
* modules/arbitrary-module-names/export2.js: Added.
* stress/modules-syntax-error.js:
* test262/config.yaml:

Source/JavaScriptCore:

<rdar://problem/70416104>

Reviewed by Darin Adler.

This patch implements arbitrary module namespace identifier names[1].
After this, we can export and import arbitrary module export names which are not valid as a variable identifier.
For example,

    import { "delete" as deletedValue } from "./ok.js";

    ...

    export {
        deletedValue as "delete"
    };

[1]: https://github.com/tc39/ecma262/pull/2154

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseImportClauseItem):
(JSC::Parser<LexerType>::parseImportDeclaration):
(JSC::Parser<LexerType>::parseExportSpecifier):
(JSC::Parser<LexerType>::parseExportDeclaration):
* parser/Parser.h:

Source/WebCore:

Reviewed by Darin Adler.

* bindings/js/JSDOMConvertStrings.cpp:
(WebCore::hasUnpairedSurrogate): Deleted.

Source/WTF:

Reviewed by Darin Adler.

* wtf/text/StringView.h:
(WTF::hasUnpairedSurrogate):

Canonical link: https://commits.webkit.org/232546@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-17 02:46:48 +00:00
..
aliased-names
aliasing Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
arbitrary-module-names [JSC] Accept arbitrary module namespace identifier names 2020-12-17 02:46:48 +00:00
async-generator-default [JSC] Async generator default-export is not handled 2020-09-17 17:54:23 +00:00
breaking-builtin-promise-then-does-not-break-internal-promise [JSC] Make Promise implementation faster 2019-09-05 01:23:46 +00:00
caching-should-not-make-ambiguous
cyclic-may-produce-tdz
default-error Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
default-value-case-should-be-copied
defaults
destructuring-export
different-view
execution-order-cyclic Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
execution-order-dag Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
execution-order-depth
execution-order-sibling
execution-order-tree Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
export-conflict-ok
export-default-function-hoisting
export-from
export-with-declarations-list
exported-function-may-be-called-before-module-is-executed
fallback-ambiguous
import-call
import-error
import-meta
import-named-async
imported-bindings-are-immutable
imported-bindings-can-be-changed-in-original-module
indirect-export-error Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
module-eval
module-namespace-object-define-own-property [JSC] Update JSModuleNamespaceObject::defineOwnProperty 2020-09-17 17:17:04 +00:00
namespace
namespace-ambiguous Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
namespace-error
namespace-object-inline-caching
namespace-re-export
namespace-tdz
resources
scopes
self-star-link
tagged-template-inside-module TemplateObject passed to template literal tags are not always identical for the same source location. 2019-05-07 22:15:59 +00:00
uncacheable-when-see-star
aliased-names.js Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
aliasing.js
arbitrary-module-names.js [JSC] Accept arbitrary module namespace identifier names 2020-12-17 02:46:48 +00:00
async-function-export.js
async-generator-default.js [JSC] Async generator default-export is not handled 2020-09-17 17:54:23 +00:00
breaking-builtin-promise-then-does-not-break-internal-promise.js [JSC] Make Promise implementation faster 2019-09-05 01:23:46 +00:00
caching-should-not-make-ambiguous.js Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
cyclic-may-produce-tdz.js
default-value-case-should-be-copied.js
defaults.js
destructuring-export.js
different-view.js
execution-order-cyclic.js
execution-order-dag.js
execution-order-depth.js
execution-order-self.js
execution-order-sibling.js
execution-order-tree.js
export-conflict-ok.js
export-default-function-hoisting.js
export-default-function-name-in-assignment-expression.js
export-default-function-name-in-class-declaration.js
export-default-function-name-in-function-declaration.js
export-default-function-name-in-generator-declaration.js
export-from.js
export-with-declarations-list.js
exported-function-may-be-called-before-module-is-executed.js
fallback-ambiguous.js
html-comments.js
import-call.js
import-default-async.js
import-error.js
import-meta-assignment.js
import-meta-syntax.js
import-meta.js
import-named-async-as.js
import-named-async.js
import-namespace-async.js
imported-bindings-are-immutable.js
imported-bindings-can-be-changed-in-original-module.js
indirect-export-error.js
module-assert-access-binding.js
module-assert-access-namespace.js
module-eval.js
module-is-strict-code.js
module-jit-reachability.js
module-namespace-is-frozen.js
module-namespace-is-sealed.js
module-namespace-object-define-own-property.js [JSC] Update JSModuleNamespaceObject::defineOwnProperty 2020-09-17 17:17:04 +00:00
namespace-ambiguous.js
namespace-empty.js
namespace-error.js
namespace-object-get-property.js
namespace-object-has-property.js
namespace-object-inline-caching.js
namespace-object-symbol-iterator-name.js
namespace-object-try-get.js
namespace-object-typed-array-fast-path.js
namespace-prototype-assignment.js
namespace-re-export.js Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00
namespace-set-prototype-of.js
namespace-tdz.js
namespace.js
scopes-eval.js
scopes.js
self-star-link.js
string-prototype-module-scope.js
tagged-template-inside-module.js TemplateObject passed to template literal tags are not always identical for the same source location. 2019-05-07 22:15:59 +00:00
this-should-be-undefined.js
uncacheable-when-see-star.js Clean up SourceProvider and add caller relative load script to jsc.cpp 2020-07-13 17:35:35 +00:00