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

Unified Diff: test/cctest/test-debug.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-compiler.cc ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index ed79205c223318912803a1932c1771ba2784b7ae..17da0d25dff64882da3cfee016839a6ace1bfeb3 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -4264,43 +4264,46 @@ TEST(NoBreakWhenBootstrapping) {
CheckDebuggerUnloaded();
}
-static v8::Handle<v8::Array> NamedEnum(const v8::AccessorInfo&) {
+static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
v8::Handle<v8::Array> result = v8::Array::New(3);
result->Set(v8::Integer::New(0), v8::String::New("a"));
result->Set(v8::Integer::New(1), v8::String::New("b"));
result->Set(v8::Integer::New(2), v8::String::New("c"));
- return result;
+ info.GetReturnValue().Set(result);
}
-static v8::Handle<v8::Array> IndexedEnum(const v8::AccessorInfo&) {
+static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
v8::Handle<v8::Array> result = v8::Array::New(2);
result->Set(v8::Integer::New(0), v8::Number::New(1));
result->Set(v8::Integer::New(1), v8::Number::New(10));
- return result;
+ info.GetReturnValue().Set(result);
}
-static v8::Handle<v8::Value> NamedGetter(v8::Local<v8::String> name,
- const v8::AccessorInfo& info) {
+static void NamedGetter(v8::Local<v8::String> name,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::String::Utf8Value n(name);
if (strcmp(*n, "a") == 0) {
- return v8::String::New("AA");
+ info.GetReturnValue().Set(v8::String::New("AA"));
+ return;
} else if (strcmp(*n, "b") == 0) {
- return v8::String::New("BB");
+ info.GetReturnValue().Set(v8::String::New("BB"));
+ return;
} else if (strcmp(*n, "c") == 0) {
- return v8::String::New("CC");
+ info.GetReturnValue().Set(v8::String::New("CC"));
+ return;
} else {
- return v8::Undefined();
+ info.GetReturnValue().SetUndefined();
+ return;
}
-
- return name;
+ info.GetReturnValue().Set(name);
}
-static v8::Handle<v8::Value> IndexedGetter(uint32_t index,
- const v8::AccessorInfo& info) {
- return v8::Number::New(index + 1);
+static void IndexedGetter(uint32_t index,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ info.GetReturnValue().Set(static_cast<double>(index + 1));
}
@@ -4530,9 +4533,10 @@ TEST(HiddenPrototypePropertyMirror) {
}
-static v8::Handle<v8::Value> ProtperyXNativeGetter(
- v8::Local<v8::String> property, const v8::AccessorInfo& info) {
- return v8::Integer::New(10);
+static void ProtperyXNativeGetter(
+ v8::Local<v8::String> property,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ info.GetReturnValue().Set(10);
}
@@ -4567,9 +4571,10 @@ TEST(NativeGetterPropertyMirror) {
}
-static v8::Handle<v8::Value> ProtperyXNativeGetterThrowingError(
- v8::Local<v8::String> property, const v8::AccessorInfo& info) {
- return CompileRun("throw new Error('Error message');");
+static void ProtperyXNativeGetterThrowingError(
+ v8::Local<v8::String> property,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ CompileRun("throw new Error('Error message');");
}
@@ -5112,9 +5117,9 @@ class DebuggerThread : public v8::internal::Thread {
};
-static v8::Handle<v8::Value> ThreadedAtBarrier1(const v8::Arguments& args) {
+static void ThreadedAtBarrier1(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
threaded_debugging_barriers.barrier_1.Wait();
- return v8::Undefined();
}
@@ -5480,28 +5485,27 @@ v8::Handle<v8::Function> debugger_call_with_closure;
// Function to retrieve the number of JavaScript frames by calling a JavaScript
// in the debugger.
-static v8::Handle<v8::Value> CheckFrameCount(const v8::Arguments& args) {
+static void CheckFrameCount(const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK(v8::Debug::Call(frame_count)->IsNumber());
CHECK_EQ(args[0]->Int32Value(),
v8::Debug::Call(frame_count)->Int32Value());
- return v8::Undefined();
}
// Function to retrieve the source line of the top JavaScript frame by calling a
// JavaScript function in the debugger.
-static v8::Handle<v8::Value> CheckSourceLine(const v8::Arguments& args) {
+static void CheckSourceLine(const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK(v8::Debug::Call(frame_source_line)->IsNumber());
CHECK_EQ(args[0]->Int32Value(),
v8::Debug::Call(frame_source_line)->Int32Value());
- return v8::Undefined();
}
// Function to test passing an additional parameter to a JavaScript function
// called in the debugger. It also tests that functions called in the debugger
// can throw exceptions.
-static v8::Handle<v8::Value> CheckDataParameter(const v8::Arguments& args) {
+static void CheckDataParameter(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Handle<v8::String> data = v8::String::New("Test");
CHECK(v8::Debug::Call(debugger_call_with_data, data)->IsString());
@@ -5512,16 +5516,13 @@ static v8::Handle<v8::Value> CheckDataParameter(const v8::Arguments& args) {
v8::Debug::Call(debugger_call_with_data);
CHECK(catcher.HasCaught());
CHECK(catcher.Exception()->IsString());
-
- return v8::Undefined();
}
// Function to test using a JavaScript with closure in the debugger.
-static v8::Handle<v8::Value> CheckClosure(const v8::Arguments& args) {
+static void CheckClosure(const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK(v8::Debug::Call(debugger_call_with_closure)->IsNumber());
CHECK_EQ(3, v8::Debug::Call(debugger_call_with_closure)->Int32Value());
- return v8::Undefined();
}
@@ -7017,9 +7018,9 @@ v8::Handle<v8::Context> debugger_context;
// Property getter that checks that current and calling contexts
// are both the debugee contexts.
-static v8::Handle<v8::Value> NamedGetterWithCallingContextCheck(
+static void NamedGetterWithCallingContextCheck(
v8::Local<v8::String> name,
- const v8::AccessorInfo& info) {
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
CHECK_EQ(0, strcmp(*v8::String::Utf8Value(name), "a"));
v8::Handle<v8::Context> current = v8::Context::GetCurrent();
CHECK(current == debugee_context);
@@ -7027,7 +7028,7 @@ static v8::Handle<v8::Value> NamedGetterWithCallingContextCheck(
v8::Handle<v8::Context> calling = v8::Context::GetCalling();
CHECK(calling == debugee_context);
CHECK(calling != debugger_context);
- return v8::Int32::New(1);
+ info.GetReturnValue().Set(1);
}
@@ -7302,11 +7303,10 @@ static void DebugEventBreakWithOptimizedStack(v8::DebugEvent event,
}
-static v8::Handle<v8::Value> ScheduleBreak(const v8::Arguments& args) {
+static void ScheduleBreak(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Debug::SetDebugEventListener(DebugEventBreakWithOptimizedStack,
v8::Undefined());
v8::Debug::DebugBreak();
- return v8::Undefined();
}
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698