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

Side by Side Diff: samples/shell.cc

Issue 12033011: Add Isolate parameter to Persistent class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added explicit Created 7 years, 10 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 | « 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 v8::HandleScope handle_scope; 72 v8::HandleScope handle_scope;
73 v8::Persistent<v8::Context> context = CreateShellContext(); 73 v8::Persistent<v8::Context> context = CreateShellContext();
74 if (context.IsEmpty()) { 74 if (context.IsEmpty()) {
75 fprintf(stderr, "Error creating context\n"); 75 fprintf(stderr, "Error creating context\n");
76 return 1; 76 return 1;
77 } 77 }
78 context->Enter(); 78 context->Enter();
79 result = RunMain(argc, argv); 79 result = RunMain(argc, argv);
80 if (run_shell) RunShell(context); 80 if (run_shell) RunShell(context);
81 context->Exit(); 81 context->Exit();
82 context.Dispose(); 82 context.Dispose(context->GetIsolate());
83 } 83 }
84 v8::V8::Dispose(); 84 v8::V8::Dispose();
85 return result; 85 return result;
86 } 86 }
87 87
88 88
89 // Extracts a C string from a V8 Utf8Value. 89 // Extracts a C string from a V8 Utf8Value.
90 const char* ToCString(const v8::String::Utf8Value& value) { 90 const char* ToCString(const v8::String::Utf8Value& value) {
91 return *value ? *value : "<string conversion failed>"; 91 return *value ? *value : "<string conversion failed>";
92 } 92 }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 fprintf(stderr, "^"); 332 fprintf(stderr, "^");
333 } 333 }
334 fprintf(stderr, "\n"); 334 fprintf(stderr, "\n");
335 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); 335 v8::String::Utf8Value stack_trace(try_catch->StackTrace());
336 if (stack_trace.length() > 0) { 336 if (stack_trace.length() > 0) {
337 const char* stack_trace_string = ToCString(stack_trace); 337 const char* stack_trace_string = ToCString(stack_trace);
338 fprintf(stderr, "%s\n", stack_trace_string); 338 fprintf(stderr, "%s\n", stack_trace_string);
339 } 339 }
340 } 340 }
341 } 341 }
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