Software /
code /
prosody
Changeset
12760:ce1a0f9bf25a 0.12
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
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Oct 2022 15:42:25 +0200 |
parents | 12759:ec54fe0003d5 |
children | 12761:82915c755d90 12779:f0474d40364c |
files | util/jsonschema.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;