Index: runtime/vm/exceptions.cc |
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc |
index 8823362a0ba4653ec8aeaae70577f2b6b47ae342..0ee20ad2f34ddbf796c25f926172cf0440938d47 100644 |
--- a/runtime/vm/exceptions.cc |
+++ b/runtime/vm/exceptions.cc |
@@ -719,6 +719,13 @@ void Exceptions::ThrowRangeError(const char* argument_name, |
} |
+void Exceptions::ThrowRangeErrorMsg(const char* msg) { |
+ const Array& args = Array::Handle(Array::New(1)); |
+ args.SetAt(0, String::Handle(String::New(msg))); |
+ Exceptions::ThrowByType(Exceptions::kRangeMsg, args); |
+} |
+ |
+ |
void Exceptions::ThrowCompileTimeError(const LanguageError& error) { |
const Array& args = Array::Handle(Array::New(1)); |
args.SetAt(0, String::Handle(error.FormatMessage())); |
@@ -741,6 +748,11 @@ RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) { |
class_name = &Symbols::RangeError(); |
constructor_name = &Symbols::DotRange(); |
break; |
+ case kRangeMsg: |
+ library = Library::CoreLibrary(); |
+ class_name = &Symbols::RangeError(); |
+ constructor_name = &Symbols::Dot(); |
+ break; |
case kArgument: |
library = Library::CoreLibrary(); |
class_name = &Symbols::ArgumentError(); |