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: tools/dom/templates/html/impl/impl_Storage.darttemplate

Issue 103933005: Fix bug 15417 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | « tools/dom/src/AttributeMap.dart ('k') | no next file » | 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 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 /** 7 /**
8 * The type used by the 8 * The type used by the
9 * [Window.localStorage] and [Window.sessionStorage] properties. 9 * [Window.localStorage] and [Window.sessionStorage] properties.
10 * Storage is implemented as a Map<String, String>. 10 * Storage is implemented as a Map<String, String>.
(...skipping 14 matching lines...) Expand all
25 * 25 *
26 * For more examples of using this API, see 26 * For more examples of using this API, see
27 * [localstorage_test.dart](http://code.google.com/p/dart/source/browse/branches /bleeding_edge/dart/tests/html/localstorage_test.dart). 27 * [localstorage_test.dart](http://code.google.com/p/dart/source/browse/branches /bleeding_edge/dart/tests/html/localstorage_test.dart).
28 * For details on using the Map API, see the 28 * For details on using the Map API, see the
29 * [Maps](http://www.dartlang.org/docs/library-tour/#maps-aka-dictionaries-or-ha shes) 29 * [Maps](http://www.dartlang.org/docs/library-tour/#maps-aka-dictionaries-or-ha shes)
30 * section of the library tour. 30 * section of the library tour.
31 */ 31 */
32 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS 32 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS
33 implements Map<String, String> $NATIVESPEC { 33 implements Map<String, String> $NATIVESPEC {
34 34
35 void addAll(Map<String, String> other) {
36 other.forEach((k, v) { this[k] = v; });
37 }
38
35 // TODO(nweiz): update this when maps support lazy iteration 39 // TODO(nweiz): update this when maps support lazy iteration
36 bool containsValue(String value) => values.any((e) => e == value); 40 bool containsValue(String value) => values.any((e) => e == value);
37 41
38 bool containsKey(String key) => _getItem(key) != null; 42 bool containsKey(String key) => _getItem(key) != null;
39 43
40 String operator [](String key) => _getItem(key); 44 String operator [](String key) => _getItem(key);
41 45
42 void operator []=(String key, String value) { _setItem(key, value); } 46 void operator []=(String key, String value) { _setItem(key, value); }
43 47
44 String putIfAbsent(String key, String ifAbsent()) { 48 String putIfAbsent(String key, String ifAbsent()) {
(...skipping 30 matching lines...) Expand all
75 return values; 79 return values;
76 } 80 }
77 81
78 int get length => _length; 82 int get length => _length;
79 83
80 bool get isEmpty => _key(0) == null; 84 bool get isEmpty => _key(0) == null;
81 85
82 bool get isNotEmpty => !isEmpty; 86 bool get isNotEmpty => !isEmpty;
83 $!MEMBERS 87 $!MEMBERS
84 } 88 }
OLDNEW
« no previous file with comments | « tools/dom/src/AttributeMap.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698