aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-10-09 15:42:25 +0200
committerKim Alvefur <zash@zash.se>2022-10-09 15:42:25 +0200
commitbca11bfc73a7ca44daec5854f3c883911bb617ea (patch)
treecb651b68358294d11ff8764f10da7a58e91c3790 /util
parent060dc120131931876b4bc8a6f312177051ad174b (diff)
downloadprosody-bca11bfc73a7ca44daec5854f3c883911bb617ea.tar.gz
prosody-bca11bfc73a7ca44daec5854f3c883911bb617ea.zip
util.jsonschema: Use same integer/float logic on Lua 5.2 and 5.3
Fixes test case type.json:0:1 covering treatment of 1.0 as an integer according to the JSON definition
Diffstat (limited to 'util')
-rw-r--r--util/jsonschema.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/jsonschema.lua b/util/jsonschema.lua
index e24fc8be..eafa8b7c 100644
--- a/util/jsonschema.lua
+++ b/util/jsonschema.lua
@@ -1,7 +1,7 @@
-- This file is generated from teal-src/util/jsonschema.lua
-local m_type = math.type or function (n)
- return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float";
+local m_type = function(n)
+ return type(n) == "number" and n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float";
end;
local json = require("util.json")
local null = json.null;