From bca11bfc73a7ca44daec5854f3c883911bb617ea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Oct 2022 15:42:25 +0200 Subject: 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 --- util/jsonschema.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/jsonschema.lua') 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; -- cgit v1.2.3