From 36eb0fca8b4ad0836c7b787f65833331746feb11 Mon Sep 17 00:00:00 2001 From: Jens Fischer Date: Mon, 15 Mar 2021 19:49:07 +0100 Subject: [PATCH] Fix Std.is() deprecation warnings with Haxe 4.2 (#101) --- hscript/Interp.hx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hscript/Interp.hx b/hscript/Interp.hx index aedd0af..27c0e51 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -22,6 +22,7 @@ package hscript; import haxe.PosInfos; import hscript.Expr; +import haxe.Constraints.IMap; private enum Stop { SBreak; @@ -484,8 +485,8 @@ class Interp { case EBinop("=>", eKey, eValue): { var key:Dynamic = expr(eKey); var value:Dynamic = expr(eValue); - isAllString = isAllString && Std.is(key, String); - isAllInt = isAllInt && Std.is(key, Int); + isAllString = isAllString && (key is String); + isAllInt = isAllInt && (key is Int); isAllObject = isAllObject && Reflect.isObject(key); isAllEnum = isAllEnum && Reflect.isEnumValue(key); keys.push(key); @@ -647,7 +648,7 @@ class Interp { } inline function isMap(o:Dynamic):Bool { - return Std.is(o, haxe.Constraints.IMap); + return (o is IMap); } inline function getMapValue(map:Dynamic, key:Dynamic):Dynamic {