2
0
Nicolas Cannasse 19 жил өмнө
parent
commit
635186852e

+ 8 - 1
std/neko/NekoArray__.hx

@@ -265,7 +265,14 @@ class NekoArray__<T> implements Array<T> {
 	}
 	}
 
 
 	private function __set( pos, v ) {
 	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) {
 	private function __resize(l) {