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

Side by Side Diff: src/d8.cc

Issue 7060006: Changed d8 to print exception stack traces like samples/shell.cc. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Print wavy underline (GetUnderline is deprecated). 259 // Print wavy underline (GetUnderline is deprecated).
260 int start = message->GetStartColumn(); 260 int start = message->GetStartColumn();
261 for (int i = 0; i < start; i++) { 261 for (int i = 0; i < start; i++) {
262 printf(" "); 262 printf(" ");
263 } 263 }
264 int end = message->GetEndColumn(); 264 int end = message->GetEndColumn();
265 for (int i = start; i < end; i++) { 265 for (int i = start; i < end; i++) {
266 printf("^"); 266 printf("^");
267 } 267 }
268 printf("\n"); 268 printf("\n");
269 v8::String::Utf8Value stack_trace(try_catch->StackTrace());
270 if (stack_trace.length() > 0) {
271 const char* stack_trace_string = ToCString(stack_trace);
272 printf("%s\n", stack_trace_string);
273 }
269 } 274 }
270 } 275 }
271 276
272 277
273 Handle<Array> Shell::GetCompletions(Handle<String> text, Handle<String> full) { 278 Handle<Array> Shell::GetCompletions(Handle<String> text, Handle<String> full) {
274 HandleScope handle_scope; 279 HandleScope handle_scope;
275 Context::Scope context_scope(utility_context_); 280 Context::Scope context_scope(utility_context_);
276 Handle<Object> global = utility_context_->Global(); 281 Handle<Object> global = utility_context_->Global();
277 Handle<Value> fun = global->Get(String::New("GetCompletions")); 282 Handle<Value> fun = global->Get(String::New("GetCompletions"));
278 static const int kArgc = 3; 283 static const int kArgc = 3;
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 delete thread; 789 delete thread;
785 } 790 }
786 OnExit(); 791 OnExit();
787 return 0; 792 return 0;
788 } 793 }
789 794
790 795
791 } // namespace v8 796 } // namespace v8
792 797
793 798
799 #ifndef GOOGLE3
794 int main(int argc, char* argv[]) { 800 int main(int argc, char* argv[]) {
795 return v8::Shell::Main(argc, argv); 801 return v8::Shell::Main(argc, argv);
796 } 802 }
803 #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