# HG changeset patch # User Kim Alvefur # Date 1665322945 -7200 # Node ID ce1a0f9bf25ab7b8904e42591e8930b2408294b5 # Parent ec54fe0003d59aa98ac15b10c31650f95b4cc358 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 diff -r ec54fe0003d5 -r ce1a0f9bf25a util/jsonschema.lua --- a/util/jsonschema.lua Sun Oct 09 15:38:36 2022 +0200 +++ b/util/jsonschema.lua Sun Oct 09 15:42:25 2022 +0200 @@ -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;