Changeset

8418:ad1e10c93b41

util.template: Use util.envload instead of loadstring which is deprecated in Lua 5.2
author Kim Alvefur <zash@zash.se>
date Thu, 23 Nov 2017 21:00:29 +0100
parents 8417:e88db5668cfb
children 8422:6eecf82ccd8e
files util/template.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/template.lua	Thu Nov 23 20:55:21 2017 +0100
+++ b/util/template.lua	Thu Nov 23 21:00:29 2017 +0100
@@ -4,7 +4,7 @@
 local pairs = pairs;
 local ipairs = ipairs;
 local error = error;
-local loadstring = loadstring;
+local envload = require "util.envload".envload;
 local debug = debug;
 local t_remove = table.remove;
 local parse_xml = require "util.xml".parse;
@@ -72,7 +72,7 @@
 		src = src.."local _"..i.."="..lookup[i]..";";
 	end
 	src = src.."return "..name..";end";
-	local f,err = loadstring(src, chunkname);
+	local f,err = envload(src, chunkname);
 	if not f then error(err); end
 	return f(setmetatable, stanza_mt);
 end