inexorabletash / polyfill

JavaScript Polyfills, Shims and More
Other
1.36k stars 354 forks source link

Fix CustomEvent Implementation #152

Open WebReflection opened 5 years ago

WebReflection commented 5 years ago

Currently new CustomEvent('!').constructor === CustomEvent returns false 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 when typeof is all it's needed.

Please consider publishing this fix ASAP since it's conflicting with other polyfills.

Thank you.

Mouvedia commented 5 years ago

Please consider publishing this fix ASAP since it's conflicting with other polyfills.

You will have to wait for @inexorabletash's review.

WebReflection commented 5 years ago

will that ever happen?

inexorabletash commented 5 years ago

Please add a test case, then I can merge.

WebReflection commented 5 years ago

The test case is in the ticket:

Currently new CustomEvent('!').constructor === CustomEvent returns false in IE11

I'm on vacation 'till 26th so I won't change this PR before that day.

Mouvedia commented 5 years ago

Common @WebReflection just add one line there if you don't want to create another test case.

WebReflection commented 5 years ago

I'm not lazy, I'm on vacation without internet and my laptop not always with me.

inexorabletash commented 5 years ago

With the patch applied, this fails in IE11:

assert.ok(new CustomEvent('!').constructor === CustomEvent);