浏览代码

[java] various fixes for Unit Tests

Caue Waneck 13 年之前
父节点
当前提交
a7e7a89800

+ 65 - 7
gencommon.ml

@@ -4069,12 +4069,70 @@ struct
     in
     in
     loop 
     loop 
   
   
+  let follow_dyn t = match follow t with
+    | TMono _ | TLazy _ -> t_dynamic
+    | t -> t
+  
+  let rec type_eq gen param a b =
+    if a == b then
+      ()
+    else match follow_dyn (gen.greal_type a) , follow_dyn (gen.greal_type b) with
+    | TEnum (e1,tl1) , TEnum (e2,tl2) ->
+      if e1 != e2 && not (param = EqCoreType && e1.e_path = e2.e_path) then Type.error [cannot_unify a b];
+      List.iter2 (type_eq gen param) tl1 tl2
+    | TInst (c1,tl1) , TInst (c2,tl2) ->
+      if c1 != c2 && not (param = EqCoreType && c1.cl_path = c2.cl_path) && (match c1.cl_kind, c2.cl_kind with KExpr _, KExpr _ -> false | _ -> true) then Type.error [cannot_unify a b];
+      List.iter2 (type_eq gen param) tl1 tl2
+    | TFun (l1,r1) , TFun (l2,r2) when List.length l1 = List.length l2 ->
+      (try
+        type_eq gen param r1 r2;
+        List.iter2 (fun (n,o1,t1) (_,o2,t2) ->
+          if o1 <> o2 then Type.error [Not_matching_optional n];
+          type_eq gen param t1 t2
+        ) l1 l2
+      with
+        Unify_error l -> Type.error (cannot_unify a b :: l))
+    | TDynamic a , TDynamic b ->
+      type_eq gen param a b
+    | TAnon a1, TAnon a2 ->
+      (try
+        PMap.iter (fun n f1 ->
+          try
+            let f2 = PMap.find n a2.a_fields in
+            if f1.cf_kind <> f2.cf_kind && (param = EqStrict || param = EqCoreType || not (unify_kind f1.cf_kind f2.cf_kind)) then Type.error [invalid_kind n f1.cf_kind f2.cf_kind];
+            try
+              type_eq gen param f1.cf_type f2.cf_type
+            with
+              Unify_error l -> Type.error (invalid_field n :: l)
+          with
+            Not_found ->
+              if is_closed a2 then Type.error [has_no_field b n];
+              if not (link (ref None) b f1.cf_type) then Type.error [cannot_unify a b];
+              a2.a_fields <- PMap.add n f1 a2.a_fields
+        ) a1.a_fields;
+        PMap.iter (fun n f2 ->
+          if not (PMap.mem n a1.a_fields) then begin
+            if is_closed a1 then Type.error [has_no_field a n];
+            if not (link (ref None) a f2.cf_type) then Type.error [cannot_unify a b];
+            a1.a_fields <- PMap.add n f2 a1.a_fields
+          end;
+        ) a2.a_fields;
+      with
+        Unify_error l -> Type.error (cannot_unify a b :: l))
+    | _ , _ ->
+      if b == t_dynamic && (param = EqRightDynamic || param = EqBothDynamic) then
+        ()
+      else if a == t_dynamic && param = EqBothDynamic then
+        ()
+      else
+        Type.error [cannot_unify a b]
+  
   (* Helpers for cast handling *)
   (* Helpers for cast handling *)
   (* will return true if 'super' is a superclass of 'cl' or if cl implements super or if they are the same class *)
   (* will return true if 'super' is a superclass of 'cl' or if cl implements super or if they are the same class *)
   let can_be_converted gen cl tl super_t super_tl = 
   let can_be_converted gen cl tl super_t super_tl = 
     map_cls gen (gen.guse_tp_constraints || (not (cl.cl_kind = KTypeParameter || super_t.cl_kind = KTypeParameter))) (fun _ tl ->
     map_cls gen (gen.guse_tp_constraints || (not (cl.cl_kind = KTypeParameter || super_t.cl_kind = KTypeParameter))) (fun _ tl ->
       try
       try
-        List.iter2 (type_eq (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) tl super_tl;
+        List.iter2 (type_eq gen (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) tl super_tl;
         true
         true
       with | Unify_error _ -> false
       with | Unify_error _ -> false
     ) super_t cl tl
     ) super_t cl tl
@@ -4173,7 +4231,7 @@ struct
         ignore (map_cls gen (gen.guse_tp_constraints || (not (cl_from.cl_kind = KTypeParameter || cl_to.cl_kind = KTypeParameter))) (fun _ tl ->
         ignore (map_cls gen (gen.guse_tp_constraints || (not (cl_from.cl_kind = KTypeParameter || cl_to.cl_kind = KTypeParameter))) (fun _ tl ->
           try
           try
             (* type found, checking type parameters *)
             (* type found, checking type parameters *)
-            List.iter2 (type_eq EqStrict) tl params_to;
+            List.iter2 (type_eq gen EqStrict) tl params_to;
             ret := Some e;
             ret := Some e;
             true
             true
           with | Unify_error _ -> 
           with | Unify_error _ -> 
@@ -4190,7 +4248,7 @@ struct
                 if not, we're going to check if we only need a simple cast, or if we need to first cast into the dynamic version of it
                 if not, we're going to check if we only need a simple cast, or if we need to first cast into the dynamic version of it
               *)
               *)
               try
               try
-                List.iter2 (type_eq EqRightDynamic) tl params_to;
+                List.iter2 (type_eq gen EqRightDynamic) tl params_to;
                 ret := Some (mk_cast to_t e);
                 ret := Some (mk_cast to_t e);
                 true
                 true
               with | Unify_error _ ->
               with | Unify_error _ ->
@@ -4225,7 +4283,7 @@ struct
           (do_unsafe_cast ())
           (do_unsafe_cast ())
       | TEnum(e_to, params_to), TEnum(e_from, params_from) when e_to.e_path = e_from.e_path ->
       | TEnum(e_to, params_to), TEnum(e_from, params_from) when e_to.e_path = e_from.e_path ->
         (try
         (try
-            List.iter2 (type_eq (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) params_from params_to;
+            List.iter2 (type_eq gen (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) params_from params_to;
             e
             e
           with 
           with 
             | Unify_error _ -> do_unsafe_cast ()
             | Unify_error _ -> do_unsafe_cast ()
@@ -4235,7 +4293,7 @@ struct
         (* this is here for max compatibility with EnumsToClass module *)
         (* this is here for max compatibility with EnumsToClass module *)
         if en.e_path = cl.cl_path && en.e_extern then begin
         if en.e_path = cl.cl_path && en.e_extern then begin
           (try
           (try
-            List.iter2 (type_eq (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) params_from params_to;
+            List.iter2 (type_eq gen (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) params_from params_to;
             e
             e
           with 
           with 
             | Invalid_argument("List.iter2") ->
             | Invalid_argument("List.iter2") ->
@@ -4252,7 +4310,7 @@ struct
       | TType(t_to, params_to), TType(t_from, params_from) when t_to == t_from ->
       | TType(t_to, params_to), TType(t_from, params_from) when t_to == t_from ->
         if gen.gspecial_needs_cast real_to_t real_from_t then
         if gen.gspecial_needs_cast real_to_t real_from_t then
           (try
           (try
-            List.iter2 (type_eq (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) params_from params_to;
+            List.iter2 (type_eq gen (if gen.gallow_tp_dynamic_conversion then EqRightDynamic else EqStrict)) params_from params_to;
             e
             e
           with 
           with 
             | Unify_error _ -> do_unsafe_cast ()
             | Unify_error _ -> do_unsafe_cast ()
@@ -4297,7 +4355,7 @@ struct
         mk_cast to_t e
         mk_cast to_t e
       | TFun(args, ret), TFun(args2, ret2) ->
       | TFun(args, ret), TFun(args2, ret2) ->
         let get_args = List.map (fun (_,_,t) -> t) in
         let get_args = List.map (fun (_,_,t) -> t) in
-        (try List.iter2 (type_eq (EqBothDynamic)) (ret :: get_args args) (ret2 :: get_args args2); e with | Unify_error _ | Invalid_argument("List.iter2") -> mk_cast to_t e)
+        (try List.iter2 (type_eq gen (EqBothDynamic)) (ret :: get_args args) (ret2 :: get_args args2); e with | Unify_error _ | Invalid_argument("List.iter2") -> mk_cast to_t e)
       | _, _ ->
       | _, _ ->
         do_unsafe_cast ()
         do_unsafe_cast ()
   
   

文件差异内容过多而无法显示
+ 0 - 0
std/cs/_std/Array.hx


+ 1 - 0
std/cs/_std/Hash.hx

@@ -73,6 +73,7 @@
 				valuesArr.splice(i, 1);
 				valuesArr.splice(i, 1);
 				return true;
 				return true;
 			}
 			}
+			i++;
 		}
 		}
 		return false;
 		return false;
 	}
 	}

+ 1 - 0
std/cs/_std/IntHash.hx

@@ -73,6 +73,7 @@
 				valuesArr.splice(i, 1);
 				valuesArr.splice(i, 1);
 				return true;
 				return true;
 			}
 			}
+			i++;
 		}
 		}
 		return false;
 		return false;
 	}
 	}

+ 345 - 0
std/cs/_std/Xml.hx

@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2005, The haXe Project Contributors
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE HAXE PROJECT CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE HAXE PROJECT CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+enum XmlType {
+	Element;
+	PCData;
+	CData;
+	Comment;
+	DocType;
+	Prolog;
+	Document;
+}
+
+@:core_api class Xml {
+
+	public static var Element(default,null) : XmlType;
+	public static var PCData(default,null) : XmlType;
+	public static var CData(default,null) : XmlType;
+	public static var Comment(default,null) : XmlType;
+	public static var DocType(default,null) : XmlType;
+	public static var Prolog(default,null) : XmlType;
+	public static var Document(default,null) : XmlType;
+
+	public var nodeType(default,null) : XmlType;
+	public var nodeName(getNodeName,setNodeName) : String;
+	public var nodeValue(getNodeValue,setNodeValue) : String;
+	public var parent(getParent,null) : Xml;
+
+	var _nodeName : String;
+	var _nodeValue : String;
+	var _attributes : Hash<String>;
+	var _children : Array<Xml>;
+	var _parent : Xml;
+
+	public static function parse( str : String ) : Xml {
+		return haxe.xml.Parser.parse(str);
+	}
+
+	private function new() : Void {
+	}
+
+	public static function createElement( name : String ) : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.Element;
+		r._children = new Array();
+		r._attributes = new Hash();
+		r.setNodeName( name );
+		return r;
+	}
+
+	public static function createPCData( data : String ) : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.PCData;
+		r.setNodeValue( data );
+		return r;
+	}
+
+	public static function createCData( data : String ) : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.CData;
+		r.setNodeValue( data );
+		return r;
+	}
+
+	public static function createComment( data : String ) : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.Comment;
+		r.setNodeValue( data );
+		return r;
+	}
+
+	public static function createDocType( data : String ) : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.DocType;
+		r.setNodeValue( data );
+		return r;
+	}
+
+	public static function createProlog( data : String ) : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.Prolog;
+		r.setNodeValue( data );
+		return r;
+	}
+
+	public static function createDocument() : Xml {
+		var r = new Xml();
+		r.nodeType = Xml.Document;
+		r._children = new Array();
+		return r;
+	}
+
+	private function getNodeName() : String {
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		return _nodeName;
+	}
+
+	private function setNodeName( n : String ) : String {
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		return _nodeName = n;
+	}
+
+	private function getNodeValue() : String {
+		if( nodeType == Xml.Element || nodeType == Xml.Document )
+			throw "bad nodeType";
+		return _nodeValue;
+	}
+
+	private function setNodeValue( v : String ) : String {
+		if( nodeType == Xml.Element || nodeType == Xml.Document )
+			throw "bad nodeType";
+		return _nodeValue = v;
+	}
+
+	private function getParent() : Xml {
+		return _parent;
+	}
+
+	public function get( att : String ) : String {
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		return _attributes.get( att );
+	}
+
+	public function set( att : String, value : String ) : Void {
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		_attributes.set( att, value );
+	}
+
+	public function remove( att : String ) : Void{
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		_attributes.remove( att );
+	}
+
+	public function exists( att : String ) : Bool {
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		return _attributes.exists( att );
+	}
+
+	public function attributes() : Iterator<String> {
+		if( nodeType != Xml.Element )
+			throw "bad nodeType";
+		return _attributes.keys();
+	}
+
+	public function iterator() : Iterator<Xml> {
+		if ( _children == null ) throw "bad nodetype";
+		var cur = 0;
+		var x = this._children;
+		return {
+			hasNext : function(){
+				return cur < x.length;
+			},
+			next : function(){
+				return x[cur++];
+			}
+		}
+	}
+
+	public function elements() : Iterator<Xml> {
+		if ( _children == null ) throw "bad nodetype";
+		var cur = 0;
+		var x = _children;
+		return untyped {
+			hasNext : function() {
+				var k = cur;
+				var l = x.length;
+				while( k < l ) {
+					if( x[k].nodeType == Xml.Element )
+						break;
+					k += 1;
+				}
+				cur = k;
+				return k < l;
+			},
+			next : function() {
+				var k = cur;
+				var l = x.length;
+				while( k < l ) {
+					var n = x[k];
+					k += 1;
+					if( n.nodeType == Xml.Element ) {
+						cur = k;
+						return n;
+					}
+				}
+				return null;
+			}
+		}
+	}
+
+	public function elementsNamed( name : String ) : Iterator<Xml> {
+		if ( _children == null ) throw "bad nodetype";
+		var x = _children;
+		var cur = 0;
+		return untyped {
+			cur: 0,
+			x: this._children,
+			hasNext : function() {
+				var k = cur;
+				var l = x.length;
+				while( k < l ) {
+					var n = x[k];
+					if( n.nodeType == Xml.Element && n._nodeName == name )
+						break;
+					k++;
+				}
+				cur = k;
+				return k < l;
+			},
+			next : function() {
+				var k = cur;
+				var l = x.length;
+				while( k < l ) {
+					var n = x[k];
+					k++;
+					if( n.nodeType == Xml.Element && n._nodeName == name ) {
+						cur = k;
+						return n;
+					}
+				}
+				return null;
+			}
+		}
+	}
+
+	public function firstChild() : Xml {
+		if( _children == null ) throw "bad nodetype";
+		return _children[0];
+	}
+
+	public function firstElement() : Xml {
+		if( _children == null ) throw "bad nodetype";
+		var cur = 0;
+		var l = _children.length;
+		while( cur < l ) {
+			var n = _children[cur];
+			if( n.nodeType == Xml.Element )
+				return n;
+			cur++;
+		}
+		return null;
+	}
+
+	public function addChild( x : Xml ) : Void {
+		if( _children == null ) throw "bad nodetype";
+		if( x._parent != null ) x._parent._children.remove(x);
+		x._parent = this;
+		_children.push( x );
+	}
+
+	public function removeChild( x : Xml ) : Bool {
+		if( _children == null ) throw "bad nodetype";
+		var b = _children.remove( x );
+		if( b )
+			x._parent = null;
+		return b;
+	}
+
+	public function insertChild( x : Xml, pos : Int ) : Void {
+		if( _children == null ) throw "bad nodetype";
+		if( x._parent != null ) x._parent._children.remove(x);
+		x._parent = this;
+		_children.insert( pos, x );
+	}
+
+	public function toString() : String {
+		if( nodeType == Xml.PCData )
+			return _nodeValue;
+		if( nodeType == Xml.CData )
+			return "<![CDATA["+_nodeValue+"]]>";
+		if( nodeType == Xml.Comment )
+			return "<!--"+_nodeValue+"-->";
+		if( nodeType == Xml.DocType )
+			return "<!DOCTYPE "+_nodeValue+">";
+		if( nodeType == Xml.Prolog )
+			return "<?"+_nodeValue+"?>";
+		var s = new StringBuf();
+
+		if( nodeType == Xml.Element ) {
+			s.add("<");
+			s.add(_nodeName);
+			for( k in _attributes.keys() ){
+				s.add(" ");
+				s.add(k);
+				s.add("=\"");
+				s.add(_attributes.get(k));
+				s.add("\"");
+			}
+			if( _children.length == 0 ) {
+				s.add("/>");
+				return s.toString();
+			}
+			s.add(">");
+		}
+
+		for( x in iterator() )
+			s.add(x.toString());
+
+		if( nodeType == Xml.Element ) {
+			s.add("</");
+			s.add(_nodeName);
+			s.add(">");
+		}
+		return s.toString();
+	}
+
+	static function __init__() : Void untyped {
+		Xml.Element = XmlType.Element;
+		Xml.PCData = XmlType.PCData;
+		Xml.CData = XmlType.CData;
+		Xml.Comment = XmlType.Comment;
+		Xml.DocType = XmlType.DocType;
+		Xml.Prolog = XmlType.Prolog;
+		Xml.Document = XmlType.Document;
+	}
+
+}

文件差异内容过多而无法显示
+ 0 - 0
std/java/_std/Array.hx


+ 1 - 0
std/java/_std/Hash.hx

@@ -73,6 +73,7 @@
 				valuesArr.splice(i, 1);
 				valuesArr.splice(i, 1);
 				return true;
 				return true;
 			}
 			}
+			i++;
 		}
 		}
 		return false;
 		return false;
 	}
 	}

+ 1 - 0
std/java/_std/IntHash.hx

@@ -73,6 +73,7 @@
 				valuesArr.splice(i, 1);
 				valuesArr.splice(i, 1);
 				return true;
 				return true;
 			}
 			}
+			i++;
 		}
 		}
 		return false;
 		return false;
 	}
 	}

+ 14 - 9
std/java/_std/Type.hx

@@ -92,7 +92,9 @@ enum ValueType {
 		var ret:String = e.getName();
 		var ret:String = e.getName();
 		if (ret.startsWith("haxe.root."))
 		if (ret.startsWith("haxe.root."))
 			return ret.substr(10);
 			return ret.substr(10);
-			
+		else if (ret == "boolean" || ret == "java.lang.Boolean")
+			return "Bool";
+		
 		return ret;
 		return ret;
 	}
 	}
 
 
@@ -104,6 +106,11 @@ enum ValueType {
 		}
 		}
 		catch (java.lang.ClassNotFoundException e)
 		catch (java.lang.ClassNotFoundException e)
 		{
 		{
+			if (name.equals("haxe.root.Int")) return int.class;
+			else if (name.equals("haxe.root.Float")) return double.class;
+			else if (name.equals("haxe.root.String")) return java.lang.String.class;
+			else if (name.equals("haxe.root.Math")) return java.lang.Math.class;
+			else if (name.equals("haxe.root.Class")) return java.lang.Class.class;
 			return null;
 			return null;
 		}
 		}
 	')
 	')
@@ -115,6 +122,7 @@ enum ValueType {
 
 
 	public static function resolveEnum( name : String ) : Enum<Dynamic> untyped 
 	public static function resolveEnum( name : String ) : Enum<Dynamic> untyped 
 	{
 	{
+		if (name.equals("Bool")) return Bool;
 		return resolveClass(name);
 		return resolveClass(name);
 	}
 	}
 
 
@@ -126,7 +134,6 @@ enum ValueType {
 			
 			
 			java.lang.reflect.Constructor[] ms = cl.getConstructors();
 			java.lang.reflect.Constructor[] ms = cl.getConstructors();
 			int msl = ms.length;
 			int msl = ms.length;
-			int lstRes = 0;
 			int realMsl = 0;
 			int realMsl = 0;
 			for(int i =0; i < msl; i++)
 			for(int i =0; i < msl; i++)
 			{
 			{
@@ -134,10 +141,9 @@ enum ValueType {
 				{
 				{
 					ms[i] = null;
 					ms[i] = null;
 				} else {
 				} else {
-					ms[lstRes] = ms[i];
-					if (lstRes != i)
+					ms[realMsl] = ms[i];
+					if (realMsl != i)
 						ms[i] = null;
 						ms[i] = null;
-					lstRes++;
 					realMsl++;
 					realMsl++;
 				}
 				}
 			}
 			}
@@ -152,8 +158,8 @@ enum ValueType {
 				
 				
 				if (!(o instanceof java.lang.Number))
 				if (!(o instanceof java.lang.Number))
 				{
 				{
-					lstRes = 0;
 					msl = realMsl;
 					msl = realMsl;
+					realMsl = 0;
 					
 					
 					for (int j = 0; j < msl; j++)
 					for (int j = 0; j < msl; j++)
 					{
 					{
@@ -164,10 +170,9 @@ enum ValueType {
 							{
 							{
 								ms[j] = null;
 								ms[j] = null;
 							} else {
 							} else {
-								ms[lstRes] = ms[j];
-								if (lstRes != j)
+								ms[realMsl] = ms[j];
+								if (realMsl != j)
 									ms[j] = null;
 									ms[j] = null;
-								lstRes++;
 								realMsl++;
 								realMsl++;
 							}
 							}
 						}
 						}

文件差异内容过多而无法显示
+ 0 - 0
std/java/_std/haxe/lang/HxObject.hx


+ 5 - 8
std/java/_std/haxe/lang/Runtime.hx

@@ -344,7 +344,6 @@ package haxe.lang;
 			
 			
 			java.lang.reflect.Method[] ms = cl.getDeclaredMethods();
 			java.lang.reflect.Method[] ms = cl.getDeclaredMethods();
 			int msl = ms.length;
 			int msl = ms.length;
-			int lstRes = 0;
 			int realMsl = 0;
 			int realMsl = 0;
 			for(int i =0; i < msl; i++)
 			for(int i =0; i < msl; i++)
 			{
 			{
@@ -352,10 +351,9 @@ package haxe.lang;
 				{
 				{
 					ms[i] = null;
 					ms[i] = null;
 				} else {
 				} else {
-					ms[lstRes] = ms[i];
-					if (lstRes != i)
+					ms[realMsl] = ms[i];
+					if (realMsl != i)
 						ms[i] = null;
 						ms[i] = null;
-					lstRes = i + 1;
 					realMsl++;
 					realMsl++;
 				}
 				}
 			}
 			}
@@ -370,8 +368,8 @@ package haxe.lang;
 				
 				
 				if (!(o instanceof java.lang.Number))
 				if (!(o instanceof java.lang.Number))
 				{
 				{
-					lstRes = 0;
 					msl = realMsl;
 					msl = realMsl;
+					realMsl = 0;
 					
 					
 					for (int j = 0; j < msl; j++)
 					for (int j = 0; j < msl; j++)
 					{
 					{
@@ -382,10 +380,9 @@ package haxe.lang;
 							{
 							{
 								ms[j] = null;
 								ms[j] = null;
 							} else {
 							} else {
-								ms[lstRes] = ms[j];
-								if (lstRes != j)
+								ms[realMsl] = ms[j];
+								if (realMsl != j)
 									ms[j] = null;
 									ms[j] = null;
-								lstRes = j + 1;
 								realMsl++;
 								realMsl++;
 							}
 							}
 						}
 						}

部分文件因为文件数量过多而无法显示