WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 165724
[JSC] Prototype dynamic-import
https://bugs.webkit.org/show_bug.cgi?id=165724
Summary
[JSC] Prototype dynamic-import
Yusuke Suzuki
Reported
2016-12-10 03:33:07 PST
https://tc39.github.io/proposal-dynamic-import/
stage 3
Attachments
Patch
(29.19 KB, patch)
2016-12-26 04:13 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-elcapitan
(872.27 KB, application/zip)
2016-12-26 05:14 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
(830.39 KB, application/zip)
2016-12-26 05:18 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews112 for mac-elcapitan
(1.60 MB, application/zip)
2016-12-26 05:23 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews123 for ios-simulator-wk2
(9.08 MB, application/zip)
2016-12-26 05:28 PST
,
Build Bot
no flags
Details
Patch
(30.64 KB, patch)
2016-12-26 10:07 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(36.46 KB, patch)
2016-12-26 11:00 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(42.84 KB, patch)
2016-12-27 00:36 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(42.92 KB, patch)
2016-12-27 01:09 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(42.88 KB, patch)
2016-12-27 07:08 PST
,
Yusuke Suzuki
saam
: review+
Details
Formatted Diff
Diff
Patch for landing
(47.70 KB, patch)
2017-01-09 13:15 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Show Obsolete
(9)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2016-12-26 04:13:36 PST
Created
attachment 297763
[details]
Patch prototype
Build Bot
Comment 2
2016-12-26 05:14:16 PST
Comment on
attachment 297763
[details]
Patch
Attachment 297763
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/2789323
New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.16.html
Build Bot
Comment 3
2016-12-26 05:14:19 PST
Created
attachment 297764
[details]
Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 4
2016-12-26 05:18:51 PST
Comment on
attachment 297763
[details]
Patch
Attachment 297763
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/2789336
New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.16.html
Build Bot
Comment 5
2016-12-26 05:18:53 PST
Created
attachment 297765
[details]
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 6
2016-12-26 05:23:15 PST
Comment on
attachment 297763
[details]
Patch
Attachment 297763
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/2789332
New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.16.html
Build Bot
Comment 7
2016-12-26 05:23:18 PST
Created
attachment 297766
[details]
Archive of layout-test-results from ews112 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 8
2016-12-26 05:28:25 PST
Comment on
attachment 297763
[details]
Patch
Attachment 297763
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/2789333
New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.16.html
Build Bot
Comment 9
2016-12-26 05:28:28 PST
Created
attachment 297767
[details]
Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Yusuke Suzuki
Comment 10
2016-12-26 10:07:26 PST
Created
attachment 297768
[details]
Patch prototype
Yusuke Suzuki
Comment 11
2016-12-26 11:00:56 PST
Created
attachment 297771
[details]
Patch WIP
Yusuke Suzuki
Comment 12
2016-12-27 00:36:11 PST
Created
attachment 297780
[details]
Patch
Yusuke Suzuki
Comment 13
2016-12-27 01:09:34 PST
Created
attachment 297782
[details]
Patch
Yusuke Suzuki
Comment 14
2016-12-27 07:08:25 PST
Created
attachment 297783
[details]
Patch
Saam Barati
Comment 15
2017-01-09 12:23:06 PST
Comment on
attachment 297783
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=297783&action=review
r=me
> Source/JavaScriptCore/parser/Parser.cpp:4390 > + handleProductionOrFail2(OPENPAREN, "(", "start", "'import' call");
I think a better error message here would be something like: "import call expects exactly one argument"
> Source/JavaScriptCore/parser/Parser.cpp:4393 > + handleProductionOrFail2(CLOSEPAREN, ")", "end", "'import' call");
ditto
> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:940 > + RETURN_IF_EXCEPTION(catchScope, encodedJSValue());
Nit: you can use "{ }" instead of "encodedJSValue()"
> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:948 > + auto* specifier = exec->argument(0).toString(exec);
Nit: Since this is just called from our own bytecode, I would RELEASE_ASSERT the argument count and use uncheckedArgument.
> JSTests/stress/import-syntax.js:25 > +testSyntaxError(`import("Hello", "Hello2";`, `SyntaxError: Unexpected token ','. Expected ')' to end an 'import' call.`);
Some more syntax error tests to add: import(a, b) import(a, b, c) import(...foo) I would also suggest adding tests that assert a synax error *was not* thrown. That way we can also test what we allow.
Yusuke Suzuki
Comment 16
2017-01-09 13:15:29 PST
Created
attachment 298382
[details]
Patch for landing Patch for landing
Yusuke Suzuki
Comment 17
2017-01-09 14:03:54 PST
Committed
r210522
: <
http://trac.webkit.org/changeset/210522
>
Serg Hospodarets
Comment 18
2017-02-12 07:50:27 PST
The dynamic import() doesn't work in the DevTools console. Even for the correct absolute URLs it throws an error: "Cannot resolve the specifier". Is it the intentional behavior, or a bug (just want to confirm before opening a new issue).
Yusuke Suzuki
Comment 19
2017-02-12 08:00:30 PST
(In reply to
comment #18
)
> The dynamic import() doesn't work in the DevTools console. > Even for the correct absolute URLs it throws an error: "Cannot resolve the > specifier". > Is it the intentional behavior, or a bug (just want to confirm before > opening a new issue).
It's intentional currently. And once this[1] patch is landed, it will be fixed. :) [1]:
https://bugs.webkit.org/show_bug.cgi?id=167457
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug