Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Promise.all and Promise.race seems not to be implemented in webcomponents-lite.js and overwrites previous implementation #800

Closed
cedeber opened this issue Jun 14, 2017 · 4 comments
Assignees

Comments

@cedeber
Copy link

cedeber commented Jun 14, 2017

Hi, looks like the implementation of the Promise polyfill is missing some methods.
And, if it is already implemented thanks to another polyfill, then it overwrites it anyways (and so removes all and race methods)

@cedeber
Copy link
Author

cedeber commented Jun 15, 2017

It overwrites previously called polyfills.

@cedeber cedeber changed the title Promise.all and Promise.race are not implemented in webcomponents-lite.js Promise.all and Promise.race in webcomponents-lite.js Jun 15, 2017
@cedeber cedeber changed the title Promise.all and Promise.race in webcomponents-lite.js Promise.all and Promise.race seems not to be implemented in webcomponents-lite.js and overwrites previous implementation Jun 15, 2017
manolo added a commit to manolo/vaadin-pouchdb that referenced this issue Aug 13, 2017
Polymer polyfill has an incomplete implementation of Promises
webcomponents/webcomponentsjs#800
manolo added a commit to manolo/vaadin-pouchdb that referenced this issue Aug 19, 2017
Polymer polyfill has an incomplete implementation of Promises
webcomponents/webcomponentsjs#800
@filaraujo
Copy link
Contributor

When building the debug version of lite.js, all methods are populated on the Promise$3 object. However when running the closure process the methods are removed. You can see q.h which refers to Promise.race. It is then exposed on global as Promise.h

https://github.com/webcomponents/webcomponentsjs/blob/master/webcomponents-lite.js#L100

@dfreedm dfreedm self-assigned this Aug 22, 2017
@dfreedm dfreedm added the bug label Aug 22, 2017
@dfreedm
Copy link
Contributor

dfreedm commented Aug 22, 2017

Seems like it could be that closure is missing externs for those methods.

@maciejw
Copy link

maciejw commented Oct 12, 2017

Promise.prototype.catch is missing in webcomponents-lite also. I have window.Promise defined by bluebird and webcomponents-lite does not contain "if" (https://github.com/webcomponents/webcomponentsjs/blob/master/src/promise.js#L17) that assigns es6-promise conditionally only when is missing. Closure advanced compilation removed this "if" and overwrites bluebird. I've changed closure options in gulpfile to simple and that fixed the issue.

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

No branches or pull requests

4 participants