-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Properly pass null
exception to error handlers
#3185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
Per CONTRIBUTING.md, no new tests should be added to to-port-to-wpts/
(as that increases our porting burden). Instead, the test for the onerror
handler should be added to the appropriate location in web-platform-tests/to-upstream
, and the test for the virtual console behavior should be added to api/jsdom-errors.js
Can you tell me the appropriate location?
|
I think I got the right place. Let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've told GitHub to run the CI. I think it will fail on the lint in at least some cases.
Thanks for moving the tests. I think a better location for web platform tests would be html/webappapis/scripting/processing-model-2
(you'll need to create a couple folders), instead of dom/events
. That's where existing tests for uncaught exceptions live in upstream.
Thanks for pointing out the lint issues. These are fixed now. I picked the WPT location based on a search for tests that involve throwing errors in an event handler. Although I see a lot of error-related tests in |
@mbest As an example, https://github.com/web-platform-tests/wpt/blob/master/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html is a test that tests the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there :)
test/web-platform-tests/to-upstream/dom/events/Event-dispatch-throwing.html
Outdated
Show resolved
Hide resolved
test/web-platform-tests/to-upstream/dom/events/Event-dispatch-throwing.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one last thing. Otherwise LGTM.
...o-upstream/html/webappapis/scripting/processing-model-2/window-onerror-event-throw-null.html
Outdated
Show resolved
Hide resolved
@domenic Anything else? |
Check for
null
orundefined
error values before trying to access properties.Fixes #3183