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

Side by Side Diff: pkg/observe/lib/src/path_observer.dart

Issue 26734004: use symbol literals instead of const ctor in packages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « pkg/observe/lib/src/observable_map.dart ('k') | pkg/observe/test/observable_list_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 observe; 5 part of observe;
6 6
7 // This code is inspired by ChangeSummary: 7 // This code is inspired by ChangeSummary:
8 // https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js 8 // https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js
9 // ...which underlies MDV. Since we don't need the functionality of 9 // ...which underlies MDV. Since we don't need the functionality of
10 // ChangeSummary, we just implement what we need for data bindings. 10 // ChangeSummary, we just implement what we need for data bindings.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (identical(_values[i + 1], newValue)) { 125 if (identical(_values[i + 1], newValue)) {
126 _observePath(start, i); 126 _observePath(start, i);
127 return; 127 return;
128 } 128 }
129 _values[i + 1] = newValue; 129 _values[i + 1] = newValue;
130 changed = true; 130 changed = true;
131 } 131 }
132 132
133 _observePath(start); 133 _observePath(start);
134 if (changed) { 134 if (changed) {
135 notifyChange(new PropertyChangeRecord(const Symbol('value'))); 135 notifyChange(new PropertyChangeRecord(#value));
136 } 136 }
137 } 137 }
138 138
139 void _observePath([int start = 0, int end]) { 139 void _observePath([int start = 0, int end]) {
140 if (end == null) end = _segments.length; 140 if (end == null) end = _segments.length;
141 141
142 for (int i = start; i < end; i++) { 142 for (int i = start; i < end; i++) {
143 if (_subs[i] != null) _subs[i].cancel(); 143 if (_subs[i] != null) _subs[i].cancel();
144 _observeIndex(i); 144 _observeIndex(i);
145 } 145 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 final _spacesRegExp = new RegExp(r'\s'); 239 final _spacesRegExp = new RegExp(r'\s');
240 240
241 bool _isPathValid(String s) { 241 bool _isPathValid(String s) {
242 s = s.replaceAll(_spacesRegExp, ''); 242 s = s.replaceAll(_spacesRegExp, '');
243 243
244 if (s == '') return true; 244 if (s == '') return true;
245 if (s[0] == '.') return false; 245 if (s[0] == '.') return false;
246 return _pathRegExp.hasMatch(s); 246 return _pathRegExp.hasMatch(s);
247 } 247 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/observable_map.dart ('k') | pkg/observe/test/observable_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698