From 442789bad1bfaf101b5513859fffbec04aa8c153 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 18 Jan 2018 07:10:05 +1100 Subject: src/lstring.js: Use lua_assert instead of assert --- src/lstring.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/lstring.js') diff --git a/src/lstring.js b/src/lstring.js index d65fc6a..8a7e71b 100644 --- a/src/lstring.js +++ b/src/lstring.js @@ -1,8 +1,7 @@ "use strict"; -const assert = require("assert"); - const defs = require('./defs.js'); +const { lua_assert } = require("./llimits.js"); class TString { @@ -22,15 +21,15 @@ class TString { } const luaS_eqlngstr = function(a, b) { - assert(a instanceof TString); - assert(b instanceof TString); + lua_assert(a instanceof TString); + lua_assert(b instanceof TString); return a == b || defs.luastring_eq(a.realstring, b.realstring); }; /* converts strings (arrays) to a consistent map key make sure this doesn't conflict with any of the anti-collision strategies in ltable */ const luaS_hash = function(str) { - assert(defs.is_luastring(str)); + lua_assert(defs.is_luastring(str)); let len = str.length; let s = "|"; for (let i=0; i