Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index f6a0931bcd312b13abe445e3789ce97c4c274ccb..1caa515a936a03976451885bb7677358d701a7ee 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -1855,10 +1855,9 @@ TEST(WeakGlobalHandle) { |
CHECK(!HasWeakGlobalHandle()); |
- v8::Persistent<v8::Object>* handle = |
- new v8::Persistent<v8::Object>(env->GetIsolate(), |
- v8::Object::New(env->GetIsolate())); |
- handle->SetWeak(handle, PersistentHandleCallback); |
+ v8::Persistent<v8::Object> handle(env->GetIsolate(), |
+ v8::Object::New(env->GetIsolate())); |
+ handle.SetWeak(&handle, PersistentHandleCallback); |
CHECK(HasWeakGlobalHandle()); |
} |