Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Use native Promise if available #21

Closed
novemberborn opened this issue Sep 28, 2016 · 1 comment
Closed

Use native Promise if available #21

novemberborn opened this issue Sep 28, 2016 · 1 comment

Comments

@novemberborn
Copy link
Contributor

Unlike say Map, the Promise shim does not fall back to the native Promise if it's available. This means we're not benefiting from unhandled rejections and other promise debugging features in modern debuggers.

Currently the shim implements the non-standard Promise#finally(). This should be moved to Task before the native Promise can be used.

@kitsonk
Copy link
Member

kitsonk commented Oct 4, 2016

I really feel we need to address this before the beta release as it has several performance implications and potentially typing implications.

A another note, related to #16 is the Promise.prototype.finally is now a TC39 Stage 2 Proposal.

My thinking is that we should do the following:

  • convert dojo-shim/Promise to a "full" shim like the rest of the shims
  • migrate .finally() to dojo-core/async/Task
  • polyfill those features back into dojo-shim/Promise when they reach Stage 4 (which for both is likely to be at least a year)

@rorticus rorticus self-assigned this Oct 14, 2016
@dylans dylans added this to the 2016.10 milestone Oct 24, 2016
rorticus added a commit to rorticus/shim that referenced this issue Oct 25, 2016
rorticus added a commit to rorticus/shim that referenced this issue Oct 26, 2016
rorticus added a commit to rorticus/shim that referenced this issue Oct 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants