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

Chrome logs 'Uncaught (in promise) TypeError' on load #403

Closed
baardsen opened this issue Jan 29, 2016 · 2 comments
Closed

Chrome logs 'Uncaught (in promise) TypeError' on load #403

baardsen opened this issue Jan 29, 2016 · 2 comments

Comments

@baardsen
Copy link

Chrome dev (49.0.2623.23) logs an error to console when loading es6-shim.
chromeerror

The error seems to come from the promiseResolveBroken test:

var promiseResolveBroken = (function (Promise) {
  var p = Promise.resolve(5);
  p.constructor = {};
  var p2 = Promise.resolve(p);
  return (p === p2); // This *should* be false!
}(globals.Promise));

One possible fix is to add an empty reject handler to the p2 promise:

if (p2.then)
  p2.then(function() {}, function() {});`
@ljharb
Copy link
Collaborator

ljharb commented Jan 29, 2016

Generally speaking, warnings like this aren't something that need "fixing" - Firefox logs a warning about mutating prototypes, for example, because one of es6-shim's runtime checks needs to try to mutate a prototype to check compliance.

However, in this case, something like the fix you've suggested will indeed work - thanks for the suggestion!

@zloirock
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants