From 238009cd056acc3277b38eb6520c1afee019bb26 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 14 Feb 2017 12:56:44 +0100 Subject: __newindex --- src/ltm.js | 3 +++ src/lvm.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ltm.js b/src/ltm.js index fc0d0ec..c712160 100644 --- a/src/ltm.js +++ b/src/ltm.js @@ -1,6 +1,8 @@ /*jshint esversion: 6 */ "use strict"; +const assert = require('assert'); + const lobject = require('./lobject.js'); const TValue = lobject.TValue; const Table = lobject.Table; @@ -56,6 +58,7 @@ const luaT_callTM = function(L, f, p1, p2, p3, hasres) { ldo.luaD_callnoyield(L, func, hasres); if (hasres) { + assert(typeof result === "number"); L.stack[result] = L.stack[--L.top]; } }; diff --git a/src/lvm.js b/src/lvm.js index b0b5d53..cd9548e 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -1006,7 +1006,7 @@ const luaV_finishset = function(L, t, key, val, slot, recur) { } if (tm.ttisfunction()) { - ltm.luaT_callTM(L, tm, t, key, val, 1); + ltm.luaT_callTM(L, tm, t, key, val, 0); return; } -- cgit v1.2.3-70-g09d2