Skip to content

Commit a596dc4

Browse files
committed
Make JS use a '.wasm' extension when importing the binary
1 parent 7936e1e commit a596dc4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/cli-support/src/js/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ impl<'a> Context<'a> {
132132

133133
self.bind("__wbindgen_object_drop_ref", &|me| {
134134
me.expose_drop_ref();
135-
Ok("function(i) {
136-
dropRef(i);
135+
Ok("function(i) {
136+
dropRef(i);
137137
}".to_string())
138138
})?;
139139

@@ -149,8 +149,8 @@ impl<'a> Context<'a> {
149149

150150
self.bind("__wbindgen_number_new", &|me| {
151151
me.expose_add_heap_object();
152-
Ok(String::from("function(i) {
153-
return addHeapObject(i);
152+
Ok(String::from("function(i) {
153+
return addHeapObject(i);
154154
}"))
155155
})?;
156156

@@ -169,8 +169,8 @@ impl<'a> Context<'a> {
169169

170170
self.bind("__wbindgen_undefined_new", &|me| {
171171
me.expose_add_heap_object();
172-
Ok(String::from("function() {
173-
return addHeapObject(undefined);
172+
Ok(String::from("function() {
173+
return addHeapObject(undefined);
174174
}"))
175175
})?;
176176

@@ -365,7 +365,7 @@ impl<'a> Context<'a> {
365365
module_name));
366366
format!("var wasm;")
367367
} else {
368-
format!("import * as wasm from './{}_bg';", module_name)
368+
format!("import * as wasm from './{}_bg.wasm';", module_name)
369369
};
370370

371371
format!("\

crates/cli-support/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,11 @@ fn indent_recurse(mut lines: ::std::str::Lines, current_indent: usize) -> String
403403
next_indent += 1;
404404
}
405405
if trimmed.starts_with('}') || trimmed.ends_with('}') {
406-
if current_indent > 0 {
407-
current_indent -= 1;
406+
if current_indent > 0 {
407+
current_indent -= 1;
408408
}
409-
if next_indent > 0 {
410-
next_indent -= 1;
409+
if next_indent > 0 {
410+
next_indent -= 1;
411411
}
412412
}
413413
if trimmed.starts_with('?') || trimmed.starts_with(':') {

0 commit comments

Comments
 (0)