From c3ae4f295fd69aad149e495eaf975f47417dac65 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Thu, 10 Sep 2020 00:26:58 +0200 Subject: #strict 3 fixes --- DTUtility.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'DTUtility.c') diff --git a/DTUtility.c b/DTUtility.c index 5d09614..752000b 100644 --- a/DTUtility.c +++ b/DTUtility.c @@ -1,4 +1,4 @@ -#strict 2 +#strict 3 global func Isolate(object obj) // Puts the object in its own layer to prevent interaction { @@ -19,6 +19,7 @@ global func GetIndexOf2(val, array arr) // Because GetIndexOf doesn't find Forma global func Serialize(value) { + if(value == nil) return "nil"; if(GetType(value) == C4V_Map) { var nonIdentifierKeyInits = []; @@ -79,7 +80,7 @@ global func Serialize(value) else if(GetType(value) == C4V_Bool) if(value) return "true"; else return "false"; else if(GetType(value) == C4V_C4ID) return Format("%i", value); else if(GetType(value) == C4V_C4Object) return Format("Object(%d)", ObjectNumber(value)); - else if(GetType(value) == C4V_Int || GetType(value) == C4V_Any) return Format("%d", value); + else if(GetType(value) == C4V_Int) return Format("%d", value); else if(GetType(value) == C4V_String) return Format("\"%s\"", EscapeString(value)); } -- cgit v1.2.3-54-g00ecf