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

Side by Side Diff: dart/lib/compiler/implementation/lib/constant_map.dart

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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;
6
7 // This class has no constructor. This is on purpose since the instantiation 5 // This class has no constructor. This is on purpose since the instantiation
8 // is shortcut by the compiler. 6 // is shortcut by the compiler.
9 class ConstantMap<V> implements Map<String, V> { 7 class ConstantMap<V> implements Map<String, V> {
10 final int length; 8 final int length;
11 // A constant map is backed by a JavaScript object. 9 // A constant map is backed by a JavaScript object.
12 final _jsObject; 10 final _jsObject;
13 final List<String> _keys; 11 final List<String> _keys;
14 12
15 bool containsValue(V needle) { 13 bool containsValue(V needle) {
16 return getValues().some((V value) => value == needle); 14 return getValues().some((V value) => value == needle);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 bool containsKey(String key) { 57 bool containsKey(String key) {
60 if (key == '__proto__') return true; 58 if (key == '__proto__') return true;
61 return super.containsKey(key); 59 return super.containsKey(key);
62 } 60 }
63 61
64 V operator [](String key) { 62 V operator [](String key) {
65 if (key == '__proto__') return _protoValue; 63 if (key == '__proto__') return _protoValue;
66 return super[key]; 64 return super[key];
67 } 65 }
68 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698