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

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/constant_map.dart

Issue 1025573005: Move implementation from IterableBase to Iterable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove extra "static" on helper functions. Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of _js_helper; 5 part of _js_helper;
6 6
7 abstract class ConstantMap<K, V> implements Map<K, V> { 7 abstract class ConstantMap<K, V> implements Map<K, V> {
8 const ConstantMap._(); 8 const ConstantMap._();
9 9
10 bool get isEmpty => length == 0; 10 bool get isEmpty => length == 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 bool containsKey(Object key) { 85 bool containsKey(Object key) {
86 if (key is! String) return false; 86 if (key is! String) return false;
87 if ('__proto__' == key) return true; 87 if ('__proto__' == key) return true;
88 return jsHasOwnProperty(_jsObject, key); 88 return jsHasOwnProperty(_jsObject, key);
89 } 89 }
90 90
91 _fetch(key) => 91 _fetch(key) =>
92 '__proto__' == key ? _protoValue : jsPropertyAccess(_jsObject, key); 92 '__proto__' == key ? _protoValue : jsPropertyAccess(_jsObject, key);
93 } 93 }
94 94
95 class _ConstantMapKeyIterable<K> extends IterableBase<K> { 95 class _ConstantMapKeyIterable<K> extends Iterable<K> {
96 ConstantStringMap<K, dynamic> _map; 96 ConstantStringMap<K, dynamic> _map;
97 _ConstantMapKeyIterable(this._map); 97 _ConstantMapKeyIterable(this._map);
98 98
99 Iterator<K> get iterator => _map._keys.iterator; 99 Iterator<K> get iterator => _map._keys.iterator;
100 100
101 int get length => _map._keys.length; 101 int get length => _map._keys.length;
102 } 102 }
103 103
104 class GeneralConstantMap<K, V> extends ConstantMap<K, V> { 104 class GeneralConstantMap<K, V> extends ConstantMap<K, V> {
105 // This constructor is not used. The instantiation is shortcut by the 105 // This constructor is not used. The instantiation is shortcut by the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 Iterable<K> get keys { 140 Iterable<K> get keys {
141 return _getMap().keys; 141 return _getMap().keys;
142 } 142 }
143 143
144 Iterable<V> get values { 144 Iterable<V> get values {
145 return _getMap().values; 145 return _getMap().values;
146 } 146 }
147 147
148 int get length => _getMap().length; 148 int get length => _getMap().length;
149 } 149 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/collection_patch.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698