This class is meant for internal compiler use only. It provides the Haxe runtime compatibility to the host language. Do not access it directly.

Static variables

@:value({ })staticundefined:Dynamic = { }

Static methods

@:functionCode("\n\t\tif (obj instanceof haxe.lang.IHxObject)\n\t\t{\n\t\t\treturn ((haxe.lang.IHxObject) obj).__hx_invokeField(field, args);\n\t\t}\n\n\t\treturn slowCallField(obj, field, args);\n\t")staticcallField(obj:Dynamic, field:String, args:NativeArray<Dynamic>):Dynamic

@:functionCode("\n\treturn new haxe.lang.Closure(obj, field);\n\t")staticclosure(obj:Dynamic, field:String):Dynamic

@:functionCode("\n\t\t\tif (v1 == v2)\n\t\t\t\treturn 0;\n\t\t\tif (v1 == null) return -1;\n\t\t\tif (v2 == null) return 1;\n\n\t\t\tif (v1 instanceof java.lang.Number || v2 instanceof java.lang.Number)\n\t\t\t{\n\t\t\t\tjava.lang.Number v1c = (java.lang.Number) v1;\n\t\t\t\tjava.lang.Number v2c = (java.lang.Number) v2;\n\n\t\t\t\tif (v1 instanceof java.lang.Long || v2 instanceof java.lang.Long)\n\t\t\t\t{\n\t\t\t\t\tlong l1 = (v1 == null) ? 0L : v1c.longValue();\n\t\t\t\t\tlong l2 = (v2 == null) ? 0L : v2c.longValue();\n return (l1 < l2) ? -1 : (l1 > l2) ? 1 : 0;\n\t\t\t\t} else {\n\t\t\t\t\tdouble d1 = (v1 == null) ? 0.0 : v1c.doubleValue();\n\t\t\t\t\tdouble d2 = (v2 == null) ? 0.0 : v2c.doubleValue();\n\n return (d1 < d2) ? -1 : (d1 > d2) ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if it's not a number it must be a String\n\t\t\treturn ((java.lang.String) v1).compareTo((java.lang.String) v2);\n\t")staticcompare(v1:Dynamic, v2:Dynamic):Int

@:functionCode("\n\t\t\tif (v1 == v2)\n\t\t\t\treturn true;\n\t\t\tif (v1 == null || v2 == null)\n\t\t\t\treturn false;\n\n\t\t\tif (v1 instanceof java.lang.Number)\n\t\t\t{\n\t\t\t\tif (!(v2 instanceof java.lang.Number))\n\t\t\t\t\treturn false;\n\n\t\t\t\tjava.lang.Number v1c = (java.lang.Number) v1;\n\t\t\t\tjava.lang.Number v2c = (java.lang.Number) v2;\n\t\t\t\tif (v1 instanceof java.lang.Long || v2 instanceof java.lang.Long)\n\t\t\t\t\treturn v1c.longValue() == v2c.longValue();\n\t\t\t\treturn v1c.doubleValue() == v2c.doubleValue();\n\t\t\t} else if (v1 instanceof java.lang.String || v1 instanceof haxe.lang.IEquatable) { //TODO see what happens with Boolean cases\n\t\t\t\treturn v1.equals(v2);\n\t\t\t}\n\n\t\t\treturn false;\n\t")staticeq(v1:Dynamic, v2:Dynamic):Bool

@:functionCode("\n\n\t\tif (obj instanceof haxe.lang.IHxObject)\n\t\t\treturn ((haxe.lang.IHxObject) obj).__hx_getField(field, throwErrors, false, false);\n\n\t\treturn slowGetField(obj, field, throwErrors);\n\n\t")staticgetField(obj:Dynamic, field:String, throwErrors:Bool):Dynamic

@:functionCode("\n\n\t\tif (obj instanceof haxe.lang.IHxObject)\n\t\t\treturn ((haxe.lang.IHxObject) obj).__hx_getField_f(field, throwErrors, false);\n\n\t\treturn toDouble(slowGetField(obj, field, throwErrors));\n\n\t")staticgetField_f(obj:Dynamic, field:String, throwErrors:Bool):Float

@:functionCode("\n\t\tif (obj != null && obj instanceof java.lang.Number)\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t")staticisDouble(obj:Dynamic):Bool

@:overloadstaticisInt(obj:Dynamic):Bool

@:overloadstaticisInt(num:Number):Bool

staticnumToByte(num:Number):Byte

staticnumToLong(num:Number):Long

@:functionCode("\n\t\t\tif (v1 instanceof java.lang.String || v2 instanceof java.lang.String)\n\t\t\t\treturn toString(v1) + toString(v2);\n\n\t\t\tif (v1 instanceof java.lang.Number || v2 instanceof java.lang.Number)\n\t\t\t{\n\t\t\t\tjava.lang.Number v1c = (java.lang.Number) v1;\n\t\t\t\tjava.lang.Number v2c = (java.lang.Number) v2;\n\n\t\t\t\tdouble d1 = (v1 == null) ? 0.0 : v1c.doubleValue();\n\t\t\t\tdouble d2 = (v2 == null) ? 0.0 : v2c.doubleValue();\n\n\t\t\t\treturn d1 + d2;\n\t\t\t}\n\n\t\t\tthrow new java.lang.IllegalArgumentException(\"Cannot dynamically add \" + v1 + \" and \" + v2);\n\t")staticplus(v1:Dynamic, v2:Dynamic):Dynamic

@:functionCode("\n\t\tif (v1 == v2)\n\t\t\treturn true;\n\n\t\tif (v1 instanceof java.lang.String || v1 instanceof haxe.lang.IEquatable)\n\t\t{\n\t\t\treturn v1 != null && v1.equals(v2);\n\t\t} else {\n\t\t\treturn v1 == v2;\n\t\t}\n\t")staticrefEq(v1:{}, v2:{}):Bool

@:functionCode("\n\n\t\tif (obj instanceof haxe.lang.IHxObject)\n\t\t\treturn ((haxe.lang.IHxObject) obj).__hx_setField(field, value, false);\n\n\t\treturn slowSetField(obj, field, value);\n\n\t")staticsetField(obj:Dynamic, field:String, value:Dynamic):Dynamic

@:functionCode("\n\n\t\tif (obj instanceof haxe.lang.IHxObject)\n\t\t\treturn ((haxe.lang.IHxObject) obj).__hx_setField_f(field, value, false);\n\n\t\treturn toDouble(slowSetField(obj, field, value));\n\n\t")staticsetField_f(obj:Dynamic, field:String, value:Float):Float

@:functionCode("\n\t\tjava.lang.Class cl = null;\n\t\tif (obj instanceof java.lang.Class)\n\t\t{\n\t\t\tif (obj == java.lang.String.class && field.equals(\"fromCharCode\"))\n\t\t\t\treturn haxe.lang.StringExt.fromCharCode(toInt(args[0]));\n\n\t\t\tcl = (java.lang.Class) obj;\n\t\t\tobj = null;\n\t\t} else if (obj instanceof java.lang.String) {\n\t\t\treturn haxe.lang.StringRefl.handleCallField((java.lang.String) obj, field, args);\n\t\t} else {\n\t\t\tcl = obj.getClass();\n\t\t}\n\n\t\tif (args == null) args = new java.lang.Object[0];\n\n\t\tint len = args.length;\n\t\tjava.lang.Class[] cls = new java.lang.Class[len];\n\t\tjava.lang.Object[] objs = new java.lang.Object[len];\n\n\t\tjava.lang.reflect.Method[] ms = cl.getMethods();\n\t\tint msl = ms.length;\n\t\tint realMsl = 0;\n\t\tfor(int i =0; i < msl; i++)\n\t\t{\n\t\t\tif (!ms[i].getName().equals(field) || (!ms[i].isVarArgs() && ms[i].getParameterTypes().length != len))\n\t\t\t{\n\t\t\t\tms[i] = null;\n\t\t\t} else {\n\t\t\t\tms[realMsl] = ms[i];\n\t\t\t\tif (realMsl != i)\n\t\t\t\t\tms[i] = null;\n\t\t\t\trealMsl++;\n\t\t\t}\n\t\t}\n\n\t\tboolean hasNumber = false;\n\n\t\tfor (int i = 0; i < len; i++)\n\t\t{\n\t\t\tObject o = args[i];\n\t\t\tif (o == null)\n\t\t\t{\n\t\t\t\tcontinue; //can be anything\n\t\t\t}\n\t\t\tobjs[i]= o;\n\t\t\tcls[i] = o.getClass();\n\t\t\tboolean isNum = false;\n\n\t\t\tif (o instanceof java.lang.Number)\n\t\t\t{\n\t\t\t\tcls[i] = java.lang.Number.class;\n\t\t\t\tisNum = hasNumber = true;\n\t\t\t} else if (o instanceof java.lang.Boolean) {\n\t\t\t\tcls[i] = java.lang.Boolean.class;\n\t\t\t\tisNum = true;\n\t\t\t}\n\n\t\t\tmsl = realMsl;\n\t\t\trealMsl = 0;\n\n\t\t\tfor (int j = 0; j < msl; j++)\n\t\t\t{\n\t\t\t\tjava.lang.Class[] allcls = ms[j].getParameterTypes();\n\t\t\t\tif (i < allcls.length)\n\t\t\t\t{\n\t\t\t\t\tif (! ((isNum && allcls[i].isPrimitive()) || allcls[i].isAssignableFrom(cls[i])) )\n\t\t\t\t\t{\n\t\t\t\t\t\tms[j] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tms[realMsl] = ms[j];\n\t\t\t\t\t\tif (realMsl != j)\n\t\t\t\t\t\t\tms[j] = null;\n\t\t\t\t\t\trealMsl++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tjava.lang.reflect.Method found;\n\t\tif (ms.length == 0 || (found = ms[0]) == null)\n\t\t\tthrow haxe.lang.HaxeException.wrap(\"No compatible method found for: \" + field);\n\n\t\tif (hasNumber)\n\t\t{\n\t\t\tjava.lang.Class[] allcls = found.getParameterTypes();\n\n\t\t\tfor (int i = 0; i < len; i++)\n\t\t\t{\n\t\t\t\tjava.lang.Object o = objs[i];\n\t\t\t\tif (o instanceof java.lang.Number)\n\t\t\t\t{\n\t\t\t\t\tjava.lang.Class curCls = null;\n\t\t\t\t\tif (i < allcls.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurCls = allcls[i];\n\t\t\t\t\t\tif (!curCls.isAssignableFrom(o.getClass()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString name = curCls.getName();\n\t\t\t\t\t\t\tif (name.equals(\"double\") || name.equals(\"java.lang.Double\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobjs[i] = ((java.lang.Number)o).doubleValue();\n\t\t\t\t\t\t\t} else if (name.equals(\"int\") || name.equals(\"java.lang.Integer\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobjs[i] = ((java.lang.Number)o).intValue();\n\t\t\t\t\t\t\t} else if (name.equals(\"float\") || name.equals(\"java.lang.Float\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobjs[i] = ((java.lang.Number)o).floatValue();\n\t\t\t\t\t\t\t} else if (name.equals(\"byte\") || name.equals(\"java.lang.Byte\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobjs[i] = ((java.lang.Number)o).byteValue();\n\t\t\t\t\t\t\t} else if (name.equals(\"short\") || name.equals(\"java.lang.Short\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobjs[i] = ((java.lang.Number)o).shortValue();\n\t\t\t\t\t\t\t} else if (name.equals(\"long\") || name.equals(\"java.lang.Long\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobjs[i] = ((java.lang.Number)o).longValue();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} //else varargs not handled TODO\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tfound.setAccessible(true);\n\t\t\treturn found.invoke(obj, objs);\n\t\t}\n\n\t\tcatch (java.lang.reflect.InvocationTargetException e)\n\t\t{\n\t\t\tthrow haxe.lang.HaxeException.wrap(e.getCause());\n\t\t}\n\n\t\tcatch (Throwable t)\n\t\t{\n\t\t\tthrow haxe.lang.HaxeException.wrap(t);\n\t\t}\n\t")staticslowCallField(obj:Dynamic, field:String, args:NativeArray<Dynamic>):Dynamic

@:functionCode("\n\n\tif (obj == null)\n\t\tif (throwErrors)\n\t\t\tthrow new java.lang.NullPointerException(\"Cannot access field '\" + field + \"' of null.\");\n\t\telse\n\t\t\treturn null;\n\n\tjava.lang.Class cl = null;\n\ttry\n\t{\n\t\tif (obj instanceof java.lang.Class)\n\t\t{\n\t\t\tif (obj == java.lang.String.class && field.equals(\"fromCharCode\"))\n\t\t\t\treturn new haxe.lang.Closure(haxe.lang.StringExt.class, field);\n\n\t\t\tcl = (java.lang.Class) obj;\n\t\t\tobj = null;\n\t\t} else if (obj instanceof java.lang.String) {\n\t\t\treturn haxe.lang.StringRefl.handleGetField((java.lang.String) obj, field, throwErrors);\n\t\t} else {\n\t\t\tcl = obj.getClass();\n\t\t}\n\n\t\tjava.lang.reflect.Field f = cl.getField(field);\n\t\tf.setAccessible(true);\n\t\treturn f.get(obj);\n\t} catch (Throwable t)\n\t{\n\t\ttry\n\t\t{\n\t\t\tjava.lang.reflect.Method[] ms = cl.getMethods();\n\t\t\tfor (int i = 0; i < ms.length; i++)\n\t\t\t{\n\t\t\t\tif (ms[i].getName().equals(field))\n\t\t\t\t{\n\t\t\t\t\treturn new haxe.lang.Closure(obj != null ? obj : cl, field);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Throwable t2)\n\t\t{\n\n\t\t}\n\n\t\tif (throwErrors)\n\t\t\tthrow HaxeException.wrap(t);\n\n\t\treturn null;\n\t}\n\n\t")staticslowGetField(obj:Dynamic, field:String, throwErrors:Bool):Dynamic

@:functionCode("\n\t\tjava.lang.Class cl = null;\n\t\tif (o instanceof java.lang.Class)\n\t\t{\n\t\t\tif (o == java.lang.String.class)\n\t\t\t\treturn field.equals(\"fromCharCode\");\n\n\t\t\tcl = (java.lang.Class) o;\n\t\t} else if (o instanceof java.lang.String) {\n\t\t\treturn haxe.lang.StringRefl.handleGetField( (java.lang.String) o, field, false) != null;\n\t\t} else {\n\t\t\tcl = o.getClass();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tjava.lang.reflect.Field f = cl.getField(field);\n\t\t\treturn true;\n\t\t}\n\t\tcatch(Throwable t)\n\t\t{\n\t\t\tjava.lang.reflect.Method[] ms = cl.getMethods();\n\t\t\tfor (int i = 0; i < ms.length; i++)\n\t\t\t{\n\t\t\t\tif (ms[i].getName().equals(field))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t")staticslowHasField(o:Dynamic, field:String):Bool

@:functionCode("\n\t\tjava.lang.Class cl = null;\n\t\tif (obj instanceof java.lang.Class)\n\t\t{\n\t\t\tcl = (java.lang.Class) obj;\n\t\t\tobj = null;\n\t\t} else {\n\t\t\tcl = obj.getClass();\n\t\t}\n\n\t\ttry {\n\t\t\tjava.lang.reflect.Field f = cl.getField(field);\n\t\t\tf.setAccessible(true);\n\n\t\t\t//FIXME we must evaluate if field to be set receives either int or double\n\t\t\tif (isInt(value))\n\t\t\t{\n\t\t\t\tf.setInt(obj, toInt(value));\n\t\t\t} else if (isDouble(value)) {\n\t\t\t\tf.setDouble(obj, toDouble(value));\n\t\t\t} else {\n\t\t\t\tf.set(obj, value);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t\tcatch (Throwable t)\n\t\t{\n\t\t\tthrow HaxeException.wrap(t);\n\t\t}\n\t")staticslowSetField(obj:Dynamic, field:String, value:Dynamic):Dynamic

statictoBool(obj:Boolean):Bool

@:functionCode("\n\t\treturn (obj == null) ? 0.0 : ((java.lang.Number) obj).doubleValue();\n\t")statictoDouble(obj:Dynamic):Float

@:functionCode("\n\t\treturn (obj == null) ? 0 : ((java.lang.Number) obj).intValue();\n\t")statictoInt(obj:Dynamic):Int

statictoLong(obj:Dynamic):Int64

@:has_untypedstatictoString(obj:Dynamic):String

@:functionCode("\n\t\treturn v1 == v2 || (v1 != null && v1.equals(v2));\n\t")staticvalEq(v1:{}, v2:{}):Bool