@@ -78,7 +78,7 @@ var caml_fiber_stack;
7878//Provides:caml_resume_stack
7979//Requires: caml_named_value, caml_raise_constant, caml_exn_stack, caml_fiber_stack
8080//If: effects
81- function caml_resume_stack ( stack , k ) {
81+ function caml_resume_stack ( stack , last , k ) {
8282 if ( ! stack )
8383 caml_raise_constant (
8484 caml_named_value ( "Effect.Continuation_already_resumed" ) ,
@@ -111,9 +111,9 @@ function caml_pop_fiber() {
111111//Provides: caml_perform_effect
112112//Requires: caml_pop_fiber, caml_stack_check_depth, caml_trampoline_return, caml_exn_stack, caml_fiber_stack
113113//If: effects
114- function caml_perform_effect ( eff , cont , k0 ) {
114+ function caml_perform_effect ( eff , cont , last , k0 ) {
115115 // Allocate a continuation if we don't already have one
116- if ( ! cont ) cont = [ 245 /*continuation*/ , 0 ] ;
116+ if ( ! cont ) cont = [ 245 /*continuation*/ , 0 , 0 ] ;
117117 // Get current effect handler
118118 var handler = caml_fiber_stack . h [ 3 ] ;
119119 // Cons the current fiber onto the continuation:
@@ -122,9 +122,10 @@ function caml_perform_effect(eff, cont, k0) {
122122 // Move to parent fiber and execute the effect handler there
123123 // The handler is defined in Stdlib.Effect, so we know that the arity matches
124124 var k1 = caml_pop_fiber ( ) ;
125+ var last_fiber = "last_fiber" ; // FIXME
125126 return caml_stack_check_depth ( )
126- ? handler ( eff , cont , k1 , k1 )
127- : caml_trampoline_return ( handler , [ eff , cont , k1 , k1 ] ) ;
127+ ? handler ( eff , cont , last_fiber , k1 )
128+ : caml_trampoline_return ( handler , [ eff , cont , last_fiber , k1 ] ) ;
128129}
129130
130131//Provides: caml_alloc_stack
0 commit comments