Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1528)

Unified Diff: test/cctest/test-decls.cc

Issue 14793004: deprecate Context::New which returns Persistent (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: use Reset instead of operator= Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-hashing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-decls.cc
diff --git a/test/cctest/test-decls.cc b/test/cctest/test-decls.cc
index 6216d67bd8889e183bfc60447fdb94198341688a..6be5303cde4643fd85b75b362d40f7905652f063 100644
--- a/test/cctest/test-decls.cc
+++ b/test/cctest/test-decls.cc
@@ -118,7 +118,8 @@ DeclarationContext::DeclarationContext()
void DeclarationContext::InitializeIfNeeded() {
if (is_initialized_) return;
- HandleScope scope(Isolate::GetCurrent());
+ Isolate* isolate = Isolate::GetCurrent();
+ HandleScope scope(isolate);
Local<FunctionTemplate> function = FunctionTemplate::New();
Local<Value> data = External::New(this);
GetHolder(function)->SetNamedPropertyHandler(&HandleGet,
@@ -126,10 +127,14 @@ void DeclarationContext::InitializeIfNeeded() {
&HandleQuery,
0, 0,
data);
- context_ = Context::New(0, function->InstanceTemplate(), Local<Value>());
+ context_.Reset(isolate,
+ Context::New(isolate,
+ 0,
+ function->InstanceTemplate(),
+ Local<Value>()));
context_->Enter();
is_initialized_ = true;
- PostInitializeContext(Local<Context>::New(Isolate::GetCurrent(), context_));
+ PostInitializeContext(Local<Context>::New(isolate, context_));
}
@@ -699,14 +704,14 @@ TEST(ExistsInHiddenPrototype) {
class SimpleContext {
public:
- SimpleContext() {
- context_ = Context::New();
+ SimpleContext()
+ : handle_scope_(Isolate::GetCurrent()),
+ context_(Context::New(Isolate::GetCurrent())) {
context_->Enter();
}
- virtual ~SimpleContext() {
+ ~SimpleContext() {
context_->Exit();
- context_.Dispose(context_->GetIsolate());
}
void Check(const char* source,
@@ -737,7 +742,8 @@ class SimpleContext {
}
private:
- Persistent<Context> context_;
+ HandleScope handle_scope_;
+ Local<Context> context_;
};
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-hashing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698