paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

Fix 'Uncaught (in promise) TypeError' in Chrome 48 #408

Closed mcmath closed 8 years ago

mcmath commented 8 years ago

Fix for Issue #407.

On Chrome 48.0 in OSX, the following console warning started appearing with the release of es6-shim v0.34.3:

Uncaught (in promise) TypeError: object is not a function            index.html:1
    at Object.defer (native)
    at chain (native)
    at then (native)

The one-line change here fixes the warning. It seems that the warning was originating from the 'inner' promise p (the promise resolved by the 'outer' promise p2) on line 2562. The fix was to catch the rejection by promise p with a noop.

The warning is gone and all tests are passing.

ljharb commented 8 years ago

This is super bonkers but I can confirm it fixes it. Thanks!