Index: test/cctest/test-serialize.cc |
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
index 2ecc75b1cb9eb22b1a5c0674799566d8b4239431..92483fe9a54713ff31be975879b312adbec1aeba 100644 |
--- a/test/cctest/test-serialize.cc |
+++ b/test/cctest/test-serialize.cc |
@@ -799,18 +799,19 @@ TEST(SerializeToplevelIsolates) { |
const char* source = "function f() { return 'abc'; }; f() + 'def'"; |
v8::ScriptCompiler::CachedData* cache; |
- v8::Isolate* isolate = v8::Isolate::New(); |
+ v8::Isolate* isolate1 = v8::Isolate::New(); |
+ v8::Isolate* isolate2 = v8::Isolate::New(); |
{ |
- v8::Isolate::Scope iscope(isolate); |
- v8::HandleScope scope(isolate); |
- v8::Local<v8::Context> context = v8::Context::New(isolate); |
+ v8::Isolate::Scope iscope(isolate1); |
+ v8::HandleScope scope(isolate1); |
+ v8::Local<v8::Context> context = v8::Context::New(isolate1); |
v8::Context::Scope context_scope(context); |
v8::Local<v8::String> source_str = v8_str(source); |
v8::ScriptOrigin origin(v8_str("test")); |
v8::ScriptCompiler::Source source(source_str, origin); |
v8::Local<v8::UnboundScript> script = v8::ScriptCompiler::CompileUnbound( |
- isolate, &source, v8::ScriptCompiler::kProduceCodeCache); |
+ isolate1, &source, v8::ScriptCompiler::kProduceCodeCache); |
const v8::ScriptCompiler::CachedData* data = source.GetCachedData(); |
// Persist cached data. |
uint8_t* buffer = NewArray<uint8_t>(data->length); |
@@ -821,13 +822,12 @@ TEST(SerializeToplevelIsolates) { |
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
CHECK(result->ToString()->Equals(v8_str("abcdef"))); |
} |
- isolate->Dispose(); |
+ isolate1->Dispose(); |
- isolate = v8::Isolate::New(); |
{ |
- v8::Isolate::Scope iscope(isolate); |
- v8::HandleScope scope(isolate); |
- v8::Local<v8::Context> context = v8::Context::New(isolate); |
+ v8::Isolate::Scope iscope(isolate2); |
+ v8::HandleScope scope(isolate2); |
+ v8::Local<v8::Context> context = v8::Context::New(isolate2); |
v8::Context::Scope context_scope(context); |
v8::Local<v8::String> source_str = v8_str(source); |
@@ -835,12 +835,12 @@ TEST(SerializeToplevelIsolates) { |
v8::ScriptCompiler::Source source(source_str, origin, cache); |
v8::Local<v8::UnboundScript> script; |
{ |
- DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate)); |
+ DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
script = v8::ScriptCompiler::CompileUnbound( |
- isolate, &source, v8::ScriptCompiler::kConsumeCodeCache); |
+ isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
} |
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
CHECK(result->ToString()->Equals(v8_str("abcdef"))); |
} |
- isolate->Dispose(); |
+ isolate2->Dispose(); |
} |