@@ -12,9 +12,8 @@ use crate::nanbox::{double_literal, POINTER_MASK_I64};
1212use crate :: types:: { DOUBLE , I1 , I32 , I64 , PTR } ;
1313
1414use super :: {
15- lower_array_super_init, lower_event_emitter_async_resource_subclass_init,
16- lower_event_emitter_subclass_init, lower_expr, lower_node_stream_super_init,
17- lower_stream_super_init, nanbox_pointer_inline, FnCtx ,
15+ lower_array_super_init, lower_event_emitter_subclass_init, lower_expr,
16+ lower_node_stream_super_init, lower_stream_super_init, nanbox_pointer_inline, FnCtx ,
1817} ;
1918
2019/// Enter one derived constructor's `super()` binding scope.
@@ -827,83 +826,6 @@ pub(crate) fn lower(ctx: &mut FnCtx<'_>, expr: &Expr) -> Result<String> {
827826 ) ?;
828827 return Ok ( double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ) ;
829828 }
830- if parent_name. as_str ( ) == "EventEmitterAsyncResource" {
831- let mut lowered = Vec :: with_capacity ( super_args. len ( ) ) ;
832- for arg in super_args {
833- lowered. push ( lower_expr ( ctx, arg) ?) ;
834- }
835- let options = lowered. first ( ) . cloned ( ) . unwrap_or_else ( || {
836- double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) )
837- } ) ;
838- let this_box = match ctx. this_stack . last ( ) . cloned ( ) {
839- Some ( slot) => ctx. block ( ) . load ( DOUBLE , & slot) ,
840- None => double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ,
841- } ;
842- lower_event_emitter_async_resource_subclass_init ( ctx, & this_box, & options) ;
843- bind_derived_this_after_super ( ctx) ;
844- let current_class_name =
845- ctx. class_stack . last ( ) . cloned ( ) . unwrap_or_default ( ) ;
846- crate :: lower_call:: apply_field_initializers_recursive (
847- ctx,
848- & current_class_name,
849- crate :: lower_call:: FieldInitMode :: SelfOnly ,
850- ) ?;
851- return Ok ( double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ) ;
852- }
853- if parent_name. as_str ( ) == "AsyncLocalStorage" {
854- for arg in super_args {
855- let _ = lower_expr ( ctx, arg) ?;
856- }
857- let this_box = match ctx. this_stack . last ( ) . cloned ( ) {
858- Some ( slot) => ctx. block ( ) . load ( DOUBLE , & slot) ,
859- None => double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ,
860- } ;
861- ctx. block ( ) . call (
862- DOUBLE ,
863- "js_async_local_storage_subclass_init" ,
864- & [ ( DOUBLE , & this_box) ] ,
865- ) ;
866- bind_derived_this_after_super ( ctx) ;
867- let current_class_name =
868- ctx. class_stack . last ( ) . cloned ( ) . unwrap_or_default ( ) ;
869- crate :: lower_call:: apply_field_initializers_recursive (
870- ctx,
871- & current_class_name,
872- crate :: lower_call:: FieldInitMode :: SelfOnly ,
873- ) ?;
874- return Ok ( double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ) ;
875- }
876- if parent_name. as_str ( ) == "AsyncResource" {
877- let undef = double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ;
878- let mut lowered = Vec :: with_capacity ( super_args. len ( ) ) ;
879- for arg in super_args {
880- lowered. push ( lower_expr ( ctx, arg) ?) ;
881- }
882- let type_value = lowered. first ( ) . cloned ( ) . unwrap_or_else ( || undef. clone ( ) ) ;
883- let options = lowered. get ( 1 ) . cloned ( ) . unwrap_or_else ( || undef. clone ( ) ) ;
884- let this_box = match ctx. this_stack . last ( ) . cloned ( ) {
885- Some ( slot) => ctx. block ( ) . load ( DOUBLE , & slot) ,
886- None => undef,
887- } ;
888- ctx. block ( ) . call (
889- DOUBLE ,
890- "js_async_resource_subclass_init" ,
891- & [
892- ( DOUBLE , & this_box) ,
893- ( DOUBLE , & type_value) ,
894- ( DOUBLE , & options) ,
895- ] ,
896- ) ;
897- bind_derived_this_after_super ( ctx) ;
898- let current_class_name =
899- ctx. class_stack . last ( ) . cloned ( ) . unwrap_or_default ( ) ;
900- crate :: lower_call:: apply_field_initializers_recursive (
901- ctx,
902- & current_class_name,
903- crate :: lower_call:: FieldInitMode :: SelfOnly ,
904- ) ?;
905- return Ok ( double_literal ( f64:: from_bits ( crate :: nanbox:: TAG_UNDEFINED ) ) ) ;
906- }
907829 // `class X extends Request` / `extends Response`:
908830 // `super(input, init)` allocates the underlying native
909831 // Web-Fetch handle and stashes its id on `this` under
0 commit comments