| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
| index 6c9bba15a8c15ec1194fa67912b6292d0e3adc00..733699669ed8c30bc737f9a25cd6c5d014ca564f 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
| @@ -54,281 +54,256 @@ static_assert(
|
|
|
| namespace TestTypedefsV8Internal {
|
|
|
| -static void uLongLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void uLongLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
|
|
| - v8SetReturnValue(info, static_cast<double>(impl->uLongLongAttribute()));
|
| + v8SetReturnValue(info, static_cast<double>(impl->uLongLongAttribute()));
|
| }
|
|
|
| -void uLongLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info);
|
| +void uLongLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info);
|
| }
|
|
|
| -static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
| +static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
|
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestTypedefs", "uLongLongAttribute");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestTypedefs", "uLongLongAttribute");
|
|
|
| - // Prepare the value to be set.
|
| - unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| + // Prepare the value to be set.
|
| + unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - impl->setULongLongAttribute(cppValue);
|
| + impl->setULongLongAttribute(cppValue);
|
| }
|
|
|
| -void uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info);
|
| + TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void domStringOrDoubleOrNullAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void domStringOrDoubleOrNullAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
|
|
| - StringOrDouble result;
|
| - impl->domStringOrDoubleOrNullAttribute(result);
|
| + StringOrDouble result;
|
| + impl->domStringOrDoubleOrNullAttribute(result);
|
|
|
| - v8SetReturnValue(info, result);
|
| + v8SetReturnValue(info, result);
|
| }
|
|
|
| -void domStringOrDoubleOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeGetter(info);
|
| +void domStringOrDoubleOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeGetter(info);
|
| }
|
|
|
| -static void domStringOrDoubleOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
| +static void domStringOrDoubleOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
|
|
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestTypedefs", "domStringOrDoubleOrNullAttribute");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestTypedefs", "domStringOrDoubleOrNullAttribute");
|
|
|
| - // Prepare the value to be set.
|
| - StringOrDouble cppValue;
|
| - V8StringOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::Nullable, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| + // Prepare the value to be set.
|
| + StringOrDouble cppValue;
|
| + V8StringOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::Nullable, exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - impl->setDomStringOrDoubleOrNullAttribute(cppValue);
|
| + impl->setDomStringOrDoubleOrNullAttribute(cppValue);
|
| }
|
|
|
| -void domStringOrDoubleOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void domStringOrDoubleOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeSetter(v8Value, info);
|
| + TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "voidMethodArrayOfLongsArg");
|
| -
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| -
|
| - Vector<int> arrayOfLongsArg;
|
| - int numArgsPassed = info.Length();
|
| - while (numArgsPassed > 0) {
|
| - if (!info[numArgsPassed - 1]->IsUndefined())
|
| - break;
|
| - --numArgsPassed;
|
| - }
|
| - if (UNLIKELY(numArgsPassed <= 0)) {
|
| - impl->voidMethodArrayOfLongsArg();
|
| - return;
|
| - }
|
| - arrayOfLongsArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| -
|
| - impl->voidMethodArrayOfLongsArg(arrayOfLongsArg);
|
| +static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "voidMethodArrayOfLongsArg");
|
| +
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| +
|
| + Vector<int> arrayOfLongsArg;
|
| + int numArgsPassed = info.Length();
|
| + while (numArgsPassed > 0) {
|
| + if (!info[numArgsPassed - 1]->IsUndefined())
|
| + break;
|
| + --numArgsPassed;
|
| + }
|
| + if (UNLIKELY(numArgsPassed <= 0)) {
|
| + impl->voidMethodArrayOfLongsArg();
|
| + return;
|
| + }
|
| + arrayOfLongsArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
| +
|
| + impl->voidMethodArrayOfLongsArg(arrayOfLongsArg);
|
| }
|
|
|
| -void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info);
|
| +void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info);
|
| }
|
|
|
| -static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "voidMethodFloatArgStringArg");
|
| +static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "voidMethodFloatArgStringArg");
|
|
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 2)) {
|
| - exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 2)) {
|
| + exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
|
| + return;
|
| + }
|
|
|
| - float floatArg;
|
| - V8StringResource<> stringArg;
|
| - floatArg = toRestrictedFloat(info.GetIsolate(), info[0], exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| + float floatArg;
|
| + V8StringResource<> stringArg;
|
| + floatArg = toRestrictedFloat(info.GetIsolate(), info[0], exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - stringArg = info[1];
|
| - if (!stringArg.prepare())
|
| - return;
|
| + stringArg = info[1];
|
| + if (!stringArg.prepare())
|
| + return;
|
|
|
| - impl->voidMethodFloatArgStringArg(floatArg, stringArg);
|
| + impl->voidMethodFloatArgStringArg(floatArg, stringArg);
|
| }
|
|
|
| -void voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::voidMethodFloatArgStringArgMethod(info);
|
| +void voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::voidMethodFloatArgStringArgMethod(info);
|
| }
|
|
|
| -static void voidMethodTestCallbackInterfaceTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| +static void voidMethodTestCallbackInterfaceTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceTypeArg", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceTypeArg", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| + return;
|
| + }
|
|
|
| - TestCallbackInterface* testCallbackInterfaceTypeArg;
|
| - if (info.Length() <= 0 || !info[0]->IsFunction()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceTypeArg", "TestTypedefs", "The callback provided as parameter 1 is not a function."));
|
| + TestCallbackInterface* testCallbackInterfaceTypeArg;
|
| + if (info.Length() <= 0 || !info[0]->IsFunction()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceTypeArg", "TestTypedefs", "The callback provided as parameter 1 is not a function."));
|
|
|
| - return;
|
| - }
|
| - testCallbackInterfaceTypeArg = V8TestCallbackInterface::create(v8::Local<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate()));
|
| + return;
|
| + }
|
| + testCallbackInterfaceTypeArg = V8TestCallbackInterface::create(v8::Local<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate()));
|
|
|
| - impl->voidMethodTestCallbackInterfaceTypeArg(testCallbackInterfaceTypeArg);
|
| + impl->voidMethodTestCallbackInterfaceTypeArg(testCallbackInterfaceTypeArg);
|
| }
|
|
|
| -void voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info);
|
| +void voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info);
|
| }
|
|
|
| -static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "uLongLongMethodTestInterfaceEmptyTypeSequenceArg");
|
| +static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "uLongLongMethodTestInterfaceEmptyTypeSequenceArg");
|
|
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
|
| + return;
|
| + }
|
|
|
| - HeapVector<Member<TestInterfaceEmpty>> testInterfaceEmptyTypeSequenceArg;
|
| - testInterfaceEmptyTypeSequenceArg = (toMemberNativeArray<TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState));
|
| - if (exceptionState.hadException())
|
| - return;
|
| + HeapVector<Member<TestInterfaceEmpty>> testInterfaceEmptyTypeSequenceArg;
|
| + testInterfaceEmptyTypeSequenceArg = (toMemberNativeArray<TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState));
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - v8SetReturnValue(info, static_cast<double>(impl->uLongLongMethodTestInterfaceEmptyTypeSequenceArg(testInterfaceEmptyTypeSequenceArg)));
|
| + v8SetReturnValue(info, static_cast<double>(impl->uLongLongMethodTestInterfaceEmptyTypeSequenceArg(testInterfaceEmptyTypeSequenceArg)));
|
| }
|
|
|
| -void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(info);
|
| +void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(info);
|
| }
|
|
|
| -static void testInterfaceOrTestInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| +static void testInterfaceOrTestInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - TestInterfaceOrTestInterfaceEmpty result;
|
| - impl->testInterfaceOrTestInterfaceEmptyMethod(result);
|
| - v8SetReturnValue(info, result);
|
| + TestInterfaceOrTestInterfaceEmpty result;
|
| + impl->testInterfaceOrTestInterfaceEmptyMethod(result);
|
| + v8SetReturnValue(info, result);
|
| }
|
|
|
| -void testInterfaceOrTestInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::testInterfaceOrTestInterfaceEmptyMethodMethod(info);
|
| +void testInterfaceOrTestInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::testInterfaceOrTestInterfaceEmptyMethodMethod(info);
|
| }
|
|
|
| -static void domStringOrDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| +static void domStringOrDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - StringOrDouble result;
|
| - impl->domStringOrDoubleMethod(result);
|
| - v8SetReturnValue(info, result);
|
| + StringOrDouble result;
|
| + impl->domStringOrDoubleMethod(result);
|
| + v8SetReturnValue(info, result);
|
| }
|
|
|
| -void domStringOrDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::domStringOrDoubleMethodMethod(info);
|
| +void domStringOrDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::domStringOrDoubleMethodMethod(info);
|
| }
|
|
|
| -static void arrayOfStringsMethodArrayOfStringsArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "arrayOfStringsMethodArrayOfStringsArg");
|
| +static void arrayOfStringsMethodArrayOfStringsArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "arrayOfStringsMethodArrayOfStringsArg");
|
|
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
|
| + return;
|
| + }
|
|
|
| - Vector<String> arrayOfStringsArg;
|
| - arrayOfStringsArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| + Vector<String> arrayOfStringsArg;
|
| + arrayOfStringsArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - v8SetReturnValue(info, toV8(impl->arrayOfStringsMethodArrayOfStringsArg(arrayOfStringsArg), info.Holder(), info.GetIsolate()));
|
| + v8SetReturnValue(info, toV8(impl->arrayOfStringsMethodArrayOfStringsArg(arrayOfStringsArg), info.Holder(), info.GetIsolate()));
|
| }
|
|
|
| -void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info);
|
| +void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info);
|
| }
|
|
|
| -static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "stringArrayMethodStringArrayArg");
|
| +static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestTypedefs", "stringArrayMethodStringArrayArg");
|
|
|
| - TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
| + TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
|
|
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
|
| - return;
|
| - }
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
|
| + return;
|
| + }
|
|
|
| - Vector<String> stringArrayArg;
|
| - stringArrayArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| + Vector<String> stringArrayArg;
|
| + stringArrayArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - v8SetReturnValue(info, toV8(impl->stringArrayMethodStringArrayArg(stringArrayArg), info.Holder(), info.GetIsolate()));
|
| + v8SetReturnValue(info, toV8(impl->stringArrayMethodStringArrayArg(stringArrayArg), info.Holder(), info.GetIsolate()));
|
| }
|
|
|
| -void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info);
|
| +void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info);
|
| }
|
|
|
| -static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - if (UNLIKELY(info.Length() < 1)) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| - return;
|
| - }
|
| -
|
| - V8StringResource<> stringArg;
|
| - stringArg = info[0];
|
| - if (!stringArg.prepare())
|
| - return;
|
| -
|
| - TestTypedefs* impl = TestTypedefs::create(stringArg);
|
| - v8::Local<v8::Object> wrapper = info.Holder();
|
| - wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestTypedefs::wrapperTypeInfo, wrapper);
|
| - v8SetReturnValue(info, wrapper);
|
| +static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + if (UNLIKELY(info.Length() < 1)) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())));
|
| + return;
|
| + }
|
| +
|
| + V8StringResource<> stringArg;
|
| + stringArg = info[0];
|
| + if (!stringArg.prepare())
|
| + return;
|
| +
|
| + TestTypedefs* impl = TestTypedefs::create(stringArg);
|
| + v8::Local<v8::Object> wrapper = info.Holder();
|
| + wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestTypedefs::wrapperTypeInfo, wrapper);
|
| + v8SetReturnValue(info, wrapper);
|
| }
|
|
|
| } // namespace TestTypedefsV8Internal
|
| @@ -362,57 +337,51 @@ const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = {
|
| {"stringArrayMethodStringArrayArg", TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype},
|
| };
|
|
|
| -void V8TestTypedefs::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - if (!info.IsConstructCall()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestTypedefs"));
|
| - return;
|
| - }
|
| +void V8TestTypedefs::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + if (!info.IsConstructCall()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestTypedefs"));
|
| + return;
|
| + }
|
|
|
| - if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
|
| - v8SetReturnValue(info, info.Holder());
|
| - return;
|
| - }
|
| + if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
|
| + v8SetReturnValue(info, info.Holder());
|
| + return;
|
| + }
|
|
|
| - TestTypedefsV8Internal::constructor(info);
|
| + TestTypedefsV8Internal::constructor(info);
|
| }
|
|
|
| -static void installV8TestTypedefsTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate)
|
| -{
|
| - // Initialize the interface object's template.
|
| - V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestTypedefs::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internalFieldCount);
|
| - interfaceTemplate->SetCallHandler(V8TestTypedefs::constructorCallback);
|
| - interfaceTemplate->SetLength(1);
|
| - 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::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes));
|
| - V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestTypedefsAccessors, WTF_ARRAY_LENGTH(V8TestTypedefsAccessors));
|
| - V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods));
|
| +static void installV8TestTypedefsTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
|
| + // Initialize the interface object's template.
|
| + V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestTypedefs::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internalFieldCount);
|
| + interfaceTemplate->SetCallHandler(V8TestTypedefs::constructorCallback);
|
| + interfaceTemplate->SetLength(1);
|
| + 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::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes));
|
| + V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestTypedefsAccessors, WTF_ARRAY_LENGTH(V8TestTypedefsAccessors));
|
| + V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods));
|
| }
|
|
|
| -v8::Local<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world)
|
| -{
|
| - return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestTypedefsTemplate);
|
| +v8::Local<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
|
| + return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestTypedefsTemplate);
|
| }
|
|
|
| -bool V8TestTypedefs::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
|
| -{
|
| - return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
|
| +bool V8TestTypedefs::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
|
| + return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
|
| }
|
|
|
| -v8::Local<v8::Object> V8TestTypedefs::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
|
| -{
|
| - return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
|
| +v8::Local<v8::Object> V8TestTypedefs::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
|
| + return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
|
| }
|
|
|
| -TestTypedefs* V8TestTypedefs::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
| -{
|
| - return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
|
| +TestTypedefs* V8TestTypedefs::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
|
|
|