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

Side by Side Diff: pkg/intl/lib/src/intl_helpers.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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
« no previous file with comments | « pkg/intl/lib/date_format.dart ('k') | pkg/intl/lib/src/lazy_locale_data.dart » ('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) 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 /** 5 /**
6 * A library for general helper code associated with the intl library 6 * A library for general helper code associated with the intl library
7 * rather than confined to specific parts of it. 7 * rather than confined to specific parts of it.
8 */ 8 */
9 9
10 #library("intl_helpers"); 10 #library("intl_helpers");
11 11
12 /** 12 /**
13 * This is used as a marker for a locale data map that hasn't been initialized, 13 * This is used as a marker for a locale data map that hasn't been initialized,
14 * and will throw an exception on any usage. 14 * and will throw an exception on any usage.
15 */ 15 */
16 class UninitializedLocaleData { 16 class UninitializedLocaleData {
17 final String message; 17 final String message;
18 const UninitializedLocaleData(this.message); 18 const UninitializedLocaleData(this.message);
19 19
20 operator [](String key) { 20 operator [](String key) {
21 _throwException(); 21 _throwException();
22 } 22 }
23 List getKeys() => _throwException(); 23 List get keys => _throwException();
24 bool containsKey(String key) => _throwException(); 24 bool containsKey(String key) => _throwException();
25 25
26 _throwException() { 26 _throwException() {
27 throw new LocaleDataException("Locale data has not been initialized" 27 throw new LocaleDataException("Locale data has not been initialized"
28 ", call $message."); 28 ", call $message.");
29 } 29 }
30 } 30 }
31 31
32 class LocaleDataException implements Exception { 32 class LocaleDataException implements Exception {
33 final String message; 33 final String message;
(...skipping 19 matching lines...) Expand all
53 /** 53 /**
54 * Initialize the message lookup mechanism. This is for internal use only. 54 * Initialize the message lookup mechanism. This is for internal use only.
55 * User applications should import `message_lookup_local.dart` and call 55 * User applications should import `message_lookup_local.dart` and call
56 * `initializeMessages` 56 * `initializeMessages`
57 */ 57 */
58 void initializeInternalMessageLookup(Function lookupFunction) { 58 void initializeInternalMessageLookup(Function lookupFunction) {
59 if (messageLookup is UninitializedLocaleData) { 59 if (messageLookup is UninitializedLocaleData) {
60 messageLookup = lookupFunction(); 60 messageLookup = lookupFunction();
61 } 61 }
62 } 62 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/date_format.dart ('k') | pkg/intl/lib/src/lazy_locale_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698