diff options
author | daurnimator <quae@daurnimator.com> | 2017-12-15 16:25:27 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-12-29 02:32:41 +1100 |
commit | 83de14b90b5f5c80a168d317cf41884aa20a24a0 (patch) | |
tree | 2684549c0d932fddc2c7da562f117d5868d85be4 | |
parent | ffbae7dce27aff68a0f37529e1837378efa43a36 (diff) | |
download | fengari-83de14b90b5f5c80a168d317cf41884aa20a24a0.tar.gz fengari-83de14b90b5f5c80a168d317cf41884aa20a24a0.tar.bz2 fengari-83de14b90b5f5c80a168d317cf41884aa20a24a0.zip |
src/defs.js: Automatically convert js strings
-rw-r--r-- | src/defs.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/defs.js b/src/defs.js index a2c5c75..c231c3d 100644 --- a/src/defs.js +++ b/src/defs.js @@ -248,7 +248,9 @@ const to_luastring = function(str, cache) { }; const from_userstring = function(str) { - assert(is_luastring(str), "expects an array of bytes"); + if (typeof str === "string") + return to_luastring(str); + assert(is_luastring(str), "expects an array of bytes or javascript string"); return str; }; |