@@ -476,8 +476,9 @@ describe('Observable', () => {
476
476
' of the anonymous observer' , ( done : MochaDone ) => {
477
477
//intentionally not using lambda to avoid typescript's this context capture
478
478
const o = {
479
+ myValue : 'foo' ,
479
480
next : function next ( x ) {
480
- expect ( this ) . to . equal ( o ) ;
481
+ expect ( this . myValue ) . to . equal ( 'foo' ) ;
481
482
expect ( x ) . to . equal ( 1 ) ;
482
483
done ( ) ;
483
484
}
@@ -490,8 +491,9 @@ describe('Observable', () => {
490
491
' of the anonymous observer' , ( done : MochaDone ) => {
491
492
//intentionally not using lambda to avoid typescript's this context capture
492
493
const o = {
494
+ myValue : 'foo' ,
493
495
error : function error ( err ) {
494
- expect ( this ) . to . equal ( o ) ;
496
+ expect ( this . myValue ) . to . equal ( 'foo' ) ;
495
497
expect ( err ) . to . equal ( 'bad' ) ;
496
498
done ( ) ;
497
499
}
@@ -504,8 +506,9 @@ describe('Observable', () => {
504
506
' context of the anonymous observer' , ( done : MochaDone ) => {
505
507
//intentionally not using lambda to avoid typescript's this context capture
506
508
const o = {
509
+ myValue : 'foo' ,
507
510
complete : function complete ( ) {
508
- expect ( this ) . to . equal ( o ) ;
511
+ expect ( this . myValue ) . to . equal ( 'foo' ) ;
509
512
done ( ) ;
510
513
}
511
514
} ;
@@ -527,8 +530,9 @@ describe('Observable', () => {
527
530
528
531
//intentionally not using lambda to avoid typescript's this context capture
529
532
const o = {
533
+ myValue : 'foo' ,
530
534
next : function next ( x ) {
531
- expect ( this ) . to . equal ( o ) ;
535
+ expect ( this . myValue ) . to . equal ( 'foo' ) ;
532
536
throw x ;
533
537
}
534
538
} ;
0 commit comments