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

Act as polyfill #50

Open
ForbesLindesay opened this issue Jul 10, 2014 · 4 comments
Open

Act as polyfill #50

ForbesLindesay opened this issue Jul 10, 2014 · 4 comments

Comments

@ForbesLindesay
Copy link
Member

We may want to consider using native promises when available in the near future. We would still need to provide Promise.prototype.done and the node.js extensions though.

We would have two options:

  1. Extend the built-in Promise constructor when available and export that, export our custom implementation otherwise.
  2. Inherit from the built in Promise constructor when available, inherit from /lib/core.js otherwise.

We also have a few options when there is no built in promise constructor:

  1. Define Promise globally (in addition to exporting it). Effectively making this library a true polyfill but with some extensions.
  2. Define Promise globally, but only add our special extensions to a copy that inherits from the globally defined Promse.
  3. Continue as we are at the moment.
@edef1c
Copy link
Member

edef1c commented Dec 11, 2014

Seems we only extend the global Promise object with Promise#done, and not with nodeify/denodeify.
Other than that, we seem to have this down.

@Zorgatone
Copy link

Any update on this?
Would you add the Polyfill just if the Promise global is not defined?
What I'm really interested is the nodeify/denodeify feature

@TehShrike
Copy link
Contributor

@Zorgatone I also wanted to use those functions in other environments, so I published them as then-denodeify and then-nodeify.

@Zorgatone
Copy link

Oh ok thank you!

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

4 participants