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

Unified Diff: runtime/vm/exceptions.cc

Issue 533483003: Cleanup throwing of the RangeError in the runtime to remove duplicated code. (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/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 96b498482933e14e56d3cca176b40bcdcdeb0600..c7e0fa1afbff0372fa5bb1a8f1775f33b794d61d 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -667,6 +667,13 @@ void Exceptions::ThrowArgumentError(const Instance& arg) {
}
+void Exceptions::ThrowRangeError(const Instance& arg) {
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, arg);
+ Exceptions::ThrowByType(Exceptions::kRange, args);
Ivan Posva 2014/09/02 15:27:07 It would be helpful to give the expected range her
Vyacheslav Egorov (Google) 2014/09/02 16:02:53 Alternatively I can just format a string like we d
+}
+
+
RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) {
Library& library = Library::Handle();
const String* class_name = NULL;

Powered by Google App Engine
This is Rietveld 408576698