File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 199199 if ( this . events . hasOwnProperty ( event ) ) {
200200 each ( this . events [ event ] , function ( callback ) {
201201 preventDefault = callback . apply ( this , args . slice ( 1 ) ) === false || preventDefault ;
202- } ) ;
202+ } , this ) ;
203203 }
204204 if ( event != 'catchall' ) {
205205 args . unshift ( 'catchAll' ) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ describe('events', function() {
1717 expect ( valid ) . toBeTruthy ( ) ;
1818 } ) ;
1919
20+ it ( 'should have a context of flow instance' , function ( ) {
21+ var context = null ;
22+ flow . on ( 'test' , function ( ) {
23+ context = this ;
24+ } ) ;
25+ flow . fire ( 'test' ) ;
26+ expect ( context ) . toEqual ( flow ) ;
27+ } ) ;
28+
2029 it ( 'should pass some arguments' , function ( ) {
2130 var valid = false ;
2231 var argumentOne = 123 ;
@@ -101,4 +110,4 @@ describe('events', function() {
101110 expect ( event ) . not . toHaveBeenCalled ( ) ;
102111 } ) ;
103112 } ) ;
104- } ) ;
113+ } ) ;
You can’t perform that action at this time.
0 commit comments