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
constpatch=require('../../../lib/patches/all');// load the patchprocess.on('uncaughtException',function(err){console.log(' This is uncaught => ',err);});constdomain=require('domain');constd=domain.create();d.on('error',function(err){console.error(' => Domain caught => ',err);});d.run(function(){Promise.resolve().then(function(){process.nextTick(function(){thrownewError('rah');// <<<<<<<< the domain will catch this});});});
if we load the plain vanilla JS patch, this test script works as expected.
However, if we load the patch generated by TypeScript, we get this error:
TypeError: #<PatchedPromise> is not a promise
Pretty intense, by I am very certain this is some sort of bug.
The text was updated successfully, but these errors were encountered:
This is not the same as other ES5-builtins. this is a duplicate of #15202.
The main issue here is that ES6 classes (e.g. Promise) are not callable, the way ES5 built in classes (e.g. Array). The emitted code that the compiler produces uses super.call which throws in ES6 engine.
This is a bug report. On tsc version 2.2.2
I have this TS code:
This transpiles to:
however the transpiled code does not work, while the following vanilla JS / ES6 code works:
Here is the test:
if we load the plain vanilla JS patch, this test script works as expected.
However, if we load the patch generated by TypeScript, we get this error:
TypeError: #<PatchedPromise> is not a promise
Pretty intense, by I am very certain this is some sort of bug.
The text was updated successfully, but these errors were encountered: