Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let the SharedWorker constructor queue a task to fire an error when parse error occurs #5347

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

elkurin
Copy link
Contributor

@elkurin elkurin commented Mar 11, 2020

This PR corresponds to #5323 .

This pull request changes the behavior when shared worker's script invokes parse error.
When a parse error event occurs during fetch, the shared worker used to ignore the error event while it catches and fire an event named error for fetch failure.
We would like to align the behavior of parse error handling with that of fetch failure.

See the doc for more information.


💥 Error: write EPROTO 140049978214272:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:../deps/openssl/openssl/ssl/s23_clnt.c:772:

💥 ###

PR Preview failed to build. (Last tried on Mar 13, 2020, 2:25 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 HTML Diff Service - The HTML Diff Service is used to create HTML diffs of the spec changes suggested in a pull request.

🔗 Related URL

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

@elkurin elkurin changed the title Parse error in shared worker Let the SharedWorker constructor queue a task to fire an error when parse error occurs Mar 11, 2020
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I provided some editorial review. It'd be good to get a second check from @annevk and/or @asutherland.

I guess the spec could be clearer on the difference between parse error and error to rethrow. (I wrote up those sections but have forgotten...) I believe the difference is that parse error is only for the immediate script, whereas with modules, the error to rethrow could be a parse error from deeper in the graph. Right? In which case "error to rethrow" is correct, but we should be sure to include some deeper-in-the-graph cases.

source Outdated Show resolved Hide resolved
@elkurin
Copy link
Contributor Author

elkurin commented Mar 12, 2020

Thanks for clarifying the difference. Yes, in this spec we would like to catch parse error invoked from both top-level scripts and deeper-in-the-graph scripts.
It seems that using |error to rethrow| is correct.

@domenic domenic force-pushed the parse-error-in-shared-worker branch from a4f1625 to a6e1445 Compare March 12, 2020 19:50
domenic added a commit that referenced this pull request Mar 12, 2020
In #5347 (review)
I realized that I had forgotten what the difference was between
"parse error" and "error to rethrow", despite being the original author
of the spec text. This adds notes explaining the function of each of
them, and un-exports "parse error" since it should only be used
internally.
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. If @annevk or @asutherland has time to double-check in the next few days, I'd appreciate it, otherwise I'll land this on Monday or so.

(I will also avoid landing it if the tests PR still has ongoing discussions, which currently seems to be the case.)

domenic added a commit that referenced this pull request Mar 12, 2020
In #5347 (review)
I realized that I had forgotten what the difference was between
"parse error" and "error to rethrow", despite being the original author
of the spec text. This adds notes explaining the function of each of
them, and un-exports "parse error" since it should only be used
internally.
@annevk
Copy link
Member

annevk commented Mar 13, 2020

This seems fine to me, but please don't close #5323 or ensure a follow-up is filed for the remaining work.

@domenic domenic force-pushed the parse-error-in-shared-worker branch from a6e1445 to ada788c Compare March 13, 2020 14:24
domenic added a commit that referenced this pull request Mar 13, 2020
In #5347 (review)
I realized that I had forgotten what the difference was between
"parse error" and "error to rethrow", despite being the original author
of the spec text. This adds notes explaining the function of each of
them, and un-exports "parse error" since it should only be used
internally.
@domenic domenic merged commit c747ce0 into whatwg:master Mar 13, 2020
domenic pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 23, 2020
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Mar 31, 2020
…redWorkers, a=testonly

Automatic update from web-platform-tests
Add WPTs for parse error handling in SharedWorkers

Follows whatwg/html#5347.
--

wpt-commits: bd6c94ee488cb2c968221a547604fb6c4807a2ca
wpt-pr: 22185
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 31, 2020
…redWorkers, a=testonly

Automatic update from web-platform-tests
Add WPTs for parse error handling in SharedWorkers

Follows whatwg/html#5347.
--

wpt-commits: bd6c94ee488cb2c968221a547604fb6c4807a2ca
wpt-pr: 22185
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Apr 1, 2020
…redWorkers, a=testonly

Automatic update from web-platform-tests
Add WPTs for parse error handling in SharedWorkers

Follows whatwg/html#5347.
--

wpt-commits: bd6c94ee488cb2c968221a547604fb6c4807a2ca
wpt-pr: 22185

UltraBlame original commit: 4dc14a36b48c3c255bb709ac57eed5a85f3bb67b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Apr 1, 2020
…redWorkers, a=testonly

Automatic update from web-platform-tests
Add WPTs for parse error handling in SharedWorkers

Follows whatwg/html#5347.
--

wpt-commits: bd6c94ee488cb2c968221a547604fb6c4807a2ca
wpt-pr: 22185

UltraBlame original commit: 4dc14a36b48c3c255bb709ac57eed5a85f3bb67b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Apr 1, 2020
…redWorkers, a=testonly

Automatic update from web-platform-tests
Add WPTs for parse error handling in SharedWorkers

Follows whatwg/html#5347.
--

wpt-commits: bd6c94ee488cb2c968221a547604fb6c4807a2ca
wpt-pr: 22185

UltraBlame original commit: 4dc14a36b48c3c255bb709ac57eed5a85f3bb67b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants