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

Unified Diff: runtime/vm/compiler.cc

Issue 2044753002: Make compile-time errors catchable (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Make precompiler work with new error class Created 4 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/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 3293a188cf42c97fe08de86cfd1476c581f46667..4c1e6d3abc326892f45c144c1b2da06d2e6d9ea8 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -165,6 +165,10 @@ DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
const Error& error =
Error::Handle(Compiler::CompileFunction(thread, function));
if (!error.IsNull()) {
+ if (error.IsLanguageError()) {
+ Exceptions::ThrowCompileTimeError(LanguageError::Cast(error));
+ UNREACHABLE();
+ }
Exceptions::PropagateError(error);
}
}

Powered by Google App Engine
This is Rietveld 408576698