Ver Fonte

collections are not arrays.

Nicolas Cannasse há 18 anos atrás
pai
commit
8afe6e7a70
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 1 0
      doc/CHANGES.txt
  2. 3 2
      std/js/Dom.hx

+ 1 - 0
doc/CHANGES.txt

@@ -6,6 +6,7 @@
 	added haxe.Timer.queue, removed delayedArg (use callback instead)
 	added haxe.Timer.queue, removed delayedArg (use callback instead)
 	fixed haxe.remoting.SocketConnection (msg invertions might occur)
 	fixed haxe.remoting.SocketConnection (msg invertions might occur)
 	add uniqueness check for switch constants
 	add uniqueness check for switch constants
+	js : HtmlCollection and MetaDom.childNodes are not true Arrays
 
 
 2007-03-06: 1.12
 2007-03-06: 1.12
 	added flash lite support with -D flash_lite
 	added flash lite support with -D flash_lite

+ 3 - 2
std/js/Dom.hx

@@ -25,7 +25,8 @@
 package js;
 package js;
 
 
 // allow both indexed and dot accessses
 // allow both indexed and dot accessses
-extern class HtmlCollection<T> extends Array<T>, implements Dynamic<T> {
+extern class HtmlCollection<T> extends ArrayAccess<T>, implements Dynamic<T> {
+	var length(default,null) : Int;
 }
 }
 
 
 // the base typedef for every DOM element
 // the base typedef for every DOM element
@@ -35,7 +36,7 @@ typedef MetaDom<T> = {
 	var nodeValue : String;
 	var nodeValue : String;
 
 
 	var parentNode : T;
 	var parentNode : T;
-	var childNodes : Array<T>;
+	var childNodes : HtmlCollection<T>;
 	var firstChild : T;
 	var firstChild : T;
 	var lastChild : T;
 	var lastChild : T;
 	var nextSibling : T;
 	var nextSibling : T;