Ver código fonte

changed the result of array-assign expression (fixed issue #429)

Nicolas Cannasse 14 anos atrás
pai
commit
505e383890
2 arquivos alterados com 3 adições e 1 exclusões
  1. 1 0
      doc/CHANGES.txt
  2. 2 1
      std/neko/_std/Array.hx

+ 1 - 0
doc/CHANGES.txt

@@ -19,6 +19,7 @@
 	flash9 : added flash.utils.RegExp
 	flash9 : added flash.utils.RegExp
 	all : changed @:build behavior, now takes/returns a var with anonymous fields
 	all : changed @:build behavior, now takes/returns a var with anonymous fields
 	all : added @:native support for enums
 	all : added @:native support for enums
+	neko : changed the result of array-assign expression (was null)
 
 
 2011-01-30: 2.07
 2011-01-30: 2.07
 	all : fixed completion support with --remap
 	all : fixed completion support with --remap

+ 2 - 1
std/neko/_std/Array.hx

@@ -247,7 +247,7 @@
 		return this.__a[pos];
 		return this.__a[pos];
 	}
 	}
 
 
-	private function __set( pos : Int, v : T ) : Void {
+	private function __set( pos : Int, v : T ) : T {
 		var a = this.__a;
 		var a = this.__a;
 		if( this.length <= pos ) {
 		if( this.length <= pos ) {
 			var l = pos + 1;
 			var l = pos + 1;
@@ -259,6 +259,7 @@
 			this.length = l;
 			this.length = l;
 		}
 		}
 		a[pos] = v;
 		a[pos] = v;
+		return v;
 	}
 	}
 
 
 	private function __double(l:Int) : Void {
 	private function __double(l:Int) : Void {