소스 검색

removed Map array access

Nicolas Cannasse 12 년 전
부모
커밋
781844b758
2개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 6
      std/Map.hx
  2. 3 1
      tests/unit/unitstd/Map.unit.hx

+ 1 - 6
std/Map.hx

@@ -79,7 +79,7 @@ abstract Map< K, V > (IMap< K, V > ) {
 		
 		If [key] is null, the result is unspecified.
 	**/
-	@:arrayAccess public inline function get(key:K) return this.get(key);
+	public inline function get(key:K) return this.get(key);
 	
 	/**
 		Returns true if [key] has a mapping, false otherwise.
@@ -114,11 +114,6 @@ abstract Map< K, V > (IMap< K, V > ) {
 		return this.iterator();
 	}
 	
-	@:arrayAccess @:noCompletion public inline function arrayWrite(k:K, v:V):V {
-		this.set(k, v);
-		return v;
-	}
-	
 	@:to static inline function toStringMap(t:IMap < String, V > ):StringMap<V> {
 		return new StringMap<V>();
 	}

+ 3 - 1
tests/unit/unitstd/Map.unit.hx

@@ -139,6 +139,7 @@ map.exists(c) == true;
 map.get(b) == null;
 
 // [] access
+/*
 var map = new Map();
 map["foo"] == null;
 map["foo"] = 12;
@@ -153,4 +154,5 @@ map["f" + "o" + "o"] -= 223;
 map[(function(s) return s + "o")("fo")] == 1;
 map["bar"] = map["foo"] = 9;
 map["bar"] == 9;
-map["foo"] == 9;
+map["foo"] == 9;
+*/