Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Unified Diff: sdk/lib/_internal/lib/collection_patch.dart

Issue 338103004: Use metadata for patching. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/lib/async_patch.dart ('k') | sdk/lib/_internal/lib/convert_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/collection_patch.dart
diff --git a/sdk/lib/_internal/lib/collection_patch.dart b/sdk/lib/_internal/lib/collection_patch.dart
index 0c19fdbd35b35f6c5766e0439cb8b4e68ff31cf6..78147f8871f13771f89f8f311f881f7b9021a51e 100644
--- a/sdk/lib/_internal/lib/collection_patch.dart
+++ b/sdk/lib/_internal/lib/collection_patch.dart
@@ -4,12 +4,14 @@
// Patch file for dart:collection classes.
import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show fillLiteralMap, NoInline;
-
-patch class HashMap<K, V> {
- patch factory HashMap({ bool equals(K key1, K key2),
- int hashCode(K key),
- bool isValidKey(potentialKey) }) {
+import 'dart:_js_helper' show fillLiteralMap, NoInline, patch;
+
+@patch
+class HashMap<K, V> {
+ @patch
+ factory HashMap({ bool equals(K key1, K key2),
+ int hashCode(K key),
+ bool isValidKey(potentialKey) }) {
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -36,7 +38,8 @@ patch class HashMap<K, V> {
return new _CustomHashMap<K, V>(equals, hashCode, isValidKey);
}
- patch factory HashMap.identity() = _IdentityHashMap<K, V>;
+ @patch
+ factory HashMap.identity() = _IdentityHashMap<K, V>;
}
class _HashMap<K, V> implements HashMap<K, V> {
@@ -478,10 +481,12 @@ class HashMapKeyIterator<E> implements Iterator<E> {
}
}
-patch class LinkedHashMap<K, V> {
- patch factory LinkedHashMap({ bool equals(K key1, K key2),
- int hashCode(K key),
- bool isValidKey(potentialKey) }) {
+@patch
+class LinkedHashMap<K, V> {
+ @patch
+ factory LinkedHashMap({ bool equals(K key1, K key2),
+ int hashCode(K key),
+ bool isValidKey(potentialKey) }) {
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -508,7 +513,8 @@ patch class LinkedHashMap<K, V> {
return new _LinkedCustomHashMap<K, V>(equals, hashCode, isValidKey);
}
- patch factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>;
+ @patch
+ factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>;
// Private factory constructor called by generated code for map literals.
@NoInline()
@@ -959,10 +965,12 @@ class LinkedHashMapKeyIterator<E> implements Iterator<E> {
}
}
-patch class HashSet<E> {
- patch factory HashSet({ bool equals(E e1, E e2),
- int hashCode(E e),
- bool isValidKey(potentialKey) }) {
+@patch
+class HashSet<E> {
+ @patch
+ factory HashSet({ bool equals(E e1, E e2),
+ int hashCode(E e),
+ bool isValidKey(potentialKey) }) {
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -989,7 +997,8 @@ patch class HashSet<E> {
return new _CustomHashSet<E>(equals, hashCode, isValidKey);
}
- patch factory HashSet.identity() = _IdentityHashSet<E>;
+ @patch
+ factory HashSet.identity() = _IdentityHashSet<E>;
}
class _HashSet<E> extends _HashSetBase<E> implements HashSet<E> {
@@ -1361,10 +1370,12 @@ class HashSetIterator<E> implements Iterator<E> {
}
}
-patch class LinkedHashSet<E> {
- patch factory LinkedHashSet({ bool equals(E e1, E e2),
- int hashCode(E e),
- bool isValidKey(potentialKey) }) {
+@patch
+class LinkedHashSet<E> {
+ @patch
+ factory LinkedHashSet({ bool equals(E e1, E e2),
+ int hashCode(E e),
+ bool isValidKey(potentialKey) }) {
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -1391,7 +1402,8 @@ patch class LinkedHashSet<E> {
return new _LinkedCustomHashSet<E>(equals, hashCode, isValidKey);
}
- patch factory LinkedHashSet.identity() = _LinkedIdentityHashSet<E>;
+ @patch
+ factory LinkedHashSet.identity() = _LinkedIdentityHashSet<E>;
}
class _LinkedHashSet<E> extends _HashSetBase<E> implements LinkedHashSet<E> {
« no previous file with comments | « sdk/lib/_internal/lib/async_patch.dart ('k') | sdk/lib/_internal/lib/convert_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698