Closed domenic closed 10 years ago
@erights any thoughts on this?
Synchronously throwing here seems better as it's really just a typo.
I agree with Anne. We avoid throws by using rejections to protect synchronous callers against data-dependent dynamic errors. These are just static bugs in the program, for which an early-as-possible error is good.
Sounds good, will make the change tonight.
Assuming #8 is implemented and
Promise(x)
(withoutnew
) no longer coerces, what should the following do?Promise("5")
Promise(() => {})
new Promise("5")
I am leaning toward "throw a
TypeError
" but an argument could be made for returning a new promise rejected with aTypeError
instead.