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

Unified Diff: runtime/lib/regexp_patch.dart

Issue 11415028: Remove NullPointerException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed VM bugs. 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
Index: runtime/lib/regexp_patch.dart
diff --git a/runtime/lib/regexp_patch.dart b/runtime/lib/regexp_patch.dart
index d6e830c95048ee4186f1799c7e1fd7d2cf887719..6a921fa9a0769a42d7ca33f37e1e973289b2c4d2 100644
--- a/runtime/lib/regexp_patch.dart
+++ b/runtime/lib/regexp_patch.dart
@@ -77,6 +77,7 @@ class _JSSyntaxRegExp implements RegExp {
}
Iterable<Match> allMatches(String str) {
+ if (str is! String) throw new ArgumentError(str);
List<Match> result = new List<Match>();
int length = str.length;
int startIndex = 0;

Powered by Google App Engine
This is Rietveld 408576698