This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -770,10 +770,12 @@ export class FacadeConverter extends base.TranspilerBase {
770
770
} ;
771
771
private es6PromisesProp : ts . Map < PropertyHandler > = {
772
772
'resolve' : ( p : ts . PropertyAccessExpression ) => {
773
+ this . emit ( 'new ' ) ;
773
774
this . visit ( p . expression ) ;
774
775
this . emit ( '.value' ) ;
775
776
} ,
776
777
'reject' : ( p : ts . PropertyAccessExpression ) => {
778
+ this . emit ( 'new ' ) ;
777
779
this . visit ( p . expression ) ;
778
780
this . emit ( '.error' ) ;
779
781
} ,
Original file line number Diff line number Diff line change @@ -254,10 +254,10 @@ var y = x.length;`);
254
254
it ( 'translates into Futures' , ( ) => {
255
255
expectWithTypes ( 'let x: Promise = Promise.resolve(1);' ) . to . equal ( `import "dart:async";
256
256
257
- Future x = Future.value(1);` ) ;
257
+ Future x = new Future.value(1);` ) ;
258
258
expectWithTypes ( 'let x: Promise = Promise.reject(1);' ) . to . equal ( `import "dart:async";
259
259
260
- Future x = Future.error(1);` ) ;
260
+ Future x = new Future.error(1);` ) ;
261
261
expectWithTypes ( 'let x: Promise = new Promise((resolve) => {resolve(1);});' )
262
262
. to . equal ( `import "dart:async";
263
263
You can’t perform that action at this time.
0 commit comments