Index: runtime/lib/errors.cc |
diff --git a/runtime/lib/errors.cc b/runtime/lib/errors.cc |
index 8383a307634ed1be18f7ce59591253d79ff75652..a0c4295dc68e98fa603cf14eb42933a71756b80a 100644 |
--- a/runtime/lib/errors.cc |
+++ b/runtime/lib/errors.cc |
@@ -14,15 +14,15 @@ namespace dart { |
// Arg0: index of the first token of the failed assertion. |
// Arg1: index of the first token after the failed assertion. |
// Return value: none, throws an exception. |
-DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 2) { |
+DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 3) { |
// No need to type check the arguments. This function can only be called |
// internally from the VM. |
intptr_t assertion_start = |
Smi::CheckedHandle(arguments->NativeArgAt(0)).Value(); |
intptr_t assertion_end = |
Smi::CheckedHandle(arguments->NativeArgAt(1)).Value(); |
- |
- const Array& args = Array::Handle(Array::New(4)); |
+ const Instance& message = Instance::CheckedHandle(arguments->NativeArgAt(2)); |
+ const Array& args = Array::Handle(Array::New(5)); |
DartFrameIterator iterator; |
iterator.NextFrame(); // Skip native call. |
@@ -43,6 +43,7 @@ DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 2) { |
args.SetAt(1, String::Handle(script.url())); |
args.SetAt(2, Smi::Handle(Smi::New(from_line))); |
args.SetAt(3, Smi::Handle(Smi::New(script.HasSource() ? from_column : -1))); |
+ args.SetAt(4, message); |
Exceptions::ThrowByType(Exceptions::kAssertion, args); |
UNREACHABLE(); |