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

"report an error" assumes the script is a classic script, but is also used on module scripts #7501

Closed
takikawa opened this issue Jan 18, 2022 · 3 comments · Fixed by #7515
Closed

Comments

@takikawa
Copy link
Contributor

In "report an error", the following step checks the "muted errors" flag:

If script's muted errors is true, then set message to "Script error.", urlString to the empty string, line and col to 0, and errorValue to null.

The "muted errors" flag is only defined on classic scripts, but this operation is also applied to module scripts via "run a module script".

Should this spec text say something like "If script is a classic script and if script's muted errors is true..." instead?

(this might also apply to HostPromiseRejectionTracker)

@domenic
Copy link
Member

domenic commented Jan 18, 2022

Yes, that's probably a reasonable quick fix. However in general we haven't been touching these algorithms much since per #958 they're due for a complete overhaul.

@takikawa
Copy link
Contributor Author

Ah thanks yeah, I had seen that issue too. I originally thought it was mostly changing "report an exception" and keeping the current "report an error" but I see now that it also involves consolidating both into one algorithm.

Would a PR for the quick fix still be helpful, or is it better to wait for the overhaul then to fix these small things?

@domenic
Copy link
Member

domenic commented Jan 18, 2022

I'd be happy to take the quick-fix PR.

takikawa added a commit to takikawa/html that referenced this issue Jan 20, 2022
Changes "report an error" to check that the argument script is
a classic script before accessing its muted errors field, which is
not defined for other kinds of scripts.

Also applies the change to HostPromiseRejectionTracker.

Fixes whatwg#7501.
domenic pushed a commit that referenced this issue Jan 21, 2022
Change "report an error" to check that the argument script is a classic script before accessing its muted errors field, which is not defined for other kinds of scripts.

Also applies the change to HostPromiseRejectionTracker.

Fixes #7501.
mfreed7 pushed a commit to mfreed7/html that referenced this issue Jun 3, 2022
Change "report an error" to check that the argument script is a classic script before accessing its muted errors field, which is not defined for other kinds of scripts.

Also applies the change to HostPromiseRejectionTracker.

Fixes whatwg#7501.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants