-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
compiler/tests: dynamic events: validate handler before executing #4105
Conversation
Fail if initial button click causes an exception.
@Conduitry, |
let err = ""; | ||
window.addEventListener('error', (e) => { | ||
e.preventDefault(); | ||
err = e.message; |
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.
err = e.message; | |
err += e.message; |
should concat all the error messages
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 the review, I'll push up changes after the holiday or feel free to push a commit sooner if needed.
Fixes #4087, #4090.
Background
Dynamic events are callbacks that reside in a variable instead of directly pointing to a function and are emitted by the compiler when the variable is mutated or assigned in some way.
I noticed in #4087 that the dynamic event handler test case was throwing exceptions, but still passing.
Further investigation uncovered an issue where we were not properly handling exceptions in the run-time during testing. This led to filing #4090 after the root cause of the exception turned out to the lack of callback validation inside the proxy function used for dynamic events.
This pull request addresses both of these issues along with adding much more coverage for dynamic events.
Before submitting the PR, please make sure you do the following
npm run lint
!)Tests
npm test
oryarn test
)