Comparison

util/format.lua @ 12589:39ae08180c81

compat: Remove handling of Lua 5.1 location of 'unpack' function
author Kim Alvefur <zash@zash.se>
date Mon, 11 Jul 2022 19:07:38 +0200
parent 12573:0f4feaf9ca64
child 12590:5eaf77114fdb
comparison
equal deleted inserted replaced
12588:b15d3cf98ba6 12589:39ae08180c81
4 -- issues like log spoofing 4 -- issues like log spoofing
5 -- 5 --
6 -- Provides some protection from e.g. CAPEC-135, CWE-117, CWE-134, CWE-93 6 -- Provides some protection from e.g. CAPEC-135, CWE-117, CWE-134, CWE-93
7 7
8 local tostring = tostring; 8 local tostring = tostring;
9 local unpack = table.unpack or unpack; -- luacheck: ignore 113/unpack 9 local unpack = table.unpack;
10 local pack = require "util.table".pack; -- TODO table.pack in 5.2+ 10 local pack = require "util.table".pack; -- TODO table.pack in 5.2+
11 local valid_utf8 = require "util.encodings".utf8.valid; 11 local valid_utf8 = require "util.encodings".utf8.valid;
12 local type = type; 12 local type = type;
13 local dump = require "util.serialization".new("debug"); 13 local dump = require "util.serialization".new("debug");
14 local num_type = math.type or function (n) 14 local num_type = math.type or function (n)