Check if invocation of a closure failed due to a compilation error

This is a fix for bug #1325.  The test framework is running the test code
as a microtask using DartInvokeAppClosure.  If the test causes a compilation
error, the test framework Dart code can not catch it.  The invocation in
sky_shell will return a compilation error handle.  The sky_shell process
will not shut down, and the test framework will hang.

This change will cause sky_shell to shut down on a compilation error in
the test microtask.
This commit is contained in:
Jason Simmons 2015-10-08 10:48:55 -07:00
parent d8046818a4
commit fbc0a696dd

View File

@ -21,8 +21,10 @@ bool DartInvokeAppClosure(Dart_Handle closure,
int number_of_arguments,
Dart_Handle* arguments) {
TRACE_EVENT0("sky", "DartInvoke::DartInvokeAppClosure");
return LogIfError(
Dart_InvokeClosure(closure, number_of_arguments, arguments));
Dart_Handle handle = Dart_InvokeClosure(closure, number_of_arguments, arguments);
bool result = LogIfError(handle);
CHECK(!Dart_IsCompilationError(handle));
return result;
}
} // namespace blink