Browse Source

[js] optimize DynamicAccess.set (see #3517)

Dan Korostelev 10 years ago
parent
commit
a8669b7ac9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      std/haxe/DynamicAccess.hx

+ 4 - 0
std/haxe/DynamicAccess.hx

@@ -63,8 +63,12 @@ abstract DynamicAccess<T>(Dynamic<T>) from Dynamic<T> to Dynamic<T> {
 	**/
 	@:arrayAccess
 	public inline function set(key:String, value:T):T {
+		#if js
+		return untyped this[key] = value;
+		#else
 		Reflect.setField(this, key, value);
 		return value;
+		#end
 	}
 
 	/**