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

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

Issue 17336003: remove all old style callbacks - patch 3 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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-log.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 de45cbcdb884a0061e01bffe51ed93ee8a36fa71..0f6bb8fff7063ce2da00ab79f32ba3c557b819fa 100644
--- a/test/cctest/test-decls.cc
+++ b/test/cctest/test-decls.cc
@@ -88,13 +88,13 @@ class DeclarationContext {
// The handlers are called as static functions that forward
// to the instance specific virtual methods.
- static v8::Handle<Value> HandleGet(Local<String> key,
- const AccessorInfo& info);
- static v8::Handle<Value> HandleSet(Local<String> key,
- Local<Value> value,
- const AccessorInfo& info);
- static v8::Handle<Integer> HandleQuery(Local<String> key,
- const AccessorInfo& info);
+ static void HandleGet(Local<String> key,
+ const v8::PropertyCallbackInfo<v8::Value>& info);
+ static void HandleSet(Local<String> key,
+ Local<Value> value,
+ const v8::PropertyCallbackInfo<v8::Value>& info);
+ static void HandleQuery(Local<String> key,
+ const v8::PropertyCallbackInfo<v8::Integer>& info);
private:
bool is_initialized_;
@@ -104,7 +104,7 @@ class DeclarationContext {
int set_count_;
int query_count_;
- static DeclarationContext* GetInstance(const AccessorInfo& info);
+ static DeclarationContext* GetInstance(Local<Value> data);
};
@@ -173,33 +173,36 @@ void DeclarationContext::Check(const char* source,
}
-v8::Handle<Value> DeclarationContext::HandleGet(Local<String> key,
- const AccessorInfo& info) {
- DeclarationContext* context = GetInstance(info);
+void DeclarationContext::HandleGet(
+ Local<String> key,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ DeclarationContext* context = GetInstance(info.Data());
context->get_count_++;
- return context->Get(key);
+ info.GetReturnValue().Set(context->Get(key));
}
-v8::Handle<Value> DeclarationContext::HandleSet(Local<String> key,
- Local<Value> value,
- const AccessorInfo& info) {
- DeclarationContext* context = GetInstance(info);
+void DeclarationContext::HandleSet(
+ Local<String> key,
+ Local<Value> value,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ DeclarationContext* context = GetInstance(info.Data());
context->set_count_++;
- return context->Set(key, value);
+ info.GetReturnValue().Set(context->Set(key, value));
}
-v8::Handle<Integer> DeclarationContext::HandleQuery(Local<String> key,
- const AccessorInfo& info) {
- DeclarationContext* context = GetInstance(info);
+void DeclarationContext::HandleQuery(
+ Local<String> key,
+ const v8::PropertyCallbackInfo<v8::Integer>& info) {
+ DeclarationContext* context = GetInstance(info.Data());
context->query_count_++;
- return context->Query(key);
+ info.GetReturnValue().Set(context->Query(key));
}
-DeclarationContext* DeclarationContext::GetInstance(const AccessorInfo& info) {
- void* value = External::Cast(*info.Data())->Value();
+DeclarationContext* DeclarationContext::GetInstance(Local<Value> data) {
+ void* value = Local<External>::Cast(data)->Value();
return static_cast<DeclarationContext*>(value);
}
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698