Nicolas Cannasse %!s(int64=19) %!d(string=hai) anos
pai
achega
635186852e
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      std/neko/NekoArray__.hx

+ 8 - 1
std/neko/NekoArray__.hx

@@ -265,7 +265,14 @@ class NekoArray__<T> implements Array<T> {
 	}
 
 	private function __set( pos, v ) {
-		untyped this.__a[pos] = v;
+		untyped {
+			var a = this.__a;
+			if( __dollar__asize(a) <= pos ) {
+				this.__resize(pos+1);
+				a = this.__a;
+			}
+			a[pos] = v;
+		}
 	}
 
 	private function __resize(l) {