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

Polyfill is always overring default Promise object #127

Closed
rlsoeiro opened this issue Jul 10, 2015 · 2 comments
Closed

Polyfill is always overring default Promise object #127

rlsoeiro opened this issue Jul 10, 2015 · 2 comments

Comments

@rlsoeiro
Copy link

Hi,

I just tried to use the polyfill in Chrome (latest) and it is replacing the default implementation instead of properly detecting it.

The problem seems to be in this code fragment:
if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
return;
}

Object.prototype.toString.call(P.resolve()) is returning '[object Object]'. Can anyone else reproduce this behavior? The fix should be simple, buit I'd like to know why this approach is being used to detect the default Promise.

@stefanpenner
Copy link
Owner

Object.prototype.toString.call(P.resolve()) is returning '[object Object]'. Can anyone else reproduce this behavior? The fix should be simple, buit I'd like to know why this approach is being used to detect the default Promise.

this version of chrome still has a bugy promise implementation, so we choose our implementation which does not suffer those same issues.

@stefanpenner
Copy link
Owner

dupe of : #111 and several others.

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

2 participants