From 456ab7b69f88859683c60cc2261e70d6dbadd8e8 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 29 Mar 2017 14:39:57 +0200 Subject: 8-bit string internally tests Lexing/Parsing is done on byte rather than js strings --- src/lua.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lua.js') diff --git a/src/lua.js b/src/lua.js index 4710ded..85d4b64 100644 --- a/src/lua.js +++ b/src/lua.js @@ -135,6 +135,8 @@ class lua_Debug { } const to_luastring = function(str, maxBytesToWrite) { + assert(typeof str === "string", "to_luastring expect a js string"); + maxBytesToWrite = maxBytesToWrite !== undefined ? maxBytesToWrite : Number.MAX_SAFE_INTEGER; let outU8Array = []; -- cgit v1.2.3-70-g09d2