| Index: test/cctest/test-heap.cc
|
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
|
| index 069ba2d5b19adc61c78f81c0b5761e905ffb343c..1de24ce88d4b62857859757698590d06133bf312 100644
|
| --- a/test/cctest/test-heap.cc
|
| +++ b/test/cctest/test-heap.cc
|
| @@ -1661,15 +1661,9 @@ static int NumberOfGlobalObjects() {
|
| // optimized code.
|
| TEST(LeakNativeContextViaMap) {
|
| i::FLAG_allow_natives_syntax = true;
|
| - v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| - v8::HandleScope outer_scope(isolate);
|
| - v8::Persistent<v8::Context> ctx1;
|
| - v8::Persistent<v8::Context> ctx2;
|
| - {
|
| - v8::HandleScope scope(isolate);
|
| - ctx1.Reset(isolate, v8::Context::New(isolate));
|
| - ctx2.Reset(isolate, v8::Context::New(isolate));
|
| - }
|
| + v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
|
| + v8::Persistent<v8::Context> ctx1 = v8::Context::New();
|
| + v8::Persistent<v8::Context> ctx2 = v8::Context::New();
|
| ctx1->Enter();
|
|
|
| HEAP->CollectAllAvailableGarbage();
|
| @@ -1705,15 +1699,9 @@ TEST(LeakNativeContextViaMap) {
|
| // optimized code.
|
| TEST(LeakNativeContextViaFunction) {
|
| i::FLAG_allow_natives_syntax = true;
|
| - v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| - v8::HandleScope outer_scope(isolate);
|
| - v8::Persistent<v8::Context> ctx1;
|
| - v8::Persistent<v8::Context> ctx2;
|
| - {
|
| - v8::HandleScope scope(isolate);
|
| - ctx1.Reset(isolate, v8::Context::New(isolate));
|
| - ctx2.Reset(isolate, v8::Context::New(isolate));
|
| - }
|
| + v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
|
| + v8::Persistent<v8::Context> ctx1 = v8::Context::New();
|
| + v8::Persistent<v8::Context> ctx2 = v8::Context::New();
|
| ctx1->Enter();
|
|
|
| HEAP->CollectAllAvailableGarbage();
|
| @@ -1747,15 +1735,9 @@ TEST(LeakNativeContextViaFunction) {
|
|
|
| TEST(LeakNativeContextViaMapKeyed) {
|
| i::FLAG_allow_natives_syntax = true;
|
| - v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| - v8::HandleScope outer_scope(isolate);
|
| - v8::Persistent<v8::Context> ctx1;
|
| - v8::Persistent<v8::Context> ctx2;
|
| - {
|
| - v8::HandleScope scope(isolate);
|
| - ctx1.Reset(isolate, v8::Context::New(isolate));
|
| - ctx2.Reset(isolate, v8::Context::New(isolate));
|
| - }
|
| + v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
|
| + v8::Persistent<v8::Context> ctx1 = v8::Context::New();
|
| + v8::Persistent<v8::Context> ctx2 = v8::Context::New();
|
| ctx1->Enter();
|
|
|
| HEAP->CollectAllAvailableGarbage();
|
| @@ -1789,15 +1771,9 @@ TEST(LeakNativeContextViaMapKeyed) {
|
|
|
| TEST(LeakNativeContextViaMapProto) {
|
| i::FLAG_allow_natives_syntax = true;
|
| - v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| - v8::HandleScope outer_scope(isolate);
|
| - v8::Persistent<v8::Context> ctx1;
|
| - v8::Persistent<v8::Context> ctx2;
|
| - {
|
| - v8::HandleScope scope(isolate);
|
| - ctx1.Reset(isolate, v8::Context::New(isolate));
|
| - ctx2.Reset(isolate, v8::Context::New(isolate));
|
| - }
|
| + v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
|
| + v8::Persistent<v8::Context> ctx1 = v8::Context::New();
|
| + v8::Persistent<v8::Context> ctx2 = v8::Context::New();
|
| ctx1->Enter();
|
|
|
| HEAP->CollectAllAvailableGarbage();
|
|
|