Index: test/cctest/test-debug.cc |
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc |
index d66d97f1337564287bcaf65572357b9523af0880..bb6f0a1c4c88c29f3ea4739b8d5ee147aff5edaa 100644 |
--- a/test/cctest/test-debug.cc |
+++ b/test/cctest/test-debug.cc |
@@ -29,6 +29,10 @@ |
#include <stdlib.h> |
+// TODO(dcarney): remove |
+#define V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW |
+#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT |
+ |
#include "v8.h" |
#include "api.h" |
@@ -5144,7 +5148,9 @@ void V8Thread::Run() { |
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
global_template->Set(v8::String::New("ThreadedAtBarrier1"), |
v8::FunctionTemplate::New(ThreadedAtBarrier1)); |
- v8::Handle<v8::Context> context = v8::Context::New(NULL, global_template); |
+ v8::Handle<v8::Context> context = v8::Context::New(v8::Isolate::GetCurrent(), |
+ NULL, |
+ global_template); |
v8::Context::Scope context_scope(context); |
CompileRun(source); |
@@ -5520,7 +5526,9 @@ TEST(CallFunctionInDebugger) { |
v8::FunctionTemplate::New(CheckDataParameter)); |
global_template->Set(v8::String::New("CheckClosure"), |
v8::FunctionTemplate::New(CheckClosure)); |
- v8::Handle<v8::Context> context = v8::Context::New(NULL, global_template); |
+ v8::Handle<v8::Context> context = v8::Context::New(v8::Isolate::GetCurrent(), |
+ NULL, |
+ global_template); |
v8::Context::Scope context_scope(context); |
// Compile a function for checking the number of JavaScript frames. |
@@ -6244,18 +6252,19 @@ static void ContextCheckMessageHandler(const v8::Debug::Message& message) { |
// Checks that this data is set correctly and that when the debug message |
// handler is called the expected context is the one active. |
TEST(ContextData) { |
- v8::HandleScope scope(v8::Isolate::GetCurrent()); |
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ v8::HandleScope scope(isolate); |
v8::Debug::SetMessageHandler2(ContextCheckMessageHandler); |
// Create two contexts. |
- v8::Persistent<v8::Context> context_1; |
- v8::Persistent<v8::Context> context_2; |
+ v8::Handle<v8::Context> context_1; |
+ v8::Handle<v8::Context> context_2; |
v8::Handle<v8::ObjectTemplate> global_template = |
v8::Handle<v8::ObjectTemplate>(); |
v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>(); |
- context_1 = v8::Context::New(NULL, global_template, global_object); |
- context_2 = v8::Context::New(NULL, global_template, global_object); |
+ context_1 = v8::Context::New(isolate, NULL, global_template, global_object); |
+ context_2 = v8::Context::New(isolate, NULL, global_template, global_object); |
// Default data value is undefined. |
CHECK(context_1->GetEmbedderData(0)->IsUndefined()); |
@@ -6275,7 +6284,7 @@ TEST(ContextData) { |
// Enter and run function in the first context. |
{ |
v8::Context::Scope context_scope(context_1); |
- expected_context = context_1; |
+ expected_context = v8::Persistent<v8::Context>(*context_1); |
expected_context_data = data_1; |
v8::Local<v8::Function> f = CompileFunction(source, "f"); |
f->Call(context_1->Global(), 0, NULL); |
@@ -6285,7 +6294,7 @@ TEST(ContextData) { |
// Enter and run function in the second context. |
{ |
v8::Context::Scope context_scope(context_2); |
- expected_context = context_2; |
+ expected_context = v8::Persistent<v8::Context>(*context_2); |
expected_context_data = data_2; |
v8::Local<v8::Function> f = CompileFunction(source, "f"); |
f->Call(context_2->Global(), 0, NULL); |
@@ -6416,10 +6425,11 @@ TEST(RegExpDebugBreak) { |
// Common part of EvalContextData and NestedBreakEventContextData tests. |
static void ExecuteScriptForContextCheck() { |
// Create a context. |
- v8::Persistent<v8::Context> context_1; |
+ v8::Handle<v8::Context> context_1; |
v8::Handle<v8::ObjectTemplate> global_template = |
v8::Handle<v8::ObjectTemplate>(); |
- context_1 = v8::Context::New(NULL, global_template); |
+ context_1 = |
+ v8::Context::New(v8::Isolate::GetCurrent(), NULL, global_template); |
// Default data value is undefined. |
CHECK(context_1->GetEmbedderData(0)->IsUndefined()); |
@@ -6435,7 +6445,7 @@ static void ExecuteScriptForContextCheck() { |
// Enter and run function in the context. |
{ |
v8::Context::Scope context_scope(context_1); |
- expected_context = context_1; |
+ expected_context = v8::Persistent<v8::Context>(*context_1); |
expected_context_data = data_1; |
v8::Local<v8::Function> f = CompileFunction(source, "f"); |
f->Call(context_1->Global(), 0, NULL); |
@@ -7075,7 +7085,8 @@ TEST(DebugEventContext) { |
v8::Debug::SetDebugEventListener2(DebugEventContextChecker, |
expected_callback_data); |
expected_context = v8::Context::New(); |
- v8::Context::Scope context_scope(expected_context); |
+ v8::Context::Scope context_scope( |
+ v8::Isolate::GetCurrent(), expected_context); |
v8::Script::Compile(v8::String::New("(function(){debugger;})();"))->Run(); |
expected_context.Dispose(expected_context->GetIsolate()); |
expected_context.Clear(); |