Diff

util/serialization.lua @ 12802:4a8740e01813

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 12 Dec 2022 07:10:54 +0100
parent 12782:8815d3090928
child 12975:d10957394a3c
line wrap: on
line diff
--- a/util/serialization.lua	Mon Dec 12 20:40:23 2022 +0100
+++ b/util/serialization.lua	Mon Dec 12 07:10:54 2022 +0100
@@ -21,10 +21,12 @@
 local pcall = pcall;
 local envload = require"util.envload".envload;
 
+if not math.type then
+	require "util.mathcompat"
+end
+
 local pos_inf, neg_inf = math.huge, -math.huge;
-local m_type = math.type or function (n)
-	return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float";
-end;
+local m_type = math.type;
 
 local function rawpairs(t)
 	return next, t, nil;