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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_string.dart

Issue 16206008: Fix-up RegExp implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Renaming startIndex to index. Add comment. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/regexp_patch.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/js_string.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
index 610f7f812d97450f8f0d56f4e3d2d2b2459ed87f..92d7c673a2a62bc8da0b152e3afa0a81c59d5bdb 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
@@ -222,6 +222,9 @@ class JSString extends Interceptor implements String, JSIndexable {
bool contains(Pattern other, [int startIndex = 0]) {
checkNull(other);
+ if (startIndex < 0 || startIndex > this.length) {
+ throw new RangeError.range(startIndex, 0, this.length);
+ }
return stringContainsUnchecked(this, other, startIndex);
}
« no previous file with comments | « runtime/lib/regexp_patch.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698