From 84fb9dd5ec1dbd1df76eb4cc1fcecb19293e6b6f Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 18 Jan 2018 05:08:58 +1100 Subject: src/lfunc.js: Use lua_assert instead of assert --- src/lfunc.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lfunc.js b/src/lfunc.js index b07b803..c278c48 100644 --- a/src/lfunc.js +++ b/src/lfunc.js @@ -1,8 +1,7 @@ "use strict"; -const assert = require('assert'); - const defs = require('./defs.js'); +const { lua_assert } = require('./llimits.js'); const lobject = require('./lobject.js'); const CT = defs.constant_types; @@ -53,7 +52,7 @@ const luaF_findupval = function(L, level) { let prevp; let p = L.openupval; while (p !== null && p.vOff >= level) { - assert(p.isopen()); + lua_assert(p.isopen()); if (p.vOff === level) /* found a corresponding upvalue? */ return p; /* return it */ prevp = p; @@ -75,7 +74,7 @@ const luaF_findupval = function(L, level) { const luaF_close = function(L, level) { while (L.openupval !== null && L.openupval.vOff >= level) { let uv = L.openupval; - assert(uv.isopen()); + lua_assert(uv.isopen()); L.openupval = uv.open_next; /* remove from 'open' list */ if (uv.refcount === 0) { /* no references? */ /* free upvalue */ -- cgit v1.2.3-70-g09d2