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

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

Issue 156813002: Cleaning up warnings from the analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « no previous file | sdk/lib/_internal/lib/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/constant_map.dart
diff --git a/sdk/lib/_internal/lib/constant_map.dart b/sdk/lib/_internal/lib/constant_map.dart
index 398d37cf339db2f1e8d8035d6f7d6c5a569b1996..388fe20c7b85d35f33effd0b8a8bba32b3da82e8 100644
--- a/sdk/lib/_internal/lib/constant_map.dart
+++ b/sdk/lib/_internal/lib/constant_map.dart
@@ -5,6 +5,8 @@
part of _js_helper;
abstract class ConstantMap<K, V> implements Map<K, V> {
+ const ConstantMap._();
+
bool get isEmpty => length == 0;
bool get isNotEmpty => !isEmpty;
@@ -21,10 +23,13 @@ abstract class ConstantMap<K, V> implements Map<K, V> {
void addAll(Map<K, V> other) => _throwUnmodifiable();
}
-// This class has no constructor. This is on purpose since the instantiation
-// is shortcut by the compiler.
class ConstantStringMap<K, V> extends ConstantMap<K, V>
implements _symbol_dev.EfficientLength {
+
+ // This constructor is not used. The instantiation is shortcut by the
+ // compiler. It is here to make the uninitialized final fields legal.
+ const ConstantStringMap._(this.length, this._jsObject, _keys);
+
final int length;
// A constant map is backed by a JavaScript object.
final _jsObject;
@@ -62,6 +67,10 @@ class ConstantStringMap<K, V> extends ConstantMap<K, V>
// This class has no constructor. This is on purpose since the instantiation
// is shortcut by the compiler.
class ConstantProtoMap<K, V> extends ConstantStringMap<K, V> {
+ // This constructor is not used. The instantiation is shortcut by the
+ // compiler. It is here to make the uninitialized final fields legal.
+ ConstantProtoMap._(length, jsObject, keys) : super._(length, jsObject, keys);
+
final V _protoValue;
bool containsKey(Object key) {
@@ -82,9 +91,11 @@ class _ConstantMapKeyIterable<K> extends IterableBase<K> {
Iterator<K> get iterator => _map._keys.iterator;
}
-// This class has no constructor. This is on purpose since the instantiation
-// is shortcut by the compiler.
class GeneralConstantMap<K, V> extends ConstantMap<K, V> {
+ // This constructor is not used. The instantiation is shortcut by the
+ // compiler. It is here to make the uninitialized final fields legal.
+ GeneralConstantMap(this._jsData);
+
// [_jsData] holds a key-value pair list.
final _jsData;
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698