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

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

Issue 112383002: IDL compiler: sync Python to r163665 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New test results Created 7 years 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/idls/TestTypedefs.idl ('k') | Source/bindings/tests/results/V8TestCallback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8SupportTestInterface.cpp
diff --git a/Source/bindings/tests/results/V8SupportTestInterface.cpp b/Source/bindings/tests/results/V8SupportTestInterface.cpp
index 9062629caff67d0af07dc536df0c8f15bc21fa60..f5f3904705b0eec8e1c9587d0b00308686400a11 100644
--- a/Source/bindings/tests/results/V8SupportTestInterface.cpp
+++ b/Source/bindings/tests/results/V8SupportTestInterface.cpp
@@ -326,9 +326,13 @@ static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
}
SupportTestInterface* imp = V8SupportTestInterface::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
- V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
+ if (info.Length() <= 1 || !info[1]->IsFunction()) {
+ throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2", "SupportTestInterface", "The callback provided as parameter 2 is not a function."), info.GetIsolate());
+ return;
+ }
+ OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext());
ExecutionContext* scriptContext = getExecutionContext();
- RefPtr<TestObj> result = SupportTestPartialInterface::supplementalMethod2(scriptContext, imp, strArg, objArg, exceptionState);
+ RefPtr<TestObj> result = SupportTestPartialInterface::supplementalMethod2(scriptContext, imp, strArg, objArg.release(), exceptionState);
if (exceptionState.throwIfNeeded())
return;
v8SetReturnValue(info, result.release());
@@ -391,6 +395,9 @@ static const V8DOMConfiguration::MethodConfiguration V8SupportTestInterfaceMetho
{"supplementalMethod1", SupportTestInterfaceV8Internal::supplementalMethod1MethodCallback, 0, 0},
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalMethod2", SupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, 0, 2},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
{"supplementalMethod3", SupportTestInterfaceV8Internal::supplementalMethod3MethodCallback, 0, 0},
#endif // ENABLE(Condition11) || ENABLE(Condition12)
};
@@ -422,14 +429,6 @@ static v8::Handle<v8::FunctionTemplate> ConfigureV8SupportTestInterfaceTemplate(
COMPILE_ASSERT(1 == SupportTestPartialInterface::SUPPLEMENTALCONSTANT1, TheValueOfSupportTestInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation);
COMPILE_ASSERT(2 == SupportTestPartialInterface::CONST_IMPL, TheValueOfSupportTestInterface_CONST_IMPLDoesntMatchWithImplementation);
#if ENABLE(Condition11) || ENABLE(Condition12)
-
- // Custom Signature 'supplementalMethod2'
- const int supplementalMethod2Argc = 2;
- v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
- v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(isolate, functionTemplate, supplementalMethod2Argc, supplementalMethod2Argv);
- prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "supplementalMethod2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, SupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined(), supplementalMethod2Signature, 2));
-#endif // ENABLE(Condition11) || ENABLE(Condition12)
-#if ENABLE(Condition11) || ENABLE(Condition12)
functionTemplate->Set(v8::String::NewFromUtf8(isolate, "supplementalMethod4", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, SupportTestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
« no previous file with comments | « Source/bindings/tests/idls/TestTypedefs.idl ('k') | Source/bindings/tests/results/V8TestCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698