paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

native Promise broken in node 10.0 and 10.1 #455

Open ljharb opened 5 years ago

ljharb commented 5 years ago

in node < 10, or 10.2+, the following code in the REPL shows a rejected promise. in node 10.0 and 10.1, however, the promise is forever pending.

var r, p = new Promise(y => { r = y; }); r({ then() { throw 42; } }); p;
ljharb commented 5 years ago

https://github.com/v8/v8/commit/40060be68ca4faf00f526c5e581148e1141f489d is the bug fix; there may not be any way to synchronously detect it.