summaryrefslogtreecommitdiff
path: root/src/defs.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-15 15:19:45 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-29 01:15:56 +1100
commit036bb181d59364d13207225bac25b419485a3df7 (patch)
tree617cff5548db8a24a83bce5b29d6010025c597e0 /src/defs.js
parentab1881cd9f2746ad8e75ba573be34041f95ab5a6 (diff)
downloadfengari-036bb181d59364d13207225bac25b419485a3df7.tar.gz
fengari-036bb181d59364d13207225bac25b419485a3df7.tar.bz2
fengari-036bb181d59364d13207225bac25b419485a3df7.zip
src/: Add defs.from_userstring function to take string from api
Diffstat (limited to 'src/defs.js')
-rw-r--r--src/defs.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/defs.js b/src/defs.js
index 381114b..a2c5c75 100644
--- a/src/defs.js
+++ b/src/defs.js
@@ -247,6 +247,11 @@ const to_luastring = function(str, cache) {
return outU8Array;
};
+const from_userstring = function(str) {
+ assert(is_luastring(str), "expects an array of bytes");
+ return str;
+};
+
/*
** Event codes
*/
@@ -429,3 +434,4 @@ module.exports.string_of = string_of;
module.exports.to_jsstring = to_jsstring;
module.exports.to_luastring = to_luastring;
module.exports.to_uristring = to_uristring;
+module.exports.from_userstring = from_userstring;