WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 260238
262994
Safari 17 accidentally ships `assert` in dynamic import
https://bugs.webkit.org/show_bug.cgi?id=262994
Summary
Safari 17 accidentally ships `assert` in dynamic import
nicolo.ribaudo
Reported
2023-10-10 19:11:34 PDT
Given this test case (it can be copy-pasted in Safari's devtools): ```js await Promise.allSettled([ import("data:application/json,1", { with: { type: "json" } }), import("data:application/json,2", { assert: { type: "json" } }), import(`data:application/javascript, export { default } from "data:application/json,3" with { type: "json" } `), import(`data:application/javascript, export { default } from "data:application/json,4" assert { type: "json" } `) ]) ``` there are four possible outputs that make sense: 1. all the promises are rejected, because import attributes are not supported (neither the new syntax nor the deprecated one) 2. the fist and third promises are resolved, because the engine only supports import attributes with the new syntax 3. the second and the fourth promises are resolved, because the engine only supports import attributes (assertions) with the deprecated syntax 4. all the promises are resolved, because the engine supports both the new and the deprecated syntax The best possible behavior is (2). Safari 16.6 does (1), Safari TP does (2), Chrome does (3) and is working on a (3)->(4)->(2) migration. Somehow, in Safari 17 only the second promise is resolved and all the others are rejected, leading to a partial-(2) state. I would expect it to either behave like Safari 16 (and not ship import attributes yet) or like Safari TP (and fully ship the new syntax). I don't think I can CC people, but please cc
ysuzuki@apple.com
(author of
https://github.com/WebKit/WebKit/pull/16730
).
Attachments
Add attachment
proposed patch, testcase, etc.
nicolo.ribaudo
Comment 1
2023-10-10 23:08:38 PDT
In the original message I meant to write that Safari 17 is in a partial-(3) state, not partial-(2).
Radar WebKit Bug Importer
Comment 2
2023-10-11 15:02:33 PDT
<
rdar://problem/116831377
>
Mark Lam
Comment 3
2023-10-11 16:12:10 PDT
*** This bug has been marked as a duplicate of
bug 260238
***
nicolo.ribaudo
Comment 4
2023-10-11 18:01:31 PDT
I don't think this is a duplicate of
bug 260238
.
bug 260238
was tracking going from "ship nothing" to "ship the right thing", and as I mentioned Safari TP has that behaviour and already had it before the Safari 17 release. However, Safari 17 was shipped with the wrong version of the proposal partially enabled. There was agreement among browsers to try to remove the `assert` version from the proposed specification, and Safari shipping `assert` and only `assert` goes actively against that goal.
nicolo.ribaudo
Comment 5
2023-10-12 01:53:44 PDT
I just realized that I previously tested on an older Safari version and the latest Safari 16 version behaves exactly the same as Safari 17. This is indeed a duplicate, sorry for the confusion!
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