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:
Andrew Chin 2018-08-11 10:09:34 -04:00
parent ca5e7b8542
commit 156eb24359
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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}();
}} }}