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

Side by Side Diff: src/messages.cc

Issue 2206203002: Move FormatStackTrace to ErrorUtils (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@port-no-sideeffect-to-string
Patch Set: Rebase Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/messages.h" 5 #include "src/messages.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 ~PrepareStackTraceScope() { isolate_->set_formatting_stack_trace(false); } 579 ~PrepareStackTraceScope() { isolate_->set_formatting_stack_trace(false); }
580 580
581 private: 581 private:
582 Isolate* isolate_; 582 Isolate* isolate_;
583 583
584 DISALLOW_COPY_AND_ASSIGN(PrepareStackTraceScope); 584 DISALLOW_COPY_AND_ASSIGN(PrepareStackTraceScope);
585 }; 585 };
586 586
587 } // namespace 587 } // namespace
588 588
589 MaybeHandle<Object> FormatStackTrace(Isolate* isolate, Handle<JSObject> error, 589 // static
590 Handle<Object> raw_stack) { 590 MaybeHandle<Object> ErrorUtils::FormatStackTrace(Isolate* isolate,
591 Handle<JSObject> error,
592 Handle<Object> raw_stack) {
591 // Create JS CallSite objects from the raw stack frame array. 593 // Create JS CallSite objects from the raw stack frame array.
592 594
593 Handle<FixedArray> frames; 595 Handle<FixedArray> frames;
594 ASSIGN_RETURN_ON_EXCEPTION(isolate, frames, 596 ASSIGN_RETURN_ON_EXCEPTION(isolate, frames,
595 GetStackFrames(isolate, raw_stack), Object); 597 GetStackFrames(isolate, raw_stack), Object);
596 598
597 // If there's a user-specified "prepareStackFrames" function, call it on the 599 // If there's a user-specified "prepareStackFrames" function, call it on the
598 // frames and use its result. 600 // frames and use its result.
599 601
600 Handle<JSFunction> global_error = isolate->error_function(); 602 Handle<JSFunction> global_error = isolate->error_function();
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 builder.AppendCString(" ("); 1179 builder.AppendCString(" (");
1178 RETURN_ON_EXCEPTION( 1180 RETURN_ON_EXCEPTION(
1179 isolate, AppendFileLocation(isolate, recv, &call_site, &builder), String); 1181 isolate, AppendFileLocation(isolate, recv, &call_site, &builder), String);
1180 builder.AppendCString(")"); 1182 builder.AppendCString(")");
1181 1183
1182 RETURN_RESULT(isolate, builder.Finish(), String); 1184 RETURN_RESULT(isolate, builder.Finish(), String);
1183 } 1185 }
1184 1186
1185 } // namespace internal 1187 } // namespace internal
1186 } // namespace v8 1188 } // namespace v8
OLDNEW
« no previous file with comments | « src/messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698