summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lzio.js7
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;