| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
|
| index 315123361049db040a77f4e057490260853ea8fa..ed7d67a8e5be22639713317f2893ccadcf402b8c 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
|
| @@ -52,250 +52,224 @@ static_assert(
|
|
|
| namespace TestCallbackFunctionsV8Internal {
|
|
|
| -static void voidCallbackFunctionAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void voidCallbackFunctionAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
|
|
| - v8SetReturnValueFast(info, impl->voidCallbackFunctionAttribute(), impl);
|
| + v8SetReturnValueFast(info, impl->voidCallbackFunctionAttribute(), impl);
|
| }
|
|
|
| -void voidCallbackFunctionAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::voidCallbackFunctionAttributeAttributeGetter(info);
|
| +void voidCallbackFunctionAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::voidCallbackFunctionAttributeAttributeGetter(info);
|
| }
|
|
|
| -static void voidCallbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
| +static void voidCallbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
|
|
| - // Prepare the value to be set.
|
| - VoidCallbackFunction* cppValue = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(v8Value));
|
| + // Prepare the value to be set.
|
| + VoidCallbackFunction* cppValue = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(v8Value));
|
|
|
| - impl->setVoidCallbackFunctionAttribute(cppValue);
|
| + impl->setVoidCallbackFunctionAttribute(cppValue);
|
| }
|
|
|
| -void voidCallbackFunctionAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void voidCallbackFunctionAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestCallbackFunctionsV8Internal::voidCallbackFunctionAttributeAttributeSetter(v8Value, info);
|
| + TestCallbackFunctionsV8Internal::voidCallbackFunctionAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
|
|
| - v8SetReturnValueFast(info, impl->anyCallbackFunctionOptionalAnyArgAttribute(), impl);
|
| + v8SetReturnValueFast(info, impl->anyCallbackFunctionOptionalAnyArgAttribute(), impl);
|
| }
|
|
|
| -void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(info);
|
| +void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(info);
|
| }
|
|
|
| -static void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
| +static void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
|
|
| - // Prepare the value to be set.
|
| - AnyCallbackFunctionOptionalAnyArg* cppValue = AnyCallbackFunctionOptionalAnyArg::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(v8Value));
|
| + // Prepare the value to be set.
|
| + AnyCallbackFunctionOptionalAnyArg* cppValue = AnyCallbackFunctionOptionalAnyArg::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(v8Value));
|
|
|
| - impl->setAnyCallbackFunctionOptionalAnyArgAttribute(cppValue);
|
| + impl->setAnyCallbackFunctionOptionalAnyArgAttribute(cppValue);
|
| }
|
|
|
| -void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestCallbackFunctionsV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8Value, info);
|
| + TestCallbackFunctionsV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void customElementsCallbacksReadonlyAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void customElementsCallbacksReadonlyAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(holder);
|
|
|
| - v8SetReturnValueInt(info, impl->customElementsCallbacksReadonlyAttribute());
|
| + v8SetReturnValueInt(info, impl->customElementsCallbacksReadonlyAttribute());
|
| }
|
|
|
| -void customElementsCallbacksReadonlyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::customElementsCallbacksReadonlyAttributeAttributeGetter(info);
|
| +void customElementsCallbacksReadonlyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::customElementsCallbacksReadonlyAttributeAttributeGetter(info);
|
| }
|
|
|
| -static void returnCallbackFunctionMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void returnCallbackFunctionMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - v8SetReturnValue(info, impl->returnCallbackFunctionMethod());
|
| + v8SetReturnValue(info, impl->returnCallbackFunctionMethod());
|
| }
|
|
|
| -void returnCallbackFunctionMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::returnCallbackFunctionMethodMethod(info);
|
| +void returnCallbackFunctionMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::returnCallbackFunctionMethodMethod(info);
|
| }
|
|
|
| -static void returnCallbackFunctionMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void returnCallbackFunctionMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - v8SetReturnValue(info, impl->returnCallbackFunctionMethod2());
|
| + v8SetReturnValue(info, impl->returnCallbackFunctionMethod2());
|
| }
|
|
|
| -void returnCallbackFunctionMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::returnCallbackFunctionMethod2Method(info);
|
| +void returnCallbackFunctionMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::returnCallbackFunctionMethod2Method(info);
|
| }
|
|
|
| -static void voidMethodCallbackFunctionInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void voidMethodCallbackFunctionInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| + return;
|
| + }
|
|
|
| - VoidCallbackFunction* voidCallbackFunctionArg;
|
| - if (!info[0]->IsFunction()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
| + VoidCallbackFunction* voidCallbackFunctionArg;
|
| + if (!info[0]->IsFunction()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
|
|
| - return;
|
| - }
|
| - voidCallbackFunctionArg = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
| + return;
|
| + }
|
| + voidCallbackFunctionArg = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
|
|
| - impl->voidMethodCallbackFunctionInArg(voidCallbackFunctionArg);
|
| + impl->voidMethodCallbackFunctionInArg(voidCallbackFunctionArg);
|
| }
|
|
|
| -void voidMethodCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionInArgMethod(info);
|
| +void voidMethodCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionInArgMethod(info);
|
| }
|
|
|
| -static void voidMethodCallbackFunctionInArg2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void voidMethodCallbackFunctionInArg2Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg2", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg2", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| + return;
|
| + }
|
|
|
| - AnyCallbackFunctionOptionalAnyArg* anyCallbackFunctionOptionalAnyArgArg;
|
| - if (!info[0]->IsFunction()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg2", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
| + AnyCallbackFunctionOptionalAnyArg* anyCallbackFunctionOptionalAnyArgArg;
|
| + if (!info[0]->IsFunction()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionInArg2", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
|
|
| - return;
|
| - }
|
| - anyCallbackFunctionOptionalAnyArgArg = AnyCallbackFunctionOptionalAnyArg::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
| + return;
|
| + }
|
| + anyCallbackFunctionOptionalAnyArgArg = AnyCallbackFunctionOptionalAnyArg::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
|
|
| - impl->voidMethodCallbackFunctionInArg2(anyCallbackFunctionOptionalAnyArgArg);
|
| + impl->voidMethodCallbackFunctionInArg2(anyCallbackFunctionOptionalAnyArgArg);
|
| }
|
|
|
| -void voidMethodCallbackFunctionInArg2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionInArg2Method(info);
|
| +void voidMethodCallbackFunctionInArg2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionInArg2Method(info);
|
| }
|
|
|
| -static void voidMethodCallbackFunctionWithReturnValueInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void voidMethodCallbackFunctionWithReturnValueInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionWithReturnValueInArg", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionWithReturnValueInArg", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| + return;
|
| + }
|
|
|
| - LongCallbackFunction* longCallbackFunctionArg;
|
| - if (!info[0]->IsFunction()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionWithReturnValueInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
| + LongCallbackFunction* longCallbackFunctionArg;
|
| + if (!info[0]->IsFunction()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodCallbackFunctionWithReturnValueInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
|
|
| - return;
|
| - }
|
| - longCallbackFunctionArg = LongCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
| + return;
|
| + }
|
| + longCallbackFunctionArg = LongCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
|
|
| - impl->voidMethodCallbackFunctionWithReturnValueInArg(longCallbackFunctionArg);
|
| + impl->voidMethodCallbackFunctionWithReturnValueInArg(longCallbackFunctionArg);
|
| }
|
|
|
| -void voidMethodCallbackFunctionWithReturnValueInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionWithReturnValueInArgMethod(info);
|
| +void voidMethodCallbackFunctionWithReturnValueInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::voidMethodCallbackFunctionWithReturnValueInArgMethod(info);
|
| }
|
|
|
| -static void voidMethodOptionalCallbackFunctionInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| -
|
| - VoidCallbackFunction* voidCallbackFunctionArg;
|
| - int numArgsPassed = info.Length();
|
| - while (numArgsPassed > 0) {
|
| - if (!info[numArgsPassed - 1]->IsUndefined())
|
| - break;
|
| - --numArgsPassed;
|
| - }
|
| - if (UNLIKELY(numArgsPassed <= 0)) {
|
| - impl->voidMethodOptionalCallbackFunctionInArg();
|
| - return;
|
| - }
|
| - if (!info[0]->IsFunction()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodOptionalCallbackFunctionInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
| -
|
| - return;
|
| - }
|
| - voidCallbackFunctionArg = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
| -
|
| - impl->voidMethodOptionalCallbackFunctionInArg(voidCallbackFunctionArg);
|
| +static void voidMethodOptionalCallbackFunctionInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +
|
| + VoidCallbackFunction* voidCallbackFunctionArg;
|
| + int numArgsPassed = info.Length();
|
| + while (numArgsPassed > 0) {
|
| + if (!info[numArgsPassed - 1]->IsUndefined())
|
| + break;
|
| + --numArgsPassed;
|
| + }
|
| + if (UNLIKELY(numArgsPassed <= 0)) {
|
| + impl->voidMethodOptionalCallbackFunctionInArg();
|
| + return;
|
| + }
|
| + if (!info[0]->IsFunction()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodOptionalCallbackFunctionInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
| +
|
| + return;
|
| + }
|
| + voidCallbackFunctionArg = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
| +
|
| + impl->voidMethodOptionalCallbackFunctionInArg(voidCallbackFunctionArg);
|
| }
|
|
|
| -void voidMethodOptionalCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::voidMethodOptionalCallbackFunctionInArgMethod(info);
|
| +void voidMethodOptionalCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::voidMethodOptionalCallbackFunctionInArgMethod(info);
|
| }
|
|
|
| -static void voidMethodNullableCallbackFunctionInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void voidMethodNullableCallbackFunctionInArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodNullableCallbackFunctionInArg", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodNullableCallbackFunctionInArg", "TestCallbackFunctions", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| + return;
|
| + }
|
|
|
| - Nullable<VoidCallbackFunction*> voidCallbackFunctionArg;
|
| - if (!info[0]->IsFunction() && !info[0]->IsNull()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodNullableCallbackFunctionInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
| + Nullable<VoidCallbackFunction*> voidCallbackFunctionArg;
|
| + if (!info[0]->IsFunction() && !info[0]->IsNull()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodNullableCallbackFunctionInArg", "TestCallbackFunctions", "The callback provided as parameter 1 is not a function."));
|
|
|
| - return;
|
| - }
|
| - voidCallbackFunctionArg = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
| + return;
|
| + }
|
| + voidCallbackFunctionArg = VoidCallbackFunction::create(ScriptState::current(info.GetIsolate()), v8::Local<v8::Function>::Cast(info[0]));
|
|
|
| - impl->voidMethodNullableCallbackFunctionInArg(voidCallbackFunctionArg);
|
| + impl->voidMethodNullableCallbackFunctionInArg(voidCallbackFunctionArg);
|
| }
|
|
|
| -void voidMethodNullableCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::voidMethodNullableCallbackFunctionInArgMethod(info);
|
| +void voidMethodNullableCallbackFunctionInArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::voidMethodNullableCallbackFunctionInArgMethod(info);
|
| }
|
|
|
| -static void customElementCallbacksMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
| +static void customElementCallbacksMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctions* impl = V8TestCallbackFunctions::toImpl(info.Holder());
|
|
|
| - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
|
| + V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
|
|
|
| - impl->customElementCallbacksMethod();
|
| + impl->customElementCallbacksMethod();
|
| }
|
|
|
| -void customElementCallbacksMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestCallbackFunctionsV8Internal::customElementCallbacksMethodMethod(info);
|
| +void customElementCallbacksMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestCallbackFunctionsV8Internal::customElementCallbacksMethodMethod(info);
|
| }
|
|
|
| } // namespace TestCallbackFunctionsV8Internal
|
| @@ -317,39 +291,34 @@ const V8DOMConfiguration::MethodConfiguration V8TestCallbackFunctionsMethods[] =
|
| {"customElementCallbacksMethod", TestCallbackFunctionsV8Internal::customElementCallbacksMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype},
|
| };
|
|
|
| -static void installV8TestCallbackFunctionsTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate)
|
| -{
|
| - // Initialize the interface object's template.
|
| - V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestCallbackFunctions::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestCallbackFunctions::internalFieldCount);
|
| - v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
|
| - ALLOW_UNUSED_LOCAL(signature);
|
| - v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
|
| - ALLOW_UNUSED_LOCAL(instanceTemplate);
|
| - v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
|
| - ALLOW_UNUSED_LOCAL(prototypeTemplate);
|
| - // Register DOM constants, attributes and operations.
|
| - V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestCallbackFunctionsAccessors, WTF_ARRAY_LENGTH(V8TestCallbackFunctionsAccessors));
|
| - V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestCallbackFunctionsMethods, WTF_ARRAY_LENGTH(V8TestCallbackFunctionsMethods));
|
| +static void installV8TestCallbackFunctionsTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
|
| + // Initialize the interface object's template.
|
| + V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestCallbackFunctions::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestCallbackFunctions::internalFieldCount);
|
| + v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
|
| + ALLOW_UNUSED_LOCAL(signature);
|
| + v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
|
| + ALLOW_UNUSED_LOCAL(instanceTemplate);
|
| + v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
|
| + ALLOW_UNUSED_LOCAL(prototypeTemplate);
|
| + // Register DOM constants, attributes and operations.
|
| + V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestCallbackFunctionsAccessors, WTF_ARRAY_LENGTH(V8TestCallbackFunctionsAccessors));
|
| + V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestCallbackFunctionsMethods, WTF_ARRAY_LENGTH(V8TestCallbackFunctionsMethods));
|
| }
|
|
|
| -v8::Local<v8::FunctionTemplate> V8TestCallbackFunctions::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world)
|
| -{
|
| - return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestCallbackFunctionsTemplate);
|
| +v8::Local<v8::FunctionTemplate> V8TestCallbackFunctions::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
|
| + return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestCallbackFunctionsTemplate);
|
| }
|
|
|
| -bool V8TestCallbackFunctions::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
|
| -{
|
| - return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
|
| +bool V8TestCallbackFunctions::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
|
| + return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
|
| }
|
|
|
| -v8::Local<v8::Object> V8TestCallbackFunctions::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
|
| -{
|
| - return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
|
| +v8::Local<v8::Object> V8TestCallbackFunctions::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
|
| + return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
|
| }
|
|
|
| -TestCallbackFunctions* V8TestCallbackFunctions::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
| -{
|
| - return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
|
| +TestCallbackFunctions* V8TestCallbackFunctions::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) {
|
| + return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
|
| }
|
|
|
| -} // namespace blink
|
| +} // namespace blink
|
|
|