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

Unified Diff: Source/bindings/tests/results/V8TestNode.cpp

Issue 15877002: move constructors to new style callbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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 | « Source/bindings/tests/results/V8TestNode.h ('k') | Source/bindings/tests/results/V8TestObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestNode.cpp
diff --git a/Source/bindings/tests/results/V8TestNode.cpp b/Source/bindings/tests/results/V8TestNode.cpp
index 22f42987c76f4df4fcec5872dee8d8d20f2929f9..e25bda15b6cd4eada0d758df2b9c82a5459bafab 100644
--- a/Source/bindings/tests/results/V8TestNode.cpp
+++ b/Source/bindings/tests/results/V8TestNode.cpp
@@ -59,27 +59,31 @@ namespace TestNodeV8Internal {
template <typename T> void V8_USE(T) { }
-static v8::Handle<v8::Value> constructor(const v8::Arguments& args)
+static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
{
RefPtr<TestNode> impl = TestNode::create();
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestNode::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
- return wrapper;
+ args.GetReturnValue().Set(wrapper);
}
} // namespace TestNodeV8Internal
-v8::Handle<v8::Value> V8TestNode::constructorCallback(const v8::Arguments& args)
+void V8TestNode::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
{
- if (!args.IsConstructCall())
- return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ if (!args.IsConstructCall()) {
+ throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return;
+ }
- if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
- return args.Holder();
+ if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
+ args.GetReturnValue().Set(args.Holder());
+ return;
+ }
- return TestNodeV8Internal::constructor(args);
+ TestNodeV8Internal::constructor(args);
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestNodeTemplate(v8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
« no previous file with comments | « Source/bindings/tests/results/V8TestNode.h ('k') | Source/bindings/tests/results/V8TestObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698