Index: src/execution.cc |
diff --git a/src/execution.cc b/src/execution.cc |
index 85a73cd6676c5711bcaacdc81933efb90cbbf959..48b92ffd2856b6b593924a928c64d74dcd6ad2de 100644 |
--- a/src/execution.cc |
+++ b/src/execution.cc |
@@ -431,16 +431,26 @@ Handle<String> Execution::GetStackTraceLine(Handle<Object> recv, |
Handle<Object> pos, |
Handle<Object> is_global) { |
Isolate* isolate = fun->GetIsolate(); |
- Handle<Object> args[] = { recv, fun, pos, is_global }; |
- MaybeHandle<Object> maybe_result = |
- TryCall(isolate, isolate->get_stack_trace_line_fun(), |
- isolate->factory()->undefined_value(), arraysize(args), args); |
- Handle<Object> result; |
- if (!maybe_result.ToHandle(&result) || !result->IsString()) { |
+ |
+ Handle<JSFunction> ctor = |
+ handle(isolate->native_context()->callsite_function(), isolate); |
+ Handle<Object> strict_mode = isolate->factory()->ToBoolean(false); |
+ |
+ MaybeHandle<Object> maybe_callsite = CallSiteUtils::Construct( |
+ isolate, ctor, ctor, recv, fun, pos, strict_mode); |
+ if (maybe_callsite.is_null()) { |
+ isolate->clear_pending_exception(); |
+ return isolate->factory()->empty_string(); |
+ } |
+ |
+ MaybeHandle<String> maybe_to_string = |
+ CallSiteUtils::ToString(isolate, maybe_callsite.ToHandleChecked()); |
+ if (maybe_to_string.is_null()) { |
+ isolate->clear_pending_exception(); |
return isolate->factory()->empty_string(); |
} |
- return Handle<String>::cast(result); |
+ return maybe_to_string.ToHandleChecked(); |
} |