then / promise

Bare bones Promises/A+ implementation
https://www.promisejs.org
MIT License
2.58k stars 312 forks source link

code refactor. use new.target to detect if promise is called with new instead of this check #165

Closed sktguha closed 3 years ago

sktguha commented 4 years ago

In https://github.com/then/promise/blob/91b7b4cb6ad0cacc1c70560677458fe0aac2fa67/src/core.js#L55 for checking whether the promise constructor is called with new it is better to use new target https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target if it is accepted the change then I can make a PR for this

ForbesLindesay commented 3 years ago

This does not seem to be worth working on, given that the current approach works.