@@ -580,7 +580,7 @@ impl<'a> Context<'a> {
580
580
Some ( class) => struct_function_export_name ( class, export. function . name ) ,
581
581
None => export. function . name . to_string ( ) ,
582
582
} ;
583
- let descriptor = match self . descriptors . remove ( & wasm_name) {
583
+ let mut descriptor = match self . descriptors . remove ( & wasm_name) {
584
584
None => return Ok ( ( ) ) ,
585
585
Some ( d) => d. unwrap_function ( ) ,
586
586
} ;
@@ -595,23 +595,32 @@ impl<'a> Context<'a> {
595
595
match export. method_kind {
596
596
decode:: MethodKind :: Constructor => AuxExportKind :: Constructor ( class) ,
597
597
decode:: MethodKind :: Operation ( op) => match op. kind {
598
- decode:: OperationKind :: Getter ( f) => AuxExportKind :: Getter {
599
- class,
600
- field : f. to_string ( ) ,
601
- } ,
602
- decode:: OperationKind :: Setter ( f) => AuxExportKind :: Setter {
603
- class,
604
- field : f. to_string ( ) ,
605
- } ,
598
+ decode:: OperationKind :: Getter ( f) => {
599
+ descriptor. arguments . insert ( 0 , Descriptor :: I32 ) ;
600
+ AuxExportKind :: Getter {
601
+ class,
602
+ field : f. to_string ( ) ,
603
+ }
604
+ }
605
+ decode:: OperationKind :: Setter ( f) => {
606
+ descriptor. arguments . insert ( 0 , Descriptor :: I32 ) ;
607
+ AuxExportKind :: Setter {
608
+ class,
609
+ field : f. to_string ( ) ,
610
+ }
611
+ }
606
612
_ if op. is_static => AuxExportKind :: StaticFunction {
607
613
class,
608
614
name : export. function . name . to_string ( ) ,
609
615
} ,
610
- _ => AuxExportKind :: Method {
611
- class,
612
- name : export. function . name . to_string ( ) ,
613
- consumed : export. consumed ,
614
- } ,
616
+ _ => {
617
+ descriptor. arguments . insert ( 0 , Descriptor :: I32 ) ;
618
+ AuxExportKind :: Method {
619
+ class,
620
+ name : export. function . name . to_string ( ) ,
621
+ consumed : export. consumed ,
622
+ }
623
+ }
615
624
} ,
616
625
}
617
626
}
@@ -931,7 +940,7 @@ impl<'a> Context<'a> {
931
940
// Register a webidl transformation for the getter
932
941
let ( getter_id, _) = self . function_exports [ & getter] ;
933
942
let getter_descriptor = Function {
934
- arguments : Vec :: new ( ) ,
943
+ arguments : vec ! [ Descriptor :: I32 ] ,
935
944
shim_idx : 0 ,
936
945
ret : descriptor. clone ( ) ,
937
946
} ;
@@ -956,7 +965,7 @@ impl<'a> Context<'a> {
956
965
957
966
let ( setter_id, _) = self . function_exports [ & setter] ;
958
967
let setter_descriptor = Function {
959
- arguments : vec ! [ descriptor] ,
968
+ arguments : vec ! [ Descriptor :: I32 , descriptor] ,
960
969
shim_idx : 0 ,
961
970
ret : Descriptor :: Unit ,
962
971
} ;
0 commit comments