It's difference between native and shim

Author: david-niCreated May 4, 2018Updated May 8, 2018

when I run the following code in browser(chrome v66) that support promise native

let promiseA = new Promise(function(resolve){ resolve('A') }),
    promiseB = new Promise(function(resolve){ resolve(promiseA) }),
    promiseC = new Promise(function(resolve){ resolve('C') });

promiseB.then((arg)=>{ console.log(arg); });
promiseC.then((arg)=>{ console.log(arg); });

the result is C A but when I run the same code with es6-promise,the result is reverse: A C which one is right?

Source: stefanpenner/es6-promise