@@ -15,6 +15,7 @@ use std::env;
15
15
use std:: fs;
16
16
use std:: path:: { Path , PathBuf } ;
17
17
use std:: process:: Command ;
18
+ use walrus:: ModuleConfig ;
18
19
19
20
fn main ( ) -> Result < ( ) > {
20
21
let filter = env:: args ( ) . nth ( 1 ) ;
@@ -93,7 +94,11 @@ fn runtest(test: &Path) -> Result<()> {
93
94
. join ( "reference_test.wasm" ) ;
94
95
95
96
let mut bindgen = Command :: cargo_bin ( "wasm-bindgen" ) ?;
96
- bindgen. arg ( "--out-dir" ) . arg ( td. path ( ) ) . arg ( & wasm) ;
97
+ bindgen
98
+ . arg ( "--out-dir" )
99
+ . arg ( td. path ( ) )
100
+ . arg ( & wasm)
101
+ . arg ( "--remove-producers-section" ) ;
97
102
if contents. contains ( "// enable-externref" ) {
98
103
bindgen. env ( "WASM_BINDGEN_EXTERNREF" , "1" ) ;
99
104
}
@@ -125,7 +130,9 @@ fn sanitize_wasm(wasm: &Path) -> Result<String> {
125
130
// Clean up the wasm module by removing all function
126
131
// implementations/instructions, data sections, etc. This'll help us largely
127
132
// only deal with exports/imports which is all we're really interested in.
128
- let mut module = walrus:: Module :: from_file ( wasm) ?;
133
+ let mut module = ModuleConfig :: new ( )
134
+ . generate_producers_section ( false )
135
+ . parse_file ( wasm) ?;
129
136
for func in module. funcs . iter_mut ( ) {
130
137
let local = match & mut func. kind {
131
138
walrus:: FunctionKind :: Local ( l) => l,
0 commit comments