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

Unified Diff: runtime/lib/regexp_patch.dart

Issue 11365196: Move JSSyntaxRegExp to core as a private member. This removes the last refrences to dart:coreimpl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make VM's JSSyntaxRegExp private. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/lib_sources.gypi ('k') | runtime/vm/bootstrap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/regexp_patch.dart
diff --git a/runtime/lib/regexp_patch.dart b/runtime/lib/regexp_patch.dart
index 115dd45a802e922de1651dd4976fae123d4f850a..4b1c9a01df40b31ba94e8a95b2a6257f80e24377 100644
--- a/runtime/lib/regexp_patch.dart
+++ b/runtime/lib/regexp_patch.dart
@@ -2,6 +2,15 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+patch class RegExp {
+ /* patch */ factory RegExp(String pattern,
+ {bool multiLine: false,
+ bool ignoreCase: false})
+ => new _JSSyntaxRegExp(pattern,
Mads Ager (google) 2012/11/12 12:28:10 I don't like the arrow when the body takes up this
Anders Johnsen 2012/11/12 12:30:32 Sure, done!
+ multiLine: multiLine,
+ ignoreCase: ignoreCase);
+}
+
class _JSRegExpMatch implements Match {
_JSRegExpMatch(this.regexp, this.str, this._match);
@@ -53,13 +62,13 @@ class _JSRegExpMatch implements Match {
}
-patch class JSSyntaxRegExp {
- /* patch */ const factory JSSyntaxRegExp(
+class _JSSyntaxRegExp extends RegExp {
+ factory _JSSyntaxRegExp(
String pattern,
{bool multiLine: false,
bool ignoreCase: false}) native "JSSyntaxRegExp_factory";
- /* patch */ Match firstMatch(String str) {
+ Match firstMatch(String str) {
List match = _ExecuteMatch(str, 0);
if (match === null) {
return null;
@@ -67,7 +76,7 @@ patch class JSSyntaxRegExp {
return new _JSRegExpMatch(this, str, match);
}
- /* patch */ Iterable<Match> allMatches(String str) {
+ Iterable<Match> allMatches(String str) {
List<Match> result = new List<Match>();
int length = str.length;
int startIndex = 0;
@@ -89,12 +98,12 @@ patch class JSSyntaxRegExp {
return result;
}
- /* patch */ bool hasMatch(String str) {
+ bool hasMatch(String str) {
List match = _ExecuteMatch(str, 0);
return (match === null) ? false : true;
}
- /* patch */ String stringMatch(String str) {
+ String stringMatch(String str) {
List match = _ExecuteMatch(str, 0);
if (match === null) {
return null;
@@ -103,11 +112,11 @@ patch class JSSyntaxRegExp {
return str.substring(match[0], match[1]);
}
- /* patch */ String get pattern native "JSSyntaxRegExp_getPattern";
+ String get pattern native "JSSyntaxRegExp_getPattern";
- /* patch */ bool get multiLine native "JSSyntaxRegExp_multiLine";
+ bool get multiLine native "JSSyntaxRegExp_multiLine";
- /* patch */ bool get ignoreCase native "JSSyntaxRegExp_ignoreCase";
+ bool get ignoreCase native "JSSyntaxRegExp_ignoreCase";
int get _groupCount native "JSSyntaxRegExp_getGroupCount";
« no previous file with comments | « runtime/lib/lib_sources.gypi ('k') | runtime/vm/bootstrap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698