File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -372,13 +372,14 @@ function renderCArg(v: unknown): string {
372372}
373373
374374function renderDecodeCall ( call : DecodeCall , valueExpr : string ) : string {
375+ // Always emit 2-arg form. Runtime helpers and hatches all accept
376+ // (value, args_json) uniformly; args_json is "{}" when no args.
377+ // Matches the Rust emitter's convergence-pass behavior.
378+ const argsJson = cString ( JSON . stringify ( call . args ) ) ;
375379 if ( call . fn === "custom" ) {
376- return `ads_hatch_${ call . name } (${ valueExpr } , ${ cString ( JSON . stringify ( call . args ) ) } )` ;
380+ return `ads_hatch_${ call . name } (${ valueExpr } , ${ argsJson } )` ;
377381 }
378- if ( Object . keys ( call . args ) . length > 0 ) {
379- return `ads_decode_${ call . fn } (${ valueExpr } , ${ cString ( JSON . stringify ( call . args ) ) } )` ;
380- }
381- return `ads_decode_${ call . fn } (${ valueExpr } )` ;
382+ return `ads_decode_${ call . fn } (${ valueExpr } , ${ argsJson } )` ;
382383}
383384
384385function renderExpr ( expr : ValueExpr ) : string {
You can’t perform that action at this time.
0 commit comments