summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-04-26 22:59:22 +1000
committerdaurnimator <quae@daurnimator.com>2017-04-26 22:59:22 +1000
commita70eeebe4aa5014e08b67da7ec07be903c3cf6a5 (patch)
tree28ae75b25c58cb24c8576567f4072deb5f098d85
parent6d07675c7397e351c8c15ae961f8ad06c3f9d8a6 (diff)
downloadfengari-a70eeebe4aa5014e08b67da7ec07be903c3cf6a5.tar.gz
fengari-a70eeebe4aa5014e08b67da7ec07be903c3cf6a5.tar.bz2
fengari-a70eeebe4aa5014e08b67da7ec07be903c3cf6a5.zip
src/lapi.js: Ignore size argument to lua_newuserdata
-rw-r--r--src/lapi.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lapi.js b/src/lapi.js
index 6d75e44..184630c 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -466,12 +466,9 @@ const lua_createtable = function(L, narray, nrec) {
assert(L.top <= L.ci.top, "stack overflow");
};
+// ignore size argument
const lua_newuserdata = function(L, size) {
- let box;
- if (typeof size == "number")
- box = new ArrayBuffer(size);
- else // if size is not passed, create a new empty object
- box = Object.create(null);
+ let box = Object.create(null);
L.stack[L.top++] = new lobject.TValue(CT.LUA_TUSERDATA, box);