From ac1acf55ac7a6708cf5a01cb6e5690d061084975 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 18 Dec 2017 15:37:28 -0800 Subject: [PATCH] Fix a typo in `passStringToWasm` --- crates/wasm-bindgen-cli-support/src/js.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/wasm-bindgen-cli-support/src/js.rs b/crates/wasm-bindgen-cli-support/src/js.rs index 3337b588f..cb20af32a 100644 --- a/crates/wasm-bindgen-cli-support/src/js.rs +++ b/crates/wasm-bindgen-cli-support/src/js.rs @@ -218,7 +218,7 @@ impl Js { if self.nodejs { globals.push_str(" function passStringToWasm(arg) { - if (typeof(n) !== 'string') + if (typeof(arg) !== 'string') throw new Error('expected a string argument'); const buf = Buffer.from(arg); const len = buf.length; @@ -231,7 +231,7 @@ impl Js { } else { globals.push_str(" function passStringToWasm(arg) { - if (typeof(n) !== 'string') + if (typeof(arg) !== 'string') throw new Error('expected a string argument'); const buf = new TextEncoder('utf-8').encode(arg); const len = buf.length;