diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-18 07:29:19 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-18 07:29:19 +1100 |
commit | 5152d5b95373d8065ca9fc457f69c9401413c9fa (patch) | |
tree | 0167c77e6da347ae3e83de0c3c3653055bdd1143 | |
parent | 8cf3d9fdf3be06949040735c1c9faa67a74cf770 (diff) | |
download | fengari-5152d5b95373d8065ca9fc457f69c9401413c9fa.tar.gz fengari-5152d5b95373d8065ca9fc457f69c9401413c9fa.tar.bz2 fengari-5152d5b95373d8065ca9fc457f69c9401413c9fa.zip |
src/lzio.js: Use lua_assert instead of assert
-rw-r--r-- | src/lzio.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lzio.js b/src/lzio.js index a00a24b..b9081a7 100644 --- a/src/lzio.js +++ b/src/lzio.js @@ -1,7 +1,6 @@ "use strict"; -const assert = require('assert'); - +const { lua_assert } = require("./llimits.js"); class MBuffer { constructor() { @@ -32,7 +31,7 @@ const luaZ_resizebuffer = function(L, buff, size) { class ZIO { constructor(L, reader, data) { this.L = L; /* Lua state (for reader) */ - assert(typeof reader == "function", "ZIO requires a reader"); + lua_assert(typeof reader == "function", "ZIO requires a reader"); this.reader = reader; /* reader function */ this.data = data; /* additional data */ this.n = 0; /* bytes still unread */ @@ -51,7 +50,7 @@ const luaZ_fill = function(z) { let buff = z.reader(z.L, z.data); if (buff === null) return EOZ; - assert(buff instanceof Uint8Array, "Should only load binary of array of bytes"); + lua_assert(buff instanceof Uint8Array, "Should only load binary of array of bytes"); let size = buff.length; if (size === 0) return EOZ; |