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 2277103002: Replace Maps library tour link in Storage template with current URL. (Closed)
Patch Set: Created 4 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 | « no previous file | 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>.
11 * 11 *
12 * To store and get values, use Dart's built-in map syntax: 12 * To store and get values, use Dart's built-in map syntax:
13 * 13 *
14 * window.localStorage['key1'] = 'val1'; 14 * window.localStorage['key1'] = 'val1';
15 * window.localStorage['key2'] = 'val2'; 15 * window.localStorage['key2'] = 'val2';
16 * window.localStorage['key3'] = 'val3'; 16 * window.localStorage['key3'] = 'val3';
17 * assert(window.localStorage['key3'] == 'val3'); 17 * assert(window.localStorage['key3'] == 'val3');
18 * 18 *
19 * You can use [Map](http://api.dartlang.org/dart_core/Map.html) APIs 19 * You can use [Map](http://api.dartlang.org/dart_core/Map.html) APIs
20 * such as containsValue(), clear(), and length: 20 * such as containsValue(), clear(), and length:
21 * 21 *
22 * assert(window.localStorage.containsValue('does not exist') == false); 22 * assert(window.localStorage.containsValue('does not exist') == false);
23 * window.localStorage.clear(); 23 * window.localStorage.clear();
24 * assert(window.localStorage.length == 0); 24 * assert(window.localStorage.length == 0);
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](https://www.dartlang.org/guides/libraries/library-tour#maps)
30 * section of the library tour. 30 * section of the library tour.
31 */ 31 */
32 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS 32 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS
33 implements Map<String, String> { 33 implements Map<String, String> {
34 34
35 void addAll(Map<String, String> other) { 35 void addAll(Map<String, String> other) {
36 other.forEach((k, v) { this[k] = v; }); 36 other.forEach((k, v) { this[k] = v; });
37 } 37 }
38 38
39 // TODO(nweiz): update this when maps support lazy iteration 39 // TODO(nweiz): update this when maps support lazy iteration
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return values; 79 return values;
80 } 80 }
81 81
82 int get length => _length; 82 int get length => _length;
83 83
84 bool get isEmpty => _key(0) == null; 84 bool get isEmpty => _key(0) == null;
85 85
86 bool get isNotEmpty => !isEmpty; 86 bool get isNotEmpty => !isEmpty;
87 $!MEMBERS 87 $!MEMBERS
88 } 88 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698