From 57ca73475ca54397084e8295598a704572fc01a2 Mon Sep 17 00:00:00 2001 From: rxi Date: Tue, 15 Apr 2014 12:42:54 +0100 Subject: [PATCH] Moved local loadstring -> lovebird.loadstring --- lovebird.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lovebird.lua b/lovebird.lua index 58672cf..56ce005 100644 --- a/lovebird.lua +++ b/lovebird.lua @@ -11,6 +11,7 @@ local socket = require "socket" local lovebird = { _version = "0.1.0" } +lovebird.loadstring = loadstring or load lovebird.inited = false lovebird.host = "*" lovebird.buffer = "" @@ -25,12 +26,14 @@ lovebird.whitelist = { "127.0.0.1", "192.168.*.*" } lovebird.maxlines = 200 lovebird.updateinterval = .5 + lovebird.pages["index"] = [[ @@ -361,8 +364,6 @@ lovebird.pages["env.json"] = [[ ]] -local loadstring = loadstring or load - function lovebird.init() -- Init server @@ -391,7 +392,7 @@ function lovebird.template(str, params, chunkname) local f = function(x) return string.format(" echo(%q)", x) end str = ("?>"..str.."(.-)<%?lua", f) str = "local echo " .. params .. " = ..." .. str - local fn = assert(loadstring(str, chunkname)) + local fn = assert(lovebird.loadstring(str, chunkname)) return function(...) local output = {} local echo = function(str) table.insert(output, str) end