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

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

Issue 2176183006: Add a type annotation to _identRegExp. (Closed) Base URL: git@github.com:dart-lang/observe.git@master
Patch Set: Created 4 years, 4 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) 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 library observe.src.path_observer; 5 library observe.src.path_observer;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:math' show min; 9 import 'dart:math' show min;
10 10
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 322
323 if (_logger.isLoggable(Level.FINER)) { 323 if (_logger.isLoggable(Level.FINER)) {
324 _logger.finer("can't set $property in $object"); 324 _logger.finer("can't set $property in $object");
325 } 325 }
326 return false; 326 return false;
327 } 327 }
328 328
329 // From: https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js 329 // From: https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js
330 330
331 final _identRegExp = () { 331 final RegExp _identRegExp = () {
332 const identStart = '[\$_a-zA-Z]'; 332 const identStart = '[\$_a-zA-Z]';
333 const identPart = '[\$_a-zA-Z0-9]'; 333 const identPart = '[\$_a-zA-Z0-9]';
334 return new RegExp('^$identStart+$identPart*\$'); 334 return new RegExp('^$identStart+$identPart*\$');
335 }(); 335 }();
336 336
337 _isIdent(s) => _identRegExp.hasMatch(s); 337 _isIdent(s) => _identRegExp.hasMatch(s);
338 338
339 // Dart note: refactored to convert to codepoints once and operate on codepoints 339 // Dart note: refactored to convert to codepoints once and operate on codepoints
340 // rather than characters. 340 // rather than characters.
341 class _PathParser { 341 class _PathParser {
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 if (observer._isOpen) observer._iterateObjects(observe); 911 if (observer._isOpen) observer._iterateObjects(observe);
912 } 912 }
913 913
914 for (var observer in _observers.toList(growable: false)) { 914 for (var observer in _observers.toList(growable: false)) {
915 if (observer._isOpen) observer._check(); 915 if (observer._isOpen) observer._check();
916 } 916 }
917 } 917 }
918 } 918 }
919 919
920 const int _MAX_DIRTY_CHECK_CYCLES = 1000; 920 const int _MAX_DIRTY_CHECK_CYCLES = 1000;
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