File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -101,3 +101,6 @@ exports.assert_dead_import_not_generated = function() {
101
101
const bindings = fs . readFileSync ( filename ) ;
102
102
assert . ok ( ! bindings . includes ( "unused_import" ) ) ;
103
103
} ;
104
+
105
+ exports . import_inside_function_works = function ( ) { } ;
106
+ exports . import_inside_private_module = function ( ) { } ;
Original file line number Diff line number Diff line change @@ -175,3 +175,31 @@ fn rename_static_with_string() {
175
175
fn dead_imports_not_generated ( ) {
176
176
assert_dead_import_not_generated ( ) ;
177
177
}
178
+
179
+ #[ wasm_bindgen_test]
180
+ #[ cfg( feature = "nightly" ) ]
181
+ fn import_inside_function_works ( ) {
182
+ #[ wasm_bindgen( module = "tests/wasm/imports.js" ) ]
183
+ extern {
184
+ fn import_inside_function_works ( ) ;
185
+ }
186
+ import_inside_function_works ( ) ;
187
+ }
188
+
189
+ #[ wasm_bindgen_test]
190
+ #[ cfg( feature = "nightly" ) ]
191
+ fn private_module_imports_work ( ) {
192
+ private:: foo ( ) ;
193
+ }
194
+
195
+ mod private {
196
+ use wasm_bindgen:: prelude:: * ;
197
+
198
+ pub fn foo ( ) {
199
+ #[ wasm_bindgen( module = "tests/wasm/imports.js" ) ]
200
+ extern {
201
+ fn import_inside_private_module ( ) ;
202
+ }
203
+ import_inside_private_module ( ) ;
204
+ }
205
+ }
You can’t perform that action at this time.
0 commit comments