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

Side by Side Diff: samples/shell.cc

Issue 1154423004: Update all callsites of the TryCatch ctor to pass an Isolate (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « samples/process.cc ('k') | src/api.cc » ('j') | 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 // 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 319
320 320
321 // Executes a string within the current v8 context. 321 // Executes a string within the current v8 context.
322 bool ExecuteString(v8::Isolate* isolate, 322 bool ExecuteString(v8::Isolate* isolate,
323 v8::Handle<v8::String> source, 323 v8::Handle<v8::String> source,
324 v8::Handle<v8::Value> name, 324 v8::Handle<v8::Value> name,
325 bool print_result, 325 bool print_result,
326 bool report_exceptions) { 326 bool report_exceptions) {
327 v8::HandleScope handle_scope(isolate); 327 v8::HandleScope handle_scope(isolate);
328 v8::TryCatch try_catch; 328 v8::TryCatch try_catch(isolate);
329 v8::ScriptOrigin origin(name); 329 v8::ScriptOrigin origin(name);
330 v8::Handle<v8::Script> script = v8::Script::Compile(source, &origin); 330 v8::Handle<v8::Script> script = v8::Script::Compile(source, &origin);
331 if (script.IsEmpty()) { 331 if (script.IsEmpty()) {
332 // Print errors that happened during compilation. 332 // Print errors that happened during compilation.
333 if (report_exceptions) 333 if (report_exceptions)
334 ReportException(isolate, &try_catch); 334 ReportException(isolate, &try_catch);
335 return false; 335 return false;
336 } else { 336 } else {
337 v8::Handle<v8::Value> result = script->Run(); 337 v8::Handle<v8::Value> result = script->Run();
338 if (result.IsEmpty()) { 338 if (result.IsEmpty()) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 fprintf(stderr, "^"); 385 fprintf(stderr, "^");
386 } 386 }
387 fprintf(stderr, "\n"); 387 fprintf(stderr, "\n");
388 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); 388 v8::String::Utf8Value stack_trace(try_catch->StackTrace());
389 if (stack_trace.length() > 0) { 389 if (stack_trace.length() > 0) {
390 const char* stack_trace_string = ToCString(stack_trace); 390 const char* stack_trace_string = ToCString(stack_trace);
391 fprintf(stderr, "%s\n", stack_trace_string); 391 fprintf(stderr, "%s\n", stack_trace_string);
392 } 392 }
393 } 393 }
394 } 394 }
OLDNEW
« no previous file with comments | « samples/process.cc ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698