summaryrefslogtreecommitdiff
path: root/src/lfunc.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-18 05:08:58 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-18 07:07:52 +1100
commit84fb9dd5ec1dbd1df76eb4cc1fcecb19293e6b6f (patch)
tree3e73f41c7ae9477ebf8f65355b64b16c6e275de6 /src/lfunc.js
parent12fcfad382a7a99c6afba1298e76107c9d517d61 (diff)
downloadfengari-84fb9dd5ec1dbd1df76eb4cc1fcecb19293e6b6f.tar.gz
fengari-84fb9dd5ec1dbd1df76eb4cc1fcecb19293e6b6f.tar.bz2
fengari-84fb9dd5ec1dbd1df76eb4cc1fcecb19293e6b6f.zip
src/lfunc.js: Use lua_assert instead of assert
Diffstat (limited to 'src/lfunc.js')
-rw-r--r--src/lfunc.js7
1 files 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 */