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

Unified Diff: src/execution.cc

Issue 2194883002: Remove GetStackTraceLine (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@port-format-stack-trace
Patch Set: Rebase Created 4 years, 5 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
« no previous file with comments | « src/contexts.h ('k') | src/js/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « src/contexts.h ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698