Index: runtime/vm/exceptions.cc |
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc |
index 75ef32219aac6850e4f4609668c7ac7c55d6ff47..fa2e44179de9d83d7c11aceb4fa1899363a25afb 100644 |
--- a/runtime/vm/exceptions.cc |
+++ b/runtime/vm/exceptions.cc |
@@ -566,16 +566,12 @@ void Exceptions::ThrowRangeError(const char* argument_name, |
const Integer& argument_value, |
intptr_t expected_from, |
intptr_t expected_to) { |
- const String& error = String::Handle(String::NewFormatted( |
- "%s (%s) must be in the range [%" Pd "..%" Pd ")", |
- argument_name, |
- argument_value.ToCString(), |
- expected_from, |
- expected_to)); |
- |
- const Array& args = Array::Handle(Array::New(1)); |
- args.SetAt(0, error); |
- Exceptions::ThrowByType(Exceptions::kRange, args); |
+ const Array& args = Array::Handle(Array::New(4)); |
+ args.SetAt(0, argument_value); |
+ args.SetAt(1, Integer::Handle(Integer::New(expected_from))); |
+ args.SetAt(2, Integer::Handle(Integer::New(expected_to))); |
+ args.SetAt(3, String::Handle(String::New(argument_name))); |
+ Exceptions::ThrowByType(Exceptions::kRangeRange, args); |
} |
@@ -593,6 +589,11 @@ RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) { |
library = Library::CoreLibrary(); |
class_name = &Symbols::RangeError(); |
break; |
+ case kRangeRange: |
+ library = Library::CoreLibrary(); |
+ class_name = &Symbols::RangeError(); |
+ constructor_name = &Symbols::DotRange(); |
+ break; |
case kArgument: |
library = Library::CoreLibrary(); |
class_name = &Symbols::ArgumentError(); |