# HG changeset patch # User Kim Alvefur # Date 1444141583 -7200 # Node ID c11776f8555278d90678aa8ad25392b52b2dd0e4 # Parent f04fadabd5d9a12ede821b879af37b47298c4ce1 net.websocket.frames: Throw an error if no bit lib is found diff -r f04fadabd5d9 -r c11776f85552 net/websocket/frames.lua --- a/net/websocket/frames.lua Tue Oct 06 16:06:22 2015 +0200 +++ b/net/websocket/frames.lua Tue Oct 06 16:26:23 2015 +0200 @@ -10,8 +10,8 @@ local log = require "util.logger".init "websocket.frames"; local random_bytes = require "util.random".bytes; -local bit = softreq"bit" or softreq"bit32"; -if not bit then log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end +local bit = assert(softreq"bit" or softreq"bit32", + "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); local band = bit.band; local bor = bit.bor; local bxor = bit.bxor;