mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 19:11:45 +03:00
Fix a typo in passStringToWasm
This commit is contained in:
parent
d768b42a64
commit
ac1acf55ac
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user