From a70eeebe4aa5014e08b67da7ec07be903c3cf6a5 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 26 Apr 2017 22:59:22 +1000 Subject: src/lapi.js: Ignore size argument to lua_newuserdata --- src/lapi.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2