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

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

Issue 15038002: Revert "deprecate Context::New which returns Persistent" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 6be5303cde4643fd85b75b362d40f7905652f063..6216d67bd8889e183bfc60447fdb94198341688a 100644
--- a/test/cctest/test-decls.cc
+++ b/test/cctest/test-decls.cc
@@ -118,8 +118,7 @@ DeclarationContext::DeclarationContext()
void DeclarationContext::InitializeIfNeeded() {
if (is_initialized_) return;
- Isolate* isolate = Isolate::GetCurrent();
- HandleScope scope(isolate);
+ HandleScope scope(Isolate::GetCurrent());
Local<FunctionTemplate> function = FunctionTemplate::New();
Local<Value> data = External::New(this);
GetHolder(function)->SetNamedPropertyHandler(&HandleGet,
@@ -127,14 +126,10 @@ void DeclarationContext::InitializeIfNeeded() {
&HandleQuery,
0, 0,
data);
- context_.Reset(isolate,
- Context::New(isolate,
- 0,
- function->InstanceTemplate(),
- Local<Value>()));
+ context_ = Context::New(0, function->InstanceTemplate(), Local<Value>());
context_->Enter();
is_initialized_ = true;
- PostInitializeContext(Local<Context>::New(isolate, context_));
+ PostInitializeContext(Local<Context>::New(Isolate::GetCurrent(), context_));
}
@@ -704,14 +699,14 @@ TEST(ExistsInHiddenPrototype) {
class SimpleContext {
public:
- SimpleContext()
- : handle_scope_(Isolate::GetCurrent()),
- context_(Context::New(Isolate::GetCurrent())) {
+ SimpleContext() {
+ context_ = Context::New();
context_->Enter();
}
- ~SimpleContext() {
+ virtual ~SimpleContext() {
context_->Exit();
+ context_.Dispose(context_->GetIsolate());
}
void Check(const char* source,
@@ -742,8 +737,7 @@ class SimpleContext {
}
private:
- HandleScope handle_scope_;
- Local<Context> context_;
+ Persistent<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