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

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

Issue 23635003: Fixing first-chance exception in TodoMVC (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« 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) 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 _updateObservedValues(i); 164 _updateObservedValues(i);
165 return; 165 return;
166 } 166 }
167 } 167 }
168 }); 168 });
169 } 169 }
170 } 170 }
171 } 171 }
172 172
173 _getObjectProperty(object, property) { 173 _getObjectProperty(object, property) {
174 if (object == null) {
175 return null;
176 }
177
174 if (object is List && property is int) { 178 if (object is List && property is int) {
175 if (property >= 0 && property < object.length) { 179 if (property >= 0 && property < object.length) {
176 return object[property]; 180 return object[property];
177 } else { 181 } else {
178 return null; 182 return null;
179 } 183 }
180 } 184 }
181 185
182 if (property is Symbol) { 186 if (property is Symbol) {
183 var mirror = reflect(object); 187 var mirror = reflect(object);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 238
235 final _spacesRegExp = new RegExp(r'\s'); 239 final _spacesRegExp = new RegExp(r'\s');
236 240
237 bool _isPathValid(String s) { 241 bool _isPathValid(String s) {
238 s = s.replaceAll(_spacesRegExp, ''); 242 s = s.replaceAll(_spacesRegExp, '');
239 243
240 if (s == '') return true; 244 if (s == '') return true;
241 if (s[0] == '.') return false; 245 if (s[0] == '.') return false;
242 return _pathRegExp.hasMatch(s); 246 return _pathRegExp.hasMatch(s);
243 } 247 }
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