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

Unified Diff: runtime/vm/regexp_parser.cc

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: runtime/vm/regexp_parser.cc
diff --git a/runtime/vm/regexp_parser.cc b/runtime/vm/regexp_parser.cc
index 003e554646dd683854d696ad1e061eb00510d10b..a0f114b49f54049d1cce5a9065a2f3831b27250f 100644
--- a/runtime/vm/regexp_parser.cc
+++ b/runtime/vm/regexp_parser.cc
@@ -267,10 +267,15 @@ bool RegExpParser::ParseRegExp(const String& input,
result->capture_count = capture_count;
} else {
ASSERT(!result->error.IsNull());
-
- // TODO(jgruber): Throw a format exception once we are ready to replace
- // jscre. For now, we ignore the error set by LongJump.
Isolate::Current()->object_store()->clear_sticky_error();
+
+ // Throw a FormatException on parsing failures.
+ const String& message = String::Handle(
+ String::Concat(result->error, input));
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, message);
+
+ Exceptions::ThrowByType(Exceptions::kFormat, args);
}
return !parser.failed();
}

Powered by Google App Engine
This is Rietveld 408576698