Chromium Code Reviews| Index: samples/shell.cc |
| diff --git a/samples/shell.cc b/samples/shell.cc |
| index 0b71c2c6dc0047dc8611dd1cdd881807dd7c8a93..f628d550cb59c926db313cf5d70fbe493fa09630 100644 |
| --- a/samples/shell.cc |
| +++ b/samples/shell.cc |
| @@ -25,6 +25,11 @@ |
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| +// TODO(dcarney): remove this |
| +#define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR |
| +#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT |
| +#define V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW |
| + |
| #include <v8.h> |
| #include <assert.h> |
| #include <fcntl.h> |
| @@ -45,7 +50,7 @@ |
| */ |
| -v8::Persistent<v8::Context> CreateShellContext(); |
| +v8::Handle<v8::Context> CreateShellContext(); |
| void RunShell(v8::Handle<v8::Context> context); |
| int RunMain(v8::Isolate* isolate, int argc, char* argv[]); |
| bool ExecuteString(v8::Isolate* isolate, |
| @@ -72,7 +77,7 @@ int main(int argc, char* argv[]) { |
| int result; |
| { |
| v8::HandleScope handle_scope(isolate); |
| - v8::Persistent<v8::Context> context = CreateShellContext(); |
| + v8::Handle<v8::Context> context = CreateShellContext(); |
| if (context.IsEmpty()) { |
| fprintf(stderr, "Error creating context\n"); |
| return 1; |
| @@ -81,7 +86,6 @@ int main(int argc, char* argv[]) { |
| result = RunMain(isolate, argc, argv); |
| if (run_shell) RunShell(context); |
| context->Exit(); |
| - context.Dispose(isolate); |
| } |
| v8::V8::Dispose(); |
| return result; |
| @@ -96,7 +100,7 @@ const char* ToCString(const v8::String::Utf8Value& value) { |
| // Creates a new execution environment containing the built-in |
| // functions. |
| -v8::Persistent<v8::Context> CreateShellContext() { |
| +v8::Handle<v8::Context> CreateShellContext() { |
| // Create a template for the global object. |
| v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); |
| // Bind the global 'print' function to the C++ Print callback. |
| @@ -110,7 +114,7 @@ v8::Persistent<v8::Context> CreateShellContext() { |
| // Bind the 'version' function |
| global->Set(v8::String::New("version"), v8::FunctionTemplate::New(Version)); |
| - return v8::Context::New(NULL, global); |
| + return v8::Context::New(v8::Isolate::GetCurrent(), NULL, global); |
|
Sven Panne
2013/04/30 07:31:22
While we're here, can we make this an argument? Th
|
| } |