raphinesse edited a comment on pull request #245:
URL: https://github.com/apache/cordova-js/pull/245#issuecomment-1020078902
Good catch!
However, I think we might have to handle truthy non-string arguments as
well. `window.addEventListener(1, () => {})` does not throw an error either
(tested in Chrome). Unfortunately, I could not find anything on input
validation of the type argument in
https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-addeventlistener%E2%91%A2
`window.addEventListener(1, 2)` complains about the second arg being no
object.
It would be great if we knew the spec for this. Maybe we actually have to do
something like `evt = String(evt);` instead. Like with object keys which are
always converted to strings... :man_shrugging:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]