From 5152d5b95373d8065ca9fc457f69c9401413c9fa Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 18 Jan 2018 07:29:19 +1100 Subject: src/lzio.js: Use lua_assert instead of assert --- src/lzio.js | 7 +++---- 1 file 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; -- cgit v1.2.3-70-g09d2