diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-18 07:30:25 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-18 07:30:25 +1100 |
commit | 53d2c6475ec23b5e088ea43b96008d3bdd607351 (patch) | |
tree | 7c22a35ef298f5e5f5ec2758186066545e3f5ad9 /src | |
parent | 5152d5b95373d8065ca9fc457f69c9401413c9fa (diff) | |
download | fengari-53d2c6475ec23b5e088ea43b96008d3bdd607351.tar.gz fengari-53d2c6475ec23b5e088ea43b96008d3bdd607351.tar.bz2 fengari-53d2c6475ec23b5e088ea43b96008d3bdd607351.zip |
src/lundump.js: Use lua_assert instead of assert
Diffstat (limited to 'src')
-rw-r--r-- | src/lundump.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lundump.js b/src/lundump.js index bb6cb29..f389950 100644 --- a/src/lundump.js +++ b/src/lundump.js @@ -1,12 +1,11 @@ "use strict"; -const assert = require('assert'); - const defs = require('./defs.js'); const ldo = require('./ldo.js'); const lfunc = require('./lfunc.js'); const lobject = require('./lobject.js'); const lopcodes = require('./lopcodes.js'); +const { lua_assert } = require("./llimits.js"); const { luaS_bless } = require('./lstring.js'); @@ -32,8 +31,8 @@ class BytecodeParser { this.integerSize = 4; this.numberSize = 8; - assert(Z instanceof lzio.ZIO, "BytecodeParser only operates on a ZIO"); - assert(defs.is_luastring(name)); + lua_assert(Z instanceof lzio.ZIO, "BytecodeParser only operates on a ZIO"); + lua_assert(defs.is_luastring(name)); if (name[0] == defs.char["@"] || name[0] == defs.char["="]) this.name = name.subarray(1); @@ -279,7 +278,7 @@ const luaU_undump = function(L, Z, name) { L.stack[L.top-1].setclLvalue(cl); cl.p = new lfunc.Proto(L); S.readFunction(cl.p, null); - assert(cl.nupvalues === cl.p.upvalues.length); + lua_assert(cl.nupvalues === cl.p.upvalues.length); /* luai_verifycode */ return cl; }; |