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

Fixing issue #1318 #1319

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
handler.proxy = function(e){
e = compatible(e)
if (e.isImmediatePropagationStopped()) return
e.data = data
var dataPropDescriptor = Object.getOwnPropertyDescriptor(e, 'data')
if (!dataPropDescriptor || dataPropDescriptor.writable)
e.data = data

Choose a reason for hiding this comment

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

It seems that when using strict mode dataPropDescriptor will be undefined when e is InputEvent (even though data property exists). Seems like a bug to me. To workaround this I would propose to wrap this line around a try/catch and add a comment about this.

var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))
if (result === false) e.preventDefault(), e.stopPropagation()
return result
Expand Down