You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
during fixing #176 the next code was introduced in commit 9d7e2da:
varpromise=$Promise.resolve(1),FakePromise=(promise.constructor={}// !! at this moment promise.constructor equals new object instance !!)[require('./_wks')('species')]=function(exec){exec(empty,empty);};// unhandled rejections tracking support, NodeJS Promise without it fails @@species testreturn(isNode||typeofPromiseRejectionEvent=='function')&&promise.then(empty)// !! here comes .then method which fails with // TypeError: object is not a constructorinstanceofFakePromise;
during fixing #176 the next code was introduced in commit 9d7e2da:
the reason promise.then method fails in V8 is this --V8 creates new Promise every time
.then
method is called: https://github.com/v8/v8/blob/611add52550510b6bc0b79f6ae9278786183405f/src/js/promise.js#L285and what is especially important, if
promise.constructor !== Promise
, V8 tries to create new promise from whatever thingpromise.constructor
points to ( https://github.com/v8/v8/blob/611add52550510b6bc0b79f6ae9278786183405f/src/js/promise.js#L233 )! which is{}
in case above! hence we haveobject is not a constructor
TypeError.The text was updated successfully, but these errors were encountered: