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

Side by Side Diff: pkg/lookup_map/lib/lookup_map.dart

Issue 1301373009: Fix typo in lookup map, use pub_semver to check version constraints in dart2js (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « pkg/lookup_map/README.md ('k') | pkg/lookup_map/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Defines [LookupMap], a simple map that can be optimized by dart2js. 5 /// Defines [LookupMap], a simple map that can be optimized by dart2js.
6 library lookup_map; 6 library lookup_map;
7 7
8 /// [LookupMap] is a simple, but very restricted map. The map can only hold 8 /// [LookupMap] is a simple, but very restricted map. The map can only hold
9 /// constant keys and the only way to use the map is to retrieve values with a 9 /// constant keys and the only way to use the map is to retrieve values with a
10 /// key you already have. Expect for lookup, any other operation in [Map] (like 10 /// key you already have. Except for lookup, any other operation in [Map] (like
11 /// forEach, keys, values, length, etc) is not available. 11 /// forEach, keys, values, length, etc) is not available.
12 /// 12 ///
13 /// Constant [LookupMap]s are understood by dart2js and can be tree-shaken 13 /// Constant [LookupMap]s are understood by dart2js and can be tree-shaken
14 /// internally: if a key is not used elsewhere in the program, its entry can be 14 /// internally: if a key is not used elsewhere in the program, its entry can be
15 /// deleted from the map during compilation without changing the program's 15 /// deleted from the map during compilation without changing the program's
16 /// behavior. Currently dart2js supports tree-shaking keys that are `Type` 16 /// behavior. Currently dart2js supports tree-shaking keys that are `Type`
17 /// literals, and any const expression that can only be created with a const 17 /// literals, and any const expression that can only be created with a const
18 /// constructor. This means that primitives, Strings, and constant objects that 18 /// constructor. This means that primitives, Strings, and constant objects that
19 /// override the `==` operator cannot be tree-shaken. 19 /// override the `==` operator cannot be tree-shaken.
20 /// 20 ///
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 /// An expando that stores a flatten version of a [LookupMap], this is 91 /// An expando that stores a flatten version of a [LookupMap], this is
92 /// computed and stored the first time the map is accessed. 92 /// computed and stored the first time the map is accessed.
93 final _flatMap = new Expando('_flat_map'); 93 final _flatMap = new Expando('_flat_map');
94 94
95 /// Internal constant that matches the version in the pubspec. This is used by 95 /// Internal constant that matches the version in the pubspec. This is used by
96 /// dart2js to ensure that optimizations are only enabled on known versions of 96 /// dart2js to ensure that optimizations are only enabled on known versions of
97 /// this code. 97 /// this code.
98 // Note: this needs to be kept in sync with the pubspec, otherwise 98 // Note: this needs to be kept in sync with the pubspec, otherwise
99 // test/version_check_test would fail. 99 // test/version_check_test would fail.
100 final _version = '0.0.1'; 100 final _version = '0.0.1+1';
OLDNEW
« no previous file with comments | « pkg/lookup_map/README.md ('k') | pkg/lookup_map/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698