Closed paulcwatts closed 3 years ago
@kimroen This please. Native async functions don't return instances of the global Promise. It'll always returns a native promise, causing the following to fail.
(async function() {})() instanceof Promise // false
@kimroen Any chance of getting this reviewed? If you want I can make the diff look better by not indenting the code.
Yes please. I get the following Error in IE 11 when using this module:
Error while processing route: index Cannot redefine non-configurable property 'Promise' TypeError: Cannot redefine non-configurable property 'Promise'
To clarify: This error only triggers if you use a module that swaps out Promise, like ember-indexeddb
. Both modules work on their own in IE 11, but don't work nicely together.
We should try to get this merged once #80 is merged.
Spoke to @kimroen via Twitter. He's on vacation right now, but will look into all PRs once back.
1.1.0 is released with this change!
This does two things:
window.Promise
from being overridden.The diff is ugly, but none of the code within the IIFE was changed. I promise :)