| Index: Source/bindings/tests/results/core/V8TestDictionary.cpp
|
| diff --git a/Source/bindings/tests/results/core/V8TestDictionary.cpp b/Source/bindings/tests/results/core/V8TestDictionary.cpp
|
| index 88701ccda6fd1db612c79fb3321f45a6dfcb4c6a..d1c686363dd8049f0717f3b8016217a4efe37429 100644
|
| --- a/Source/bindings/tests/results/core/V8TestDictionary.cpp
|
| +++ b/Source/bindings/tests/results/core/V8TestDictionary.cpp
|
| @@ -30,78 +30,53 @@
|
| v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate);
|
| v8::TryCatch block;
|
| v8::Local<v8::Value> booleanMemberValue = v8Object->Get(v8String(isolate, "booleanMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!booleanMemberValue.IsEmpty() && !isUndefinedOrNull(booleanMemberValue)) {
|
| bool booleanMember = booleanMemberValue->BooleanValue();
|
| impl.setBooleanMember(booleanMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> createValue = v8Object->Get(v8String(isolate, "create"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (createValue.IsEmpty() || createValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!createValue.IsEmpty() && !isUndefinedOrNull(createValue)) {
|
| bool create = createValue->BooleanValue();
|
| impl.setCreateMember(create);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> doubleOrNullMemberValue = v8Object->Get(v8String(isolate, "doubleOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (doubleOrNullMemberValue->IsNull()) {
|
| - impl.setDoubleOrNullMemberToNull();
|
| - } else {
|
| + if (!doubleOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(doubleOrNullMemberValue)) {
|
| TONATIVE_VOID_EXCEPTIONSTATE(double, doubleOrNullMember, toDouble(doubleOrNullMemberValue, exceptionState), exceptionState);
|
| impl.setDoubleOrNullMember(doubleOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> doubleOrStringMemberValue = v8Object->Get(v8String(isolate, "doubleOrStringMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (doubleOrStringMemberValue.IsEmpty() || doubleOrStringMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!doubleOrStringMemberValue.IsEmpty() && !isUndefinedOrNull(doubleOrStringMemberValue)) {
|
| DoubleOrString doubleOrStringMember;
|
| TONATIVE_VOID_EXCEPTIONSTATE_ARGINTERNAL(V8DoubleOrString::toImpl(isolate, doubleOrStringMemberValue, doubleOrStringMember, exceptionState), exceptionState);
|
| impl.setDoubleOrStringMember(doubleOrStringMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> elementOrNullMemberValue = v8Object->Get(v8String(isolate, "elementOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (elementOrNullMemberValue.IsEmpty() || elementOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (elementOrNullMemberValue->IsNull()) {
|
| - impl.setElementOrNullMemberToNull();
|
| - } else {
|
| + if (!elementOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(elementOrNullMemberValue)) {
|
| Element* elementOrNullMember = V8Element::toImplWithTypeCheck(isolate, elementOrNullMemberValue);
|
| impl.setElementOrNullMember(elementOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> enumMemberValue = v8Object->Get(v8String(isolate, "enumMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (enumMemberValue.IsEmpty() || enumMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!enumMemberValue.IsEmpty() && !isUndefinedOrNull(enumMemberValue)) {
|
| TOSTRING_VOID(V8StringResource<>, enumMember, enumMemberValue);
|
| String string = enumMember;
|
| if (!(string == "foo" || string == "bar" || string == "baz")) {
|
| @@ -109,192 +84,143 @@
|
| return;
|
| }
|
| impl.setEnumMember(enumMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> internalDictionarySequenceMemberValue = v8Object->Get(v8String(isolate, "internalDictionarySequenceMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (internalDictionarySequenceMemberValue.IsEmpty() || internalDictionarySequenceMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!internalDictionarySequenceMemberValue.IsEmpty() && !isUndefinedOrNull(internalDictionarySequenceMemberValue)) {
|
| TONATIVE_VOID_EXCEPTIONSTATE(Vector<InternalDictionary>, internalDictionarySequenceMember, toImplArray<InternalDictionary>(internalDictionarySequenceMemberValue, 0, isolate, exceptionState), exceptionState);
|
| impl.setInternalDictionarySequenceMember(internalDictionarySequenceMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> longMemberValue = v8Object->Get(v8String(isolate, "longMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (longMemberValue.IsEmpty() || longMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!longMemberValue.IsEmpty() && !isUndefinedOrNull(longMemberValue)) {
|
| TONATIVE_VOID_EXCEPTIONSTATE(int, longMember, toInt32(longMemberValue, exceptionState), exceptionState);
|
| impl.setLongMember(longMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> objectMemberValue = v8Object->Get(v8String(isolate, "objectMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (objectMemberValue.IsEmpty() || objectMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!objectMemberValue.IsEmpty() && !isUndefinedOrNull(objectMemberValue)) {
|
| ScriptValue objectMember = ScriptValue(ScriptState::current(isolate), objectMemberValue);
|
| if (!objectMember.isObject()) {
|
| exceptionState.throwTypeError("member objectMember is not an object.");
|
| return;
|
| }
|
| impl.setObjectMember(objectMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> objectOrNullMemberValue = v8Object->Get(v8String(isolate, "objectOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (objectOrNullMemberValue.IsEmpty() || objectOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (objectOrNullMemberValue->IsNull()) {
|
| - impl.setObjectOrNullMemberToNull();
|
| - } else {
|
| + if (!objectOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(objectOrNullMemberValue)) {
|
| ScriptValue objectOrNullMember = ScriptValue(ScriptState::current(isolate), objectOrNullMemberValue);
|
| if (!objectOrNullMember.isObject()) {
|
| exceptionState.throwTypeError("member objectOrNullMember is not an object.");
|
| return;
|
| }
|
| impl.setObjectOrNullMember(objectOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> stringArrayMemberValue = v8Object->Get(v8String(isolate, "stringArrayMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (stringArrayMemberValue.IsEmpty() || stringArrayMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!stringArrayMemberValue.IsEmpty() && !isUndefinedOrNull(stringArrayMemberValue)) {
|
| TONATIVE_VOID_EXCEPTIONSTATE(Vector<String>, stringArrayMember, toImplArray<String>(stringArrayMemberValue, 0, isolate, exceptionState), exceptionState);
|
| impl.setStringArrayMember(stringArrayMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> stringMemberValue = v8Object->Get(v8String(isolate, "stringMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!stringMemberValue.IsEmpty() && !isUndefinedOrNull(stringMemberValue)) {
|
| TOSTRING_VOID(V8StringResource<>, stringMember, stringMemberValue);
|
| impl.setStringMember(stringMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> stringOrNullMemberValue = v8Object->Get(v8String(isolate, "stringOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (stringOrNullMemberValue.IsEmpty() || stringOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (stringOrNullMemberValue->IsNull()) {
|
| - impl.setStringOrNullMemberToNull();
|
| - } else {
|
| + if (!stringOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(stringOrNullMemberValue)) {
|
| TOSTRING_VOID(V8StringResource<>, stringOrNullMember, stringOrNullMemberValue);
|
| impl.setStringOrNullMember(stringOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> stringSequenceMemberValue = v8Object->Get(v8String(isolate, "stringSequenceMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (stringSequenceMemberValue.IsEmpty() || stringSequenceMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!stringSequenceMemberValue.IsEmpty() && !isUndefinedOrNull(stringSequenceMemberValue)) {
|
| TONATIVE_VOID_EXCEPTIONSTATE(Vector<String>, stringSequenceMember, toImplArray<String>(stringSequenceMemberValue, 0, isolate, exceptionState), exceptionState);
|
| impl.setStringSequenceMember(stringSequenceMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> testInterfaceGarbageCollectedMemberValue = v8Object->Get(v8String(isolate, "testInterfaceGarbageCollectedMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (testInterfaceGarbageCollectedMemberValue.IsEmpty() || testInterfaceGarbageCollectedMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!testInterfaceGarbageCollectedMemberValue.IsEmpty() && !isUndefinedOrNull(testInterfaceGarbageCollectedMemberValue)) {
|
| TestInterfaceGarbageCollected* testInterfaceGarbageCollectedMember = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceGarbageCollectedMemberValue);
|
| impl.setTestInterfaceGarbageCollectedMember(testInterfaceGarbageCollectedMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> testInterfaceGarbageCollectedOrNullMemberValue = v8Object->Get(v8String(isolate, "testInterfaceGarbageCollectedOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (testInterfaceGarbageCollectedOrNullMemberValue.IsEmpty() || testInterfaceGarbageCollectedOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (testInterfaceGarbageCollectedOrNullMemberValue->IsNull()) {
|
| - impl.setTestInterfaceGarbageCollectedOrNullMemberToNull();
|
| - } else {
|
| + if (!testInterfaceGarbageCollectedOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(testInterfaceGarbageCollectedOrNullMemberValue)) {
|
| TestInterfaceGarbageCollected* testInterfaceGarbageCollectedOrNullMember = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceGarbageCollectedOrNullMemberValue);
|
| impl.setTestInterfaceGarbageCollectedOrNullMember(testInterfaceGarbageCollectedOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> testInterfaceMemberValue = v8Object->Get(v8String(isolate, "testInterfaceMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (testInterfaceMemberValue.IsEmpty() || testInterfaceMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!testInterfaceMemberValue.IsEmpty() && !isUndefinedOrNull(testInterfaceMemberValue)) {
|
| TestInterfaceImplementation* testInterfaceMember = V8TestInterface::toImplWithTypeCheck(isolate, testInterfaceMemberValue);
|
| impl.setTestInterfaceMember(testInterfaceMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> testInterfaceOrNullMemberValue = v8Object->Get(v8String(isolate, "testInterfaceOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (testInterfaceOrNullMemberValue.IsEmpty() || testInterfaceOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (testInterfaceOrNullMemberValue->IsNull()) {
|
| - impl.setTestInterfaceOrNullMemberToNull();
|
| - } else {
|
| + if (!testInterfaceOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(testInterfaceOrNullMemberValue)) {
|
| TestInterfaceImplementation* testInterfaceOrNullMember = V8TestInterface::toImplWithTypeCheck(isolate, testInterfaceOrNullMemberValue);
|
| impl.setTestInterfaceOrNullMember(testInterfaceOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> testInterfaceWillBeGarbageCollectedMemberValue = v8Object->Get(v8String(isolate, "testInterfaceWillBeGarbageCollectedMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (testInterfaceWillBeGarbageCollectedMemberValue.IsEmpty() || testInterfaceWillBeGarbageCollectedMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else {
|
| + if (!testInterfaceWillBeGarbageCollectedMemberValue.IsEmpty() && !isUndefinedOrNull(testInterfaceWillBeGarbageCollectedMemberValue)) {
|
| TestInterfaceWillBeGarbageCollected* testInterfaceWillBeGarbageCollectedMember = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceWillBeGarbageCollectedMemberValue);
|
| impl.setTestInterfaceWillBeGarbageCollectedMember(testInterfaceWillBeGarbageCollectedMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| v8::Local<v8::Value> testInterfaceWillBeGarbageCollectedOrNullMemberValue = v8Object->Get(v8String(isolate, "testInterfaceWillBeGarbageCollectedOrNullMember"));
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return;
|
| - }
|
| - if (testInterfaceWillBeGarbageCollectedOrNullMemberValue.IsEmpty() || testInterfaceWillBeGarbageCollectedOrNullMemberValue->IsUndefined()) {
|
| - // Do nothing.
|
| - } else if (testInterfaceWillBeGarbageCollectedOrNullMemberValue->IsNull()) {
|
| - impl.setTestInterfaceWillBeGarbageCollectedOrNullMemberToNull();
|
| - } else {
|
| + if (!testInterfaceWillBeGarbageCollectedOrNullMemberValue.IsEmpty() && !isUndefinedOrNull(testInterfaceWillBeGarbageCollectedOrNullMemberValue)) {
|
| TestInterfaceWillBeGarbageCollected* testInterfaceWillBeGarbageCollectedOrNullMember = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceWillBeGarbageCollectedOrNullMemberValue);
|
| impl.setTestInterfaceWillBeGarbageCollectedOrNullMember(testInterfaceWillBeGarbageCollectedOrNullMember);
|
| + } else if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return;
|
| }
|
|
|
| }
|
|
|