Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index e46b855b0748886a5dfdcb2d43fcc1f8f7836639..ad9e141a6e88bb1ab73ad2d14f911033bf7f03ef 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -13263,9 +13263,10 @@ static bool ShowFrameInStackTrace(StackFrame* raw_frame, |
| // element segments each containing a receiver, function, code and |
| // native code offset. |
| RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) { |
| - ASSERT_EQ(args.length(), 2); |
| - Handle<Object> caller = args.at<Object>(0); |
| - CONVERT_NUMBER_CHECKED(int32_t, limit, Int32, args[1]); |
| + ASSERT_EQ(args.length(), 3); |
| + Handle<Object> error_object = args.at<Object>(0); |
|
Vyacheslav Egorov (Chromium)
2012/02/06 17:26:26
CONVERT_ARG_CHECKED(JSObject, error_object, 0);
j
Yang
2012/02/07 08:33:58
Done.
|
| + Handle<Object> caller = args.at<Object>(1); |
| + CONVERT_NUMBER_CHECKED(int32_t, limit, Int32, args[2]); |
| HandleScope scope(isolate); |
| Factory* factory = isolate->factory(); |
| @@ -13315,6 +13316,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) { |
| iter.Advance(); |
| } |
| Handle<JSArray> result = factory->NewJSArrayWithElements(elements); |
| + // Capture and attach a more detailed stack trace if necessary. |
| + isolate->CaptureAndSetCurrentStackTraceFor(error_object); |
| result->set_length(Smi::FromInt(cursor)); |
| return *result; |
| } |