RESOLVED FIXED 214379
Support export namespace `export * as ns`
https://bugs.webkit.org/show_bug.cgi?id=214379
Summary Support export namespace `export * as ns`
Huáng Jùnliàng
Reported 2020-07-15 14:33:42 PDT
`export * as ns` is included in ES2020. Expect: it works on Safari Actual: Safari TP 109 throws warning that missing "from" after `*`. Spec PR: https://github.com/tc39/ecma262/pull/1174
Attachments
Patch (11.83 KB, patch)
2020-09-16 01:33 PDT, Yusuke Suzuki
no flags
Patch (28.21 KB, patch)
2020-09-16 22:26 PDT, Yusuke Suzuki
ross.kirsling: review+
Patch (30.44 KB, patch)
2020-09-17 01:05 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Patch (30.42 KB, patch)
2020-09-17 01:09 PDT, Yusuke Suzuki
no flags
Radar WebKit Bug Importer
Comment 1 2020-07-16 18:04:13 PDT
Yusuke Suzuki
Comment 2 2020-09-16 01:33:31 PDT
Created attachment 408905 [details] Patch WIP
Yusuke Suzuki
Comment 3 2020-09-16 22:26:35 PDT
Ross Kirsling
Comment 4 2020-09-16 23:27:55 PDT
Comment on attachment 408990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408990&action=review r=me. Thanks for the extra explanation over Slack. > Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp:89 > + // export { * as v } from "mod" This form can't use braces though, right? > Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp:779 > + // Materialize *namespace* slot with module namespace object. > + // If module environment is not yet materialized, we will materialize it when materializing module environment. The "it" here is a bit confusing upon first read. Maybe something like "...unless the module environment is not yet materialized, in which case we'll do it in setModuleEnvironment"? > Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp:782 > + bool putResult = false; > + symbolTablePutTouchWatchpointSet(m_moduleEnvironment.get(), globalObject, vm.propertyNames->starNamespacePrivateName, moduleNamespaceObject, /* shouldThrowReadOnlyError */ false, /* ignoreReadOnlyErrors */ true, putResult); nit: I know this is copied code, but it seems silly that one boolean is described using an identifier and the other two are described with block comments.
Yusuke Suzuki
Comment 5 2020-09-17 01:05:17 PDT
Yusuke Suzuki
Comment 6 2020-09-17 01:09:21 PDT
Yusuke Suzuki
Comment 7 2020-09-17 03:27:51 PDT
Comment on attachment 408990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408990&action=review >> Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp:89 >> + // export { * as v } from "mod" > > This form can't use braces though, right? Right, fixed. >> Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp:779 >> + // If module environment is not yet materialized, we will materialize it when materializing module environment. > > The "it" here is a bit confusing upon first read. Maybe something like "...unless the module environment is not yet materialized, in which case we'll do it in setModuleEnvironment"? Sounds good! >> Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp:782 >> + symbolTablePutTouchWatchpointSet(m_moduleEnvironment.get(), globalObject, vm.propertyNames->starNamespacePrivateName, moduleNamespaceObject, /* shouldThrowReadOnlyError */ false, /* ignoreReadOnlyErrors */ true, putResult); > > nit: I know this is copied code, but it seems silly that one boolean is described using an identifier and the other two are described with block comments. Fixed.
Yusuke Suzuki
Comment 8 2020-09-17 03:28:18 PDT
Yusuke Suzuki
Comment 9 2020-09-17 03:30:24 PDT
Note You need to log in before you can comment on or make changes to this bug.