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

Side by Side Diff: src/d8.cc

Issue 1246643002: Fix stack trace printing in d8 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 for (int i = 0; i < start; i++) { 910 for (int i = 0; i < start; i++) {
911 printf(" "); 911 printf(" ");
912 } 912 }
913 int end = message->GetEndColumn(isolate->GetCurrentContext()).FromJust(); 913 int end = message->GetEndColumn(isolate->GetCurrentContext()).FromJust();
914 for (int i = start; i < end; i++) { 914 for (int i = start; i < end; i++) {
915 printf("^"); 915 printf("^");
916 } 916 }
917 printf("\n"); 917 printf("\n");
918 Local<Value> stack_trace_string; 918 Local<Value> stack_trace_string;
919 if (try_catch->StackTrace(isolate->GetCurrentContext()) 919 if (try_catch->StackTrace(isolate->GetCurrentContext())
920 .ToLocal(&stack_trace_string)) { 920 .ToLocal(&stack_trace_string) &&
921 stack_trace_string->IsString()) {
921 v8::String::Utf8Value stack_trace( 922 v8::String::Utf8Value stack_trace(
922 Local<String>::Cast(stack_trace_string)); 923 Local<String>::Cast(stack_trace_string));
923 printf("%s\n", ToCString(stack_trace)); 924 printf("%s\n", ToCString(stack_trace));
924 } 925 }
925 } 926 }
926 printf("\n"); 927 printf("\n");
927 #ifndef V8_SHARED 928 #ifndef V8_SHARED
928 if (enter_context) utility_context->Exit(); 929 if (enter_context) utility_context->Exit();
929 #endif // !V8_SHARED 930 #endif // !V8_SHARED
930 } 931 }
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 } 2606 }
2606 2607
2607 } // namespace v8 2608 } // namespace v8
2608 2609
2609 2610
2610 #ifndef GOOGLE3 2611 #ifndef GOOGLE3
2611 int main(int argc, char* argv[]) { 2612 int main(int argc, char* argv[]) {
2612 return v8::Shell::Main(argc, argv); 2613 return v8::Shell::Main(argc, argv);
2613 } 2614 }
2614 #endif 2615 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698