Index: runtime/vm/exceptions.cc |
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc |
index 37a99f25dcae5330f9ae9ccad548e67247c7825b..442c8f9646999542e6e9ccaa6d544357319568a7 100644 |
--- a/runtime/vm/exceptions.cc |
+++ b/runtime/vm/exceptions.cc |
@@ -640,6 +640,13 @@ void Exceptions::ThrowRangeError(const char* argument_name, |
} |
+void Exceptions::ThrowCompileTimeError(const LanguageError& error) { |
+ const Array& args = Array::Handle(Array::New(1)); |
+ args.SetAt(0, String::Handle(error.FormatMessage())); |
+ Exceptions::ThrowByType(Exceptions::kCompileTimeError, args); |
+} |
+ |
+ |
RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) { |
Library& library = Library::Handle(); |
const String* class_name = NULL; |
@@ -713,6 +720,11 @@ RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) { |
case kCyclicInitializationError: |
library = Library::CoreLibrary(); |
class_name = &Symbols::CyclicInitializationError(); |
+ break; |
+ case kCompileTimeError: |
+ library = Library::CoreLibrary(); |
+ class_name = &Symbols::_CompileTimeError(); |
+ break; |
} |
return DartLibraryCalls::InstanceCreate(library, |