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

Side by Side Diff: runtime/lib/regexp_patch.dart

Issue 2230383003: Implement @patch annotation for patch class members (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip 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 | « runtime/lib/profiler.dart ('k') | runtime/lib/resource_patch.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) 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 import "dart:collection" show LinkedList, LinkedListEntry; 5 import "dart:collection" show LinkedList, LinkedListEntry;
6 6
7 @patch class RegExp { 7 @patch class RegExp {
8 /* @patch */ factory RegExp(String source, 8 @patch factory RegExp(String source,
9 {bool multiLine: false, 9 {bool multiLine: false,
10 bool caseSensitive: true}) { 10 bool caseSensitive: true}) {
11 _RegExpHashKey key = new _RegExpHashKey( 11 _RegExpHashKey key = new _RegExpHashKey(
12 source, multiLine, caseSensitive); 12 source, multiLine, caseSensitive);
13 _RegExpHashValue value = _cache[key]; 13 _RegExpHashValue value = _cache[key];
14 14
15 if (value == null) { 15 if (value == null) {
16 if (_cache.length > _MAX_CACHE_SIZE) { 16 if (_cache.length > _MAX_CACHE_SIZE) {
17 _RegExpHashKey lastKey = _recentlyUsed.last; 17 _RegExpHashKey lastKey = _recentlyUsed.last;
18 lastKey.unlink(); 18 lastKey.unlink();
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 _nextIndex++; 274 _nextIndex++;
275 } 275 }
276 return true; 276 return true;
277 } 277 }
278 } 278 }
279 _current = null; 279 _current = null;
280 _re = null; 280 _re = null;
281 return false; 281 return false;
282 } 282 }
283 } 283 }
OLDNEW
« no previous file with comments | « runtime/lib/profiler.dart ('k') | runtime/lib/resource_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698