mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-26 19:45:54 +03:00
Use raw string in paths in webidl-tests generated code
This fixes things on Windows, which uses backslashes in their paths
This commit is contained in:
parent
ca5e7b8542
commit
156eb24359
@ -2033,7 +2033,7 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
if let Some(module) = &import.module {
|
if let Some(module) = &import.module {
|
||||||
if use_node_require {
|
if use_node_require {
|
||||||
imports.push_str(&format!(
|
imports.push_str(&format!(
|
||||||
"const {} = require('{}').{};\n",
|
"const {} = require(String.raw`{}`).{};\n",
|
||||||
name, module, name_to_import
|
name, module, name_to_import
|
||||||
));
|
));
|
||||||
} else if name_to_import == name {
|
} else if name_to_import == name {
|
||||||
|
@ -28,7 +28,7 @@ fn main() {
|
|||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
#[wasm_bindgen(module = "{}")]
|
#[wasm_bindgen(module = r"{}")]
|
||||||
extern {{
|
extern {{
|
||||||
fn not_actually_a_function{1}();
|
fn not_actually_a_function{1}();
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user