Index: pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart |
index a8fb4ccc17f549d5c7b62a05d90b24a49e0533fc..fdfd0d9bb0f359b44bc973b7af85c725e57e47d7 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart |
@@ -7,7 +7,8 @@ part of dart._js_helper; |
// Helper method used by internal libraries. |
regExpGetNative(JSSyntaxRegExp regexp) => regexp._nativeRegExp; |
-List<String> _stringList(List l) => l == null ? l : JS('', 'dart.list(#, #)', l, String); |
+List<String> _stringList(List l) => |
+ l == null ? l : JS('', 'dart.list(#, #)', l, String); |
/** |
* Returns a native version of the RegExp with the global flag set. |
@@ -51,18 +52,15 @@ class JSSyntaxRegExp implements RegExp { |
String toString() => "RegExp/$pattern/"; |
JSSyntaxRegExp(String source, |
- { bool multiLine: false, |
- bool caseSensitive: true }) |
+ {bool multiLine: false, bool caseSensitive: true}) |
: this.pattern = source, |
this._nativeRegExp = |
makeNative(source, multiLine, caseSensitive, false); |
get _nativeGlobalVersion { |
if (_nativeGlobalRegExp != null) return _nativeGlobalRegExp; |
- return _nativeGlobalRegExp = makeNative(pattern, |
- _isMultiLine, |
- _isCaseSensitive, |
- true); |
+ return _nativeGlobalRegExp = |
+ makeNative(pattern, _isMultiLine, _isCaseSensitive, true); |
} |
get _nativeAnchoredVersion { |
@@ -72,10 +70,8 @@ class JSSyntaxRegExp implements RegExp { |
// that it tries, and you can see if the original regexp matched, or it |
// was the added zero-width match that matched, by looking at the last |
// capture. If it is a String, the match participated, otherwise it didn't. |
- return _nativeAnchoredRegExp = makeNative("$pattern|()", |
- _isMultiLine, |
- _isCaseSensitive, |
- true); |
+ return _nativeAnchoredRegExp = |
+ makeNative("$pattern|()", _isMultiLine, _isCaseSensitive, true); |
} |
bool get _isMultiLine => JS("bool", "#.multiline", _nativeRegExp); |
@@ -90,27 +86,29 @@ class JSSyntaxRegExp implements RegExp { |
// We're using the JavaScript's try catch instead of the Dart one |
// to avoid dragging in Dart runtime support just because of using |
// RegExp. |
- var regexp = JS('', |
+ var regexp = JS( |
+ '', |
'(function() {' |
- 'try {' |
- 'return new RegExp(#, # + # + #);' |
- '} catch (e) {' |
- 'return e;' |
- '}' |
- '})()', source, m, i, g); |
+ 'try {' |
+ 'return new RegExp(#, # + # + #);' |
+ '} catch (e) {' |
+ 'return e;' |
+ '}' |
+ '})()', |
+ source, |
+ m, |
+ i, |
+ g); |
if (JS('bool', '# instanceof RegExp', regexp)) return regexp; |
// The returned value is the JavaScript exception. Turn it into a |
// Dart exception. |
String errorMessage = JS('String', r'String(#)', regexp); |
- throw new FormatException( |
- "Illegal RegExp pattern: $source, $errorMessage"); |
+ throw new FormatException("Illegal RegExp pattern: $source, $errorMessage"); |
} |
Match firstMatch(String string) { |
- List m = JS('JSExtendableArray|Null', |
- r'#.exec(#)', |
- _nativeRegExp, |
- checkString(string)); |
+ List m = JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp, |
+ checkString(string)); |
if (m == null) return null; |
return new _MatchImplementation(this, _stringList(m)); |
} |
@@ -228,7 +226,7 @@ class _AllMatchesIterator implements Iterator<Match> { |
} |
} |
_current = null; |
- _string = null; // Marks iteration as ended. |
+ _string = null; // Marks iteration as ended. |
return false; |
} |
} |