-
Notifications
You must be signed in to change notification settings - Fork 353
Fix CustomEvent Implementation #152
base: master
Are you sure you want to change the base?
Conversation
dom.js
Outdated
return; | ||
function CustomEvent ( event, params ) { | ||
params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
var evt = document.createEvent( 'CustomEvent' ); | ||
var evt = creteCustomEvent(); |
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.
Is the typo on purpose?
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.
gosh no
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.
done
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.
as in ... squashed now
Currently `new CustomEvent('!').constructor === CustomEvent` returns false, which is a hell of a bummer for anything else that is either polyfilling or feature detecting CustomEvent after this file is on the page. Bonus: I have removed the redundant `in` check when `typeof` is all it's needed. Please consider publishing this fix ASAP since it's conflicting with other polyfills. Thank you.
caf79ec
to
c58a49d
Compare
You will have to wait for @inexorabletash's review. |
will that ever happen? |
Please add a test case, then I can merge. |
The test case is in the ticket:
I'm on vacation 'till 26th so I won't change this PR before that day. |
Common @WebReflection just add one line there if you don't want to create another test case. |
I'm not lazy, I'm on vacation without internet and my laptop not always with me. |
With the patch applied, this fails in IE11: assert.ok(new CustomEvent('!').constructor === CustomEvent); |
Currently
new CustomEvent('!').constructor === CustomEvent
returnsfalse
in IE11, which is a hell of a bummer for anything else that is either polyfilling or feature detecting CustomEvent after this file is on the page.Bonus: I have removed the redundant
in
check whentypeof
is all it's needed.Please consider publishing this fix ASAP since it's conflicting with other polyfills.
Thank you.