Changeset 227985 in webkit
- Timestamp:
- Feb 1, 2018 3:33:19 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r227983 r227985 1 2018-02-01 Chris Dumez <cdumez@apple.com> 2 3 Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>() 4 https://bugs.webkit.org/show_bug.cgi?id=182392 5 <rdar://problem/37119215> 6 7 Reviewed by Geoffrey Garen. 8 9 Rebaseline existing test now that output is slightly different. 10 11 * fast/events/constructors/message-event-constructor-expected.txt: 12 1 13 2018-02-01 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
r207381 r227985 94 94 PASS new MessageEvent('eventType', { ports: NaN }).ports threw exception TypeError: Value is not a sequence. 95 95 PASS new MessageEvent('eventType', { get ports() { return 123; } }).ports threw exception TypeError: Value is not a sequence. 96 PASS new MessageEvent('eventType', { get ports() { throw 'MessageEvent Error'; } }) threw exception TypeError: Value is not a sequence.96 PASS new MessageEvent('eventType', { get ports() { throw 'MessageEvent Error'; } }) threw exception MessageEvent Error. 97 97 PASS new MessageEvent('eventType', { ports: {valueOf: function () { return [channel.port1, channel.port2, channel.port2]; } } }).ports[0] threw exception TypeError: Type error. 98 98 PASS new MessageEvent('eventType', { bubbles: true, cancelable: true, data: test_object, origin: 'wonderful', lastEventId: 'excellent', source: window, ports: [channel.port1, channel.port2, channel2.port1] }).bubbles is true -
trunk/LayoutTests/imported/w3c/ChangeLog
r227978 r227985 1 2018-02-01 Chris Dumez <cdumez@apple.com> 2 3 Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>() 4 https://bugs.webkit.org/show_bug.cgi?id=182392 5 <rdar://problem/37119215> 6 7 Reviewed by Geoffrey Garen. 8 9 Rebaseline WPT test now that all checks are passing. 10 11 * web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt: 12 1 13 2018-02-01 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt
r226086 r227985 8 8 PASS `lastEventId` is specified 9 9 PASS `source` is specified 10 FAIL `ports` is specified assert_throws: function "function () { 11 createEvent({ get ports() { throw { name: 'Error' }; } }); }" threw object "TypeError: Value is not a sequence" ("TypeError") expected object "[object Object]" ("Error") 10 PASS `ports` is specified 12 11 PASS all initial values are specified 13 12 -
trunk/Source/WebCore/ChangeLog
r227983 r227985 1 2018-02-01 Chris Dumez <cdumez@apple.com> 2 3 Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>() 4 https://bugs.webkit.org/show_bug.cgi?id=182392 5 <rdar://problem/37119215> 6 7 Reviewed by Geoffrey Garen. 8 9 Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(), 10 given that getting the property from the object can throw an exception. 11 12 No new tests, rebaselined existing test. 13 14 * bindings/scripts/CodeGeneratorJS.pm: 15 (GenerateDictionaryImplementationContent): 16 * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: 17 (WebCore::convertDictionary<TestCallbackInterface::Dictionary>): 18 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 19 (WebCore::convertDictionary<TestEventConstructor::Init>): 20 * bindings/scripts/test/JS/JSTestObj.cpp: 21 (WebCore::convertDictionary<TestObj::Dictionary>): 22 (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>): 23 (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>): 24 (WebCore::convertDictionary<AlternateDictionaryName>): 25 (WebCore::convertDictionary<TestObj::ParentDictionary>): 26 (WebCore::convertDictionary<TestObj::ChildDictionary>): 27 (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>): 28 (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>): 29 (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>): 30 * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: 31 (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>): 32 * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: 33 (WebCore::convertDictionary<DictionaryImplName>): 34 1 35 2018-02-01 Ryosuke Niwa <rniwa@webkit.org> 2 36 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r227701 r227985 2320 2320 2321 2321 # 4.2. Let value be an ECMAScript value, depending on Type(V): 2322 $result .= " JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, \"${key}\"));\n"; 2322 $result .= " JSValue ${key}Value;\n"; 2323 $result .= " if (isNullOrUndefined)\n"; 2324 $result .= " ${key}Value = jsUndefined();\n"; 2325 $result .= " else {\n"; 2326 $result .= " ${key}Value = object->get(&state, Identifier::fromString(&state, \"${key}\"));\n"; 2327 $result .= " RETURN_IF_EXCEPTION(throwScope, { });\n"; 2328 $result .= " }\n"; 2323 2329 2324 2330 my $IDLType = GetIDLType($typeScope, $type); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
r224309 r227985 91 91 } 92 92 TestCallbackInterface::Dictionary result; 93 JSValue optionalMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "optionalMember")); 93 JSValue optionalMemberValue; 94 if (isNullOrUndefined) 95 optionalMemberValue = jsUndefined(); 96 else { 97 optionalMemberValue = object->get(&state, Identifier::fromString(&state, "optionalMember")); 98 RETURN_IF_EXCEPTION(throwScope, { }); 99 } 94 100 if (!optionalMemberValue.isUndefined()) { 95 101 result.optionalMember = convert<IDLLong>(state, optionalMemberValue); 96 102 RETURN_IF_EXCEPTION(throwScope, { }); 97 103 } 98 JSValue requiredMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredMember")); 104 JSValue requiredMemberValue; 105 if (isNullOrUndefined) 106 requiredMemberValue = jsUndefined(); 107 else { 108 requiredMemberValue = object->get(&state, Identifier::fromString(&state, "requiredMember")); 109 RETURN_IF_EXCEPTION(throwScope, { }); 110 } 99 111 if (!requiredMemberValue.isUndefined()) { 100 112 result.requiredMember = convert<IDLUSVString>(state, requiredMemberValue); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
r227701 r227985 49 49 } 50 50 TestEventConstructor::Init result; 51 JSValue bubblesValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bubbles")); 51 JSValue bubblesValue; 52 if (isNullOrUndefined) 53 bubblesValue = jsUndefined(); 54 else { 55 bubblesValue = object->get(&state, Identifier::fromString(&state, "bubbles")); 56 RETURN_IF_EXCEPTION(throwScope, { }); 57 } 52 58 if (!bubblesValue.isUndefined()) { 53 59 result.bubbles = convert<IDLBoolean>(state, bubblesValue); … … 55 61 } else 56 62 result.bubbles = false; 57 JSValue cancelableValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "cancelable")); 63 JSValue cancelableValue; 64 if (isNullOrUndefined) 65 cancelableValue = jsUndefined(); 66 else { 67 cancelableValue = object->get(&state, Identifier::fromString(&state, "cancelable")); 68 RETURN_IF_EXCEPTION(throwScope, { }); 69 } 58 70 if (!cancelableValue.isUndefined()) { 59 71 result.cancelable = convert<IDLBoolean>(state, cancelableValue); … … 61 73 } else 62 74 result.cancelable = false; 63 JSValue composedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "composed")); 75 JSValue composedValue; 76 if (isNullOrUndefined) 77 composedValue = jsUndefined(); 78 else { 79 composedValue = object->get(&state, Identifier::fromString(&state, "composed")); 80 RETURN_IF_EXCEPTION(throwScope, { }); 81 } 64 82 if (!composedValue.isUndefined()) { 65 83 result.composed = convert<IDLBoolean>(state, composedValue); … … 67 85 } else 68 86 result.composed = false; 69 JSValue attr2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr2")); 87 JSValue attr2Value; 88 if (isNullOrUndefined) 89 attr2Value = jsUndefined(); 90 else { 91 attr2Value = object->get(&state, Identifier::fromString(&state, "attr2")); 92 RETURN_IF_EXCEPTION(throwScope, { }); 93 } 70 94 if (!attr2Value.isUndefined()) { 71 95 result.attr2 = convert<IDLDOMString>(state, attr2Value); … … 73 97 } else 74 98 result.attr2 = emptyString(); 75 JSValue attr3Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr3")); 99 JSValue attr3Value; 100 if (isNullOrUndefined) 101 attr3Value = jsUndefined(); 102 else { 103 attr3Value = object->get(&state, Identifier::fromString(&state, "attr3")); 104 RETURN_IF_EXCEPTION(throwScope, { }); 105 } 76 106 if (!attr3Value.isUndefined()) { 77 107 result.attr3 = convert<IDLDOMString>(state, attr3Value); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r227701 r227985 430 430 } 431 431 TestObj::Dictionary result; 432 JSValue annotatedTypeInSequenceMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "annotatedTypeInSequenceMember")); 432 JSValue annotatedTypeInSequenceMemberValue; 433 if (isNullOrUndefined) 434 annotatedTypeInSequenceMemberValue = jsUndefined(); 435 else { 436 annotatedTypeInSequenceMemberValue = object->get(&state, Identifier::fromString(&state, "annotatedTypeInSequenceMember")); 437 RETURN_IF_EXCEPTION(throwScope, { }); 438 } 433 439 if (!annotatedTypeInSequenceMemberValue.isUndefined()) { 434 440 result.annotatedTypeInSequenceMember = convert<IDLSequence<IDLClampAdaptor<IDLLong>>>(state, annotatedTypeInSequenceMemberValue); 435 441 RETURN_IF_EXCEPTION(throwScope, { }); 436 442 } 437 JSValue annotatedTypeInUnionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "annotatedTypeInUnionMember")); 443 JSValue annotatedTypeInUnionMemberValue; 444 if (isNullOrUndefined) 445 annotatedTypeInUnionMemberValue = jsUndefined(); 446 else { 447 annotatedTypeInUnionMemberValue = object->get(&state, Identifier::fromString(&state, "annotatedTypeInUnionMember")); 448 RETURN_IF_EXCEPTION(throwScope, { }); 449 } 438 450 if (!annotatedTypeInUnionMemberValue.isUndefined()) { 439 451 result.annotatedTypeInUnionMember = convert<IDLUnion<IDLDOMString, IDLClampAdaptor<IDLLong>>>(state, annotatedTypeInUnionMemberValue); 440 452 RETURN_IF_EXCEPTION(throwScope, { }); 441 453 } 442 JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyTypedefValue")); 454 JSValue anyTypedefValueValue; 455 if (isNullOrUndefined) 456 anyTypedefValueValue = jsUndefined(); 457 else { 458 anyTypedefValueValue = object->get(&state, Identifier::fromString(&state, "anyTypedefValue")); 459 RETURN_IF_EXCEPTION(throwScope, { }); 460 } 443 461 if (!anyTypedefValueValue.isUndefined()) { 444 462 result.anyTypedefValue = convert<IDLAny>(state, anyTypedefValueValue); … … 446 464 } else 447 465 result.anyTypedefValue = jsUndefined(); 448 JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValue")); 466 JSValue anyValueValue; 467 if (isNullOrUndefined) 468 anyValueValue = jsUndefined(); 469 else { 470 anyValueValue = object->get(&state, Identifier::fromString(&state, "anyValue")); 471 RETURN_IF_EXCEPTION(throwScope, { }); 472 } 449 473 if (!anyValueValue.isUndefined()) { 450 474 result.anyValue = convert<IDLAny>(state, anyValueValue); … … 452 476 } else 453 477 result.anyValue = jsUndefined(); 454 JSValue anyValueWithNullDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault")); 478 JSValue anyValueWithNullDefaultValue; 479 if (isNullOrUndefined) 480 anyValueWithNullDefaultValue = jsUndefined(); 481 else { 482 anyValueWithNullDefaultValue = object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault")); 483 RETURN_IF_EXCEPTION(throwScope, { }); 484 } 455 485 if (!anyValueWithNullDefaultValue.isUndefined()) { 456 486 result.anyValueWithNullDefault = convert<IDLAny>(state, anyValueWithNullDefaultValue); … … 458 488 } else 459 489 result.anyValueWithNullDefault = jsNull(); 460 JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithDefault")); 490 JSValue booleanWithDefaultValue; 491 if (isNullOrUndefined) 492 booleanWithDefaultValue = jsUndefined(); 493 else { 494 booleanWithDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithDefault")); 495 RETURN_IF_EXCEPTION(throwScope, { }); 496 } 461 497 if (!booleanWithDefaultValue.isUndefined()) { 462 498 result.booleanWithDefault = convert<IDLBoolean>(state, booleanWithDefaultValue); … … 464 500 } else 465 501 result.booleanWithDefault = false; 466 JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 502 JSValue booleanWithoutDefaultValue; 503 if (isNullOrUndefined) 504 booleanWithoutDefaultValue = jsUndefined(); 505 else { 506 booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 507 RETURN_IF_EXCEPTION(throwScope, { }); 508 } 467 509 if (!booleanWithoutDefaultValue.isUndefined()) { 468 510 result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue); 469 511 RETURN_IF_EXCEPTION(throwScope, { }); 470 512 } 471 JSValue bufferSourceValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bufferSourceValue")); 513 JSValue bufferSourceValueValue; 514 if (isNullOrUndefined) 515 bufferSourceValueValue = jsUndefined(); 516 else { 517 bufferSourceValueValue = object->get(&state, Identifier::fromString(&state, "bufferSourceValue")); 518 RETURN_IF_EXCEPTION(throwScope, { }); 519 } 472 520 if (!bufferSourceValueValue.isUndefined()) { 473 521 result.bufferSourceValue = convert<IDLUnion<IDLArrayBufferView, IDLArrayBuffer>>(state, bufferSourceValueValue); 474 522 RETURN_IF_EXCEPTION(throwScope, { }); 475 523 } 476 JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "dictionaryMember")); 524 JSValue dictionaryMemberValue; 525 if (isNullOrUndefined) 526 dictionaryMemberValue = jsUndefined(); 527 else { 528 dictionaryMemberValue = object->get(&state, Identifier::fromString(&state, "dictionaryMember")); 529 RETURN_IF_EXCEPTION(throwScope, { }); 530 } 477 531 if (!dictionaryMemberValue.isUndefined()) { 478 532 result.dictionaryMember = convert<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, dictionaryMemberValue); 479 533 RETURN_IF_EXCEPTION(throwScope, { }); 480 534 } 481 JSValue enumerationValueWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault")); 535 JSValue enumerationValueWithDefaultValue; 536 if (isNullOrUndefined) 537 enumerationValueWithDefaultValue = jsUndefined(); 538 else { 539 enumerationValueWithDefaultValue = object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault")); 540 RETURN_IF_EXCEPTION(throwScope, { }); 541 } 482 542 if (!enumerationValueWithDefaultValue.isUndefined()) { 483 543 result.enumerationValueWithDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithDefaultValue); … … 485 545 } else 486 546 result.enumerationValueWithDefault = TestObj::EnumType::EnumValue1; 487 JSValue enumerationValueWithEmptyStringDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault")); 547 JSValue enumerationValueWithEmptyStringDefaultValue; 548 if (isNullOrUndefined) 549 enumerationValueWithEmptyStringDefaultValue = jsUndefined(); 550 else { 551 enumerationValueWithEmptyStringDefaultValue = object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault")); 552 RETURN_IF_EXCEPTION(throwScope, { }); 553 } 488 554 if (!enumerationValueWithEmptyStringDefaultValue.isUndefined()) { 489 555 result.enumerationValueWithEmptyStringDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithEmptyStringDefaultValue); … … 491 557 } else 492 558 result.enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString; 493 JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault")); 559 JSValue enumerationValueWithoutDefaultValue; 560 if (isNullOrUndefined) 561 enumerationValueWithoutDefaultValue = jsUndefined(); 562 else { 563 enumerationValueWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault")); 564 RETURN_IF_EXCEPTION(throwScope, { }); 565 } 494 566 if (!enumerationValueWithoutDefaultValue.isUndefined()) { 495 567 result.enumerationValueWithoutDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithoutDefaultValue); 496 568 RETURN_IF_EXCEPTION(throwScope, { }); 497 569 } 498 JSValue fooAliasValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "fooAlias")); 570 JSValue fooAliasValue; 571 if (isNullOrUndefined) 572 fooAliasValue = jsUndefined(); 573 else { 574 fooAliasValue = object->get(&state, Identifier::fromString(&state, "fooAlias")); 575 RETURN_IF_EXCEPTION(throwScope, { }); 576 } 499 577 if (!fooAliasValue.isUndefined()) { 500 578 result.foo = convert<IDLAny>(state, fooAliasValue); … … 502 580 } else 503 581 result.foo = jsUndefined(); 504 JSValue fooWithDefaultAliasValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "fooWithDefaultAlias")); 582 JSValue fooWithDefaultAliasValue; 583 if (isNullOrUndefined) 584 fooWithDefaultAliasValue = jsUndefined(); 585 else { 586 fooWithDefaultAliasValue = object->get(&state, Identifier::fromString(&state, "fooWithDefaultAlias")); 587 RETURN_IF_EXCEPTION(throwScope, { }); 588 } 505 589 if (!fooWithDefaultAliasValue.isUndefined()) { 506 590 result.fooWithDefault = convert<IDLAny>(state, fooWithDefaultAliasValue); … … 508 592 } else 509 593 result.fooWithDefault = 0; 510 JSValue integerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integer")); 594 JSValue integerValue; 595 if (isNullOrUndefined) 596 integerValue = jsUndefined(); 597 else { 598 integerValue = object->get(&state, Identifier::fromString(&state, "integer")); 599 RETURN_IF_EXCEPTION(throwScope, { }); 600 } 511 601 if (!integerValue.isUndefined()) { 512 602 result.integer = convert<IDLLong>(state, integerValue); 513 603 RETURN_IF_EXCEPTION(throwScope, { }); 514 604 } 515 JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integerWithDefault")); 605 JSValue integerWithDefaultValue; 606 if (isNullOrUndefined) 607 integerWithDefaultValue = jsUndefined(); 608 else { 609 integerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "integerWithDefault")); 610 RETURN_IF_EXCEPTION(throwScope, { }); 611 } 516 612 if (!integerWithDefaultValue.isUndefined()) { 517 613 result.integerWithDefault = convert<IDLLong>(state, integerWithDefaultValue); … … 519 615 } else 520 616 result.integerWithDefault = 0; 521 JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeInteger")); 617 JSValue largeIntegerValue; 618 if (isNullOrUndefined) 619 largeIntegerValue = jsUndefined(); 620 else { 621 largeIntegerValue = object->get(&state, Identifier::fromString(&state, "largeInteger")); 622 RETURN_IF_EXCEPTION(throwScope, { }); 623 } 522 624 if (!largeIntegerValue.isUndefined()) { 523 625 result.largeInteger = convert<IDLLongLong>(state, largeIntegerValue); 524 626 RETURN_IF_EXCEPTION(throwScope, { }); 525 627 } 526 JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault")); 628 JSValue largeIntegerWithDefaultValue; 629 if (isNullOrUndefined) 630 largeIntegerWithDefaultValue = jsUndefined(); 631 else { 632 largeIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault")); 633 RETURN_IF_EXCEPTION(throwScope, { }); 634 } 527 635 if (!largeIntegerWithDefaultValue.isUndefined()) { 528 636 result.largeIntegerWithDefault = convert<IDLLongLong>(state, largeIntegerWithDefaultValue); … … 530 638 } else 531 639 result.largeIntegerWithDefault = 0; 532 JSValue nullableIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableIntegerWithDefault")); 640 JSValue nullableIntegerWithDefaultValue; 641 if (isNullOrUndefined) 642 nullableIntegerWithDefaultValue = jsUndefined(); 643 else { 644 nullableIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "nullableIntegerWithDefault")); 645 RETURN_IF_EXCEPTION(throwScope, { }); 646 } 533 647 if (!nullableIntegerWithDefaultValue.isUndefined()) { 534 648 result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue); … … 536 650 } else 537 651 result.nullableIntegerWithDefault = std::nullopt; 538 JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableNode")); 652 JSValue nullableNodeValue; 653 if (isNullOrUndefined) 654 nullableNodeValue = jsUndefined(); 655 else { 656 nullableNodeValue = object->get(&state, Identifier::fromString(&state, "nullableNode")); 657 RETURN_IF_EXCEPTION(throwScope, { }); 658 } 539 659 if (!nullableNodeValue.isUndefined()) { 540 660 result.nullableNode = convert<IDLNullable<IDLInterface<Node>>>(state, nullableNodeValue); … … 542 662 } else 543 663 result.nullableNode = nullptr; 544 JSValue nullableStringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableStringWithDefault")); 664 JSValue nullableStringWithDefaultValue; 665 if (isNullOrUndefined) 666 nullableStringWithDefaultValue = jsUndefined(); 667 else { 668 nullableStringWithDefaultValue = object->get(&state, Identifier::fromString(&state, "nullableStringWithDefault")); 669 RETURN_IF_EXCEPTION(throwScope, { }); 670 } 545 671 if (!nullableStringWithDefaultValue.isUndefined()) { 546 672 result.nullableStringWithDefault = convert<IDLNullable<IDLDOMString>>(state, nullableStringWithDefaultValue); … … 548 674 } else 549 675 result.nullableStringWithDefault = String(); 550 JSValue nullableUnionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableUnionMember")); 676 JSValue nullableUnionMemberValue; 677 if (isNullOrUndefined) 678 nullableUnionMemberValue = jsUndefined(); 679 else { 680 nullableUnionMemberValue = object->get(&state, Identifier::fromString(&state, "nullableUnionMember")); 681 RETURN_IF_EXCEPTION(throwScope, { }); 682 } 551 683 if (!nullableUnionMemberValue.isUndefined()) { 552 684 result.nullableUnionMember = convert<IDLNullable<IDLUnion<IDLLong, IDLInterface<Node>>>>(state, nullableUnionMemberValue); … … 554 686 } else 555 687 result.nullableUnionMember = std::nullopt; 556 JSValue requiredBufferSourceValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredBufferSourceValue")); 688 JSValue requiredBufferSourceValueValue; 689 if (isNullOrUndefined) 690 requiredBufferSourceValueValue = jsUndefined(); 691 else { 692 requiredBufferSourceValueValue = object->get(&state, Identifier::fromString(&state, "requiredBufferSourceValue")); 693 RETURN_IF_EXCEPTION(throwScope, { }); 694 } 557 695 if (!requiredBufferSourceValueValue.isUndefined()) { 558 696 result.requiredBufferSourceValue = convert<IDLUnion<IDLArrayBufferView, IDLArrayBuffer>>(state, requiredBufferSourceValueValue); … … 562 700 return { }; 563 701 } 564 JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDouble")); 702 JSValue restrictedDoubleValue; 703 if (isNullOrUndefined) 704 restrictedDoubleValue = jsUndefined(); 705 else { 706 restrictedDoubleValue = object->get(&state, Identifier::fromString(&state, "restrictedDouble")); 707 RETURN_IF_EXCEPTION(throwScope, { }); 708 } 565 709 if (!restrictedDoubleValue.isUndefined()) { 566 710 result.restrictedDouble = convert<IDLDouble>(state, restrictedDoubleValue); 567 711 RETURN_IF_EXCEPTION(throwScope, { }); 568 712 } 569 JSValue restrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault")); 713 JSValue restrictedDoubleWithDefaultValue; 714 if (isNullOrUndefined) 715 restrictedDoubleWithDefaultValue = jsUndefined(); 716 else { 717 restrictedDoubleWithDefaultValue = object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault")); 718 RETURN_IF_EXCEPTION(throwScope, { }); 719 } 570 720 if (!restrictedDoubleWithDefaultValue.isUndefined()) { 571 721 result.restrictedDoubleWithDefault = convert<IDLDouble>(state, restrictedDoubleWithDefaultValue); … … 573 723 } else 574 724 result.restrictedDoubleWithDefault = 0; 575 JSValue restrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloat")); 725 JSValue restrictedFloatValue; 726 if (isNullOrUndefined) 727 restrictedFloatValue = jsUndefined(); 728 else { 729 restrictedFloatValue = object->get(&state, Identifier::fromString(&state, "restrictedFloat")); 730 RETURN_IF_EXCEPTION(throwScope, { }); 731 } 576 732 if (!restrictedFloatValue.isUndefined()) { 577 733 result.restrictedFloat = convert<IDLFloat>(state, restrictedFloatValue); 578 734 RETURN_IF_EXCEPTION(throwScope, { }); 579 735 } 580 JSValue restrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault")); 736 JSValue restrictedFloatWithDefaultValue; 737 if (isNullOrUndefined) 738 restrictedFloatWithDefaultValue = jsUndefined(); 739 else { 740 restrictedFloatWithDefaultValue = object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault")); 741 RETURN_IF_EXCEPTION(throwScope, { }); 742 } 581 743 if (!restrictedFloatWithDefaultValue.isUndefined()) { 582 744 result.restrictedFloatWithDefault = convert<IDLFloat>(state, restrictedFloatWithDefaultValue); … … 584 746 } else 585 747 result.restrictedFloatWithDefault = 0; 586 JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "sequenceOfStrings")); 748 JSValue sequenceOfStringsValue; 749 if (isNullOrUndefined) 750 sequenceOfStringsValue = jsUndefined(); 751 else { 752 sequenceOfStringsValue = object->get(&state, Identifier::fromString(&state, "sequenceOfStrings")); 753 RETURN_IF_EXCEPTION(throwScope, { }); 754 } 587 755 if (!sequenceOfStringsValue.isUndefined()) { 588 756 result.sequenceOfStrings = convert<IDLSequence<IDLDOMString>>(state, sequenceOfStringsValue); 589 757 RETURN_IF_EXCEPTION(throwScope, { }); 590 758 } 591 JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerClamped")); 759 JSValue smallIntegerClampedValue; 760 if (isNullOrUndefined) 761 smallIntegerClampedValue = jsUndefined(); 762 else { 763 smallIntegerClampedValue = object->get(&state, Identifier::fromString(&state, "smallIntegerClamped")); 764 RETURN_IF_EXCEPTION(throwScope, { }); 765 } 592 766 if (!smallIntegerClampedValue.isUndefined()) { 593 767 result.smallIntegerClamped = convert<IDLClampAdaptor<IDLByte>>(state, smallIntegerClampedValue); 594 768 RETURN_IF_EXCEPTION(throwScope, { }); 595 769 } 596 JSValue smallIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault")); 770 JSValue smallIntegerWithDefaultValue; 771 if (isNullOrUndefined) 772 smallIntegerWithDefaultValue = jsUndefined(); 773 else { 774 smallIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault")); 775 RETURN_IF_EXCEPTION(throwScope, { }); 776 } 597 777 if (!smallIntegerWithDefaultValue.isUndefined()) { 598 778 result.smallIntegerWithDefault = convert<IDLByte>(state, smallIntegerWithDefaultValue); 599 779 RETURN_IF_EXCEPTION(throwScope, { }); 600 780 } 601 JSValue smallUnsignedIntegerEnforcedRangeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange")); 781 JSValue smallUnsignedIntegerEnforcedRangeValue; 782 if (isNullOrUndefined) 783 smallUnsignedIntegerEnforcedRangeValue = jsUndefined(); 784 else { 785 smallUnsignedIntegerEnforcedRangeValue = object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange")); 786 RETURN_IF_EXCEPTION(throwScope, { }); 787 } 602 788 if (!smallUnsignedIntegerEnforcedRangeValue.isUndefined()) { 603 789 result.smallUnsignedIntegerEnforcedRange = convert<IDLEnforceRangeAdaptor<IDLOctet>>(state, smallUnsignedIntegerEnforcedRangeValue); 604 790 RETURN_IF_EXCEPTION(throwScope, { }); 605 791 } 606 JSValue smallUnsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault")); 792 JSValue smallUnsignedIntegerWithDefaultValue; 793 if (isNullOrUndefined) 794 smallUnsignedIntegerWithDefaultValue = jsUndefined(); 795 else { 796 smallUnsignedIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault")); 797 RETURN_IF_EXCEPTION(throwScope, { }); 798 } 607 799 if (!smallUnsignedIntegerWithDefaultValue.isUndefined()) { 608 800 result.smallUnsignedIntegerWithDefault = convert<IDLOctet>(state, smallUnsignedIntegerWithDefaultValue); … … 610 802 } else 611 803 result.smallUnsignedIntegerWithDefault = 0; 612 JSValue stringTreatNullAsEmptyStringValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringTreatNullAsEmptyString")); 804 JSValue stringTreatNullAsEmptyStringValue; 805 if (isNullOrUndefined) 806 stringTreatNullAsEmptyStringValue = jsUndefined(); 807 else { 808 stringTreatNullAsEmptyStringValue = object->get(&state, Identifier::fromString(&state, "stringTreatNullAsEmptyString")); 809 RETURN_IF_EXCEPTION(throwScope, { }); 810 } 613 811 if (!stringTreatNullAsEmptyStringValue.isUndefined()) { 614 812 result.stringTreatNullAsEmptyString = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, stringTreatNullAsEmptyStringValue); 615 813 RETURN_IF_EXCEPTION(throwScope, { }); 616 814 } 617 JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithDefault")); 815 JSValue stringWithDefaultValue; 816 if (isNullOrUndefined) 817 stringWithDefaultValue = jsUndefined(); 818 else { 819 stringWithDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithDefault")); 820 RETURN_IF_EXCEPTION(throwScope, { }); 821 } 618 822 if (!stringWithDefaultValue.isUndefined()) { 619 823 result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue); … … 621 825 } else 622 826 result.stringWithDefault = ASCIILiteral("defaultString"); 623 JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 827 JSValue stringWithoutDefaultValue; 828 if (isNullOrUndefined) 829 stringWithoutDefaultValue = jsUndefined(); 830 else { 831 stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 832 RETURN_IF_EXCEPTION(throwScope, { }); 833 } 624 834 if (!stringWithoutDefaultValue.isUndefined()) { 625 835 result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue); 626 836 RETURN_IF_EXCEPTION(throwScope, { }); 627 837 } 628 JSValue unionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unionMember")); 838 JSValue unionMemberValue; 839 if (isNullOrUndefined) 840 unionMemberValue = jsUndefined(); 841 else { 842 unionMemberValue = object->get(&state, Identifier::fromString(&state, "unionMember")); 843 RETURN_IF_EXCEPTION(throwScope, { }); 844 } 629 845 if (!unionMemberValue.isUndefined()) { 630 846 result.unionMember = convert<IDLUnion<IDLLong, IDLInterface<Node>>>(state, unionMemberValue); 631 847 RETURN_IF_EXCEPTION(throwScope, { }); 632 848 } 633 JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDouble")); 849 JSValue unrestrictedDoubleValue; 850 if (isNullOrUndefined) 851 unrestrictedDoubleValue = jsUndefined(); 852 else { 853 unrestrictedDoubleValue = object->get(&state, Identifier::fromString(&state, "unrestrictedDouble")); 854 RETURN_IF_EXCEPTION(throwScope, { }); 855 } 634 856 if (!unrestrictedDoubleValue.isUndefined()) { 635 857 result.unrestrictedDouble = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleValue); 636 858 RETURN_IF_EXCEPTION(throwScope, { }); 637 859 } 638 JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault")); 860 JSValue unrestrictedDoubleWithDefaultValue; 861 if (isNullOrUndefined) 862 unrestrictedDoubleWithDefaultValue = jsUndefined(); 863 else { 864 unrestrictedDoubleWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault")); 865 RETURN_IF_EXCEPTION(throwScope, { }); 866 } 639 867 if (!unrestrictedDoubleWithDefaultValue.isUndefined()) { 640 868 result.unrestrictedDoubleWithDefault = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleWithDefaultValue); … … 642 870 } else 643 871 result.unrestrictedDoubleWithDefault = 0; 644 JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloat")); 872 JSValue unrestrictedFloatValue; 873 if (isNullOrUndefined) 874 unrestrictedFloatValue = jsUndefined(); 875 else { 876 unrestrictedFloatValue = object->get(&state, Identifier::fromString(&state, "unrestrictedFloat")); 877 RETURN_IF_EXCEPTION(throwScope, { }); 878 } 645 879 if (!unrestrictedFloatValue.isUndefined()) { 646 880 result.unrestrictedFloat = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatValue); 647 881 RETURN_IF_EXCEPTION(throwScope, { }); 648 882 } 649 JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault")); 883 JSValue unrestrictedFloatWithDefaultValue; 884 if (isNullOrUndefined) 885 unrestrictedFloatWithDefaultValue = jsUndefined(); 886 else { 887 unrestrictedFloatWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault")); 888 RETURN_IF_EXCEPTION(throwScope, { }); 889 } 650 890 if (!unrestrictedFloatWithDefaultValue.isUndefined()) { 651 891 result.unrestrictedFloatWithDefault = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatWithDefaultValue); … … 653 893 } else 654 894 result.unrestrictedFloatWithDefault = 0; 655 JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedInteger")); 895 JSValue unsignedIntegerValue; 896 if (isNullOrUndefined) 897 unsignedIntegerValue = jsUndefined(); 898 else { 899 unsignedIntegerValue = object->get(&state, Identifier::fromString(&state, "unsignedInteger")); 900 RETURN_IF_EXCEPTION(throwScope, { }); 901 } 656 902 if (!unsignedIntegerValue.isUndefined()) { 657 903 result.unsignedInteger = convert<IDLUnsignedLong>(state, unsignedIntegerValue); 658 904 RETURN_IF_EXCEPTION(throwScope, { }); 659 905 } 660 JSValue unsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault")); 906 JSValue unsignedIntegerWithDefaultValue; 907 if (isNullOrUndefined) 908 unsignedIntegerWithDefaultValue = jsUndefined(); 909 else { 910 unsignedIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault")); 911 RETURN_IF_EXCEPTION(throwScope, { }); 912 } 661 913 if (!unsignedIntegerWithDefaultValue.isUndefined()) { 662 914 result.unsignedIntegerWithDefault = convert<IDLUnsignedLong>(state, unsignedIntegerWithDefaultValue); … … 664 916 } else 665 917 result.unsignedIntegerWithDefault = 0; 666 JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger")); 918 JSValue unsignedLargeIntegerValue; 919 if (isNullOrUndefined) 920 unsignedLargeIntegerValue = jsUndefined(); 921 else { 922 unsignedLargeIntegerValue = object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger")); 923 RETURN_IF_EXCEPTION(throwScope, { }); 924 } 667 925 if (!unsignedLargeIntegerValue.isUndefined()) { 668 926 result.unsignedLargeInteger = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerValue); 669 927 RETURN_IF_EXCEPTION(throwScope, { }); 670 928 } 671 JSValue unsignedLargeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault")); 929 JSValue unsignedLargeIntegerWithDefaultValue; 930 if (isNullOrUndefined) 931 unsignedLargeIntegerWithDefaultValue = jsUndefined(); 932 else { 933 unsignedLargeIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault")); 934 RETURN_IF_EXCEPTION(throwScope, { }); 935 } 672 936 if (!unsignedLargeIntegerWithDefaultValue.isUndefined()) { 673 937 result.unsignedLargeIntegerWithDefault = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerWithDefaultValue); … … 828 1092 } 829 1093 TestObj::DictionaryThatShouldNotTolerateNull result; 830 JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 1094 JSValue booleanWithoutDefaultValue; 1095 if (isNullOrUndefined) 1096 booleanWithoutDefaultValue = jsUndefined(); 1097 else { 1098 booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 1099 RETURN_IF_EXCEPTION(throwScope, { }); 1100 } 831 1101 if (!booleanWithoutDefaultValue.isUndefined()) { 832 1102 result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue); 833 1103 RETURN_IF_EXCEPTION(throwScope, { }); 834 1104 } 835 JSValue nonNullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nonNullableNode")); 1105 JSValue nonNullableNodeValue; 1106 if (isNullOrUndefined) 1107 nonNullableNodeValue = jsUndefined(); 1108 else { 1109 nonNullableNodeValue = object->get(&state, Identifier::fromString(&state, "nonNullableNode")); 1110 RETURN_IF_EXCEPTION(throwScope, { }); 1111 } 836 1112 if (!nonNullableNodeValue.isUndefined()) { 837 1113 result.nonNullableNode = convert<IDLInterface<Node>>(state, nonNullableNodeValue); … … 841 1117 return { }; 842 1118 } 843 JSValue requiredDictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember")); 1119 JSValue requiredDictionaryMemberValue; 1120 if (isNullOrUndefined) 1121 requiredDictionaryMemberValue = jsUndefined(); 1122 else { 1123 requiredDictionaryMemberValue = object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember")); 1124 RETURN_IF_EXCEPTION(throwScope, { }); 1125 } 844 1126 if (!requiredDictionaryMemberValue.isUndefined()) { 845 1127 result.requiredDictionaryMember = convert<IDLDictionary<TestObj::Dictionary>>(state, requiredDictionaryMemberValue); … … 849 1131 return { }; 850 1132 } 851 JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue")); 1133 JSValue requiredEnumerationValueValue; 1134 if (isNullOrUndefined) 1135 requiredEnumerationValueValue = jsUndefined(); 1136 else { 1137 requiredEnumerationValueValue = object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue")); 1138 RETURN_IF_EXCEPTION(throwScope, { }); 1139 } 852 1140 if (!requiredEnumerationValueValue.isUndefined()) { 853 1141 result.requiredEnumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, requiredEnumerationValueValue); … … 871 1159 } 872 1160 TestObj::DictionaryThatShouldTolerateNull result; 873 JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 1161 JSValue booleanWithoutDefaultValue; 1162 if (isNullOrUndefined) 1163 booleanWithoutDefaultValue = jsUndefined(); 1164 else { 1165 booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 1166 RETURN_IF_EXCEPTION(throwScope, { }); 1167 } 874 1168 if (!booleanWithoutDefaultValue.isUndefined()) { 875 1169 result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue); 876 1170 RETURN_IF_EXCEPTION(throwScope, { }); 877 1171 } 878 JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue")); 1172 JSValue enumerationValueValue; 1173 if (isNullOrUndefined) 1174 enumerationValueValue = jsUndefined(); 1175 else { 1176 enumerationValueValue = object->get(&state, Identifier::fromString(&state, "enumerationValue")); 1177 RETURN_IF_EXCEPTION(throwScope, { }); 1178 } 879 1179 if (!enumerationValueValue.isUndefined()) { 880 1180 result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue); … … 895 1195 } 896 1196 AlternateDictionaryName result; 897 JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 1197 JSValue booleanWithoutDefaultValue; 1198 if (isNullOrUndefined) 1199 booleanWithoutDefaultValue = jsUndefined(); 1200 else { 1201 booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault")); 1202 RETURN_IF_EXCEPTION(throwScope, { }); 1203 } 898 1204 if (!booleanWithoutDefaultValue.isUndefined()) { 899 1205 result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue); 900 1206 RETURN_IF_EXCEPTION(throwScope, { }); 901 1207 } 902 JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue")); 1208 JSValue enumerationValueValue; 1209 if (isNullOrUndefined) 1210 enumerationValueValue = jsUndefined(); 1211 else { 1212 enumerationValueValue = object->get(&state, Identifier::fromString(&state, "enumerationValue")); 1213 RETURN_IF_EXCEPTION(throwScope, { }); 1214 } 903 1215 if (!enumerationValueValue.isUndefined()) { 904 1216 result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue); … … 919 1231 } 920 1232 TestObj::ParentDictionary result; 921 JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1")); 1233 JSValue parentMember1Value; 1234 if (isNullOrUndefined) 1235 parentMember1Value = jsUndefined(); 1236 else { 1237 parentMember1Value = object->get(&state, Identifier::fromString(&state, "parentMember1")); 1238 RETURN_IF_EXCEPTION(throwScope, { }); 1239 } 922 1240 if (!parentMember1Value.isUndefined()) { 923 1241 result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value); 924 1242 RETURN_IF_EXCEPTION(throwScope, { }); 925 1243 } 926 JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2")); 1244 JSValue parentMember2Value; 1245 if (isNullOrUndefined) 1246 parentMember2Value = jsUndefined(); 1247 else { 1248 parentMember2Value = object->get(&state, Identifier::fromString(&state, "parentMember2")); 1249 RETURN_IF_EXCEPTION(throwScope, { }); 1250 } 927 1251 if (!parentMember2Value.isUndefined()) { 928 1252 result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value); … … 943 1267 } 944 1268 TestObj::ChildDictionary result; 945 JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1")); 1269 JSValue parentMember1Value; 1270 if (isNullOrUndefined) 1271 parentMember1Value = jsUndefined(); 1272 else { 1273 parentMember1Value = object->get(&state, Identifier::fromString(&state, "parentMember1")); 1274 RETURN_IF_EXCEPTION(throwScope, { }); 1275 } 946 1276 if (!parentMember1Value.isUndefined()) { 947 1277 result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value); 948 1278 RETURN_IF_EXCEPTION(throwScope, { }); 949 1279 } 950 JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2")); 1280 JSValue parentMember2Value; 1281 if (isNullOrUndefined) 1282 parentMember2Value = jsUndefined(); 1283 else { 1284 parentMember2Value = object->get(&state, Identifier::fromString(&state, "parentMember2")); 1285 RETURN_IF_EXCEPTION(throwScope, { }); 1286 } 951 1287 if (!parentMember2Value.isUndefined()) { 952 1288 result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value); 953 1289 RETURN_IF_EXCEPTION(throwScope, { }); 954 1290 } 955 JSValue childMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember1")); 1291 JSValue childMember1Value; 1292 if (isNullOrUndefined) 1293 childMember1Value = jsUndefined(); 1294 else { 1295 childMember1Value = object->get(&state, Identifier::fromString(&state, "childMember1")); 1296 RETURN_IF_EXCEPTION(throwScope, { }); 1297 } 956 1298 if (!childMember1Value.isUndefined()) { 957 1299 result.childMember1 = convert<IDLBoolean>(state, childMember1Value); 958 1300 RETURN_IF_EXCEPTION(throwScope, { }); 959 1301 } 960 JSValue childMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember2")); 1302 JSValue childMember2Value; 1303 if (isNullOrUndefined) 1304 childMember2Value = jsUndefined(); 1305 else { 1306 childMember2Value = object->get(&state, Identifier::fromString(&state, "childMember2")); 1307 RETURN_IF_EXCEPTION(throwScope, { }); 1308 } 961 1309 if (!childMember2Value.isUndefined()) { 962 1310 result.childMember2 = convert<IDLBoolean>(state, childMember2Value); … … 979 1327 } 980 1328 TestObj::ConditionalDictionaryA result; 981 JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 1329 JSValue stringWithoutDefaultValue; 1330 if (isNullOrUndefined) 1331 stringWithoutDefaultValue = jsUndefined(); 1332 else { 1333 stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 1334 RETURN_IF_EXCEPTION(throwScope, { }); 1335 } 982 1336 if (!stringWithoutDefaultValue.isUndefined()) { 983 1337 result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue); … … 1002 1356 } 1003 1357 TestObj::ConditionalDictionaryB result; 1004 JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 1358 JSValue stringWithoutDefaultValue; 1359 if (isNullOrUndefined) 1360 stringWithoutDefaultValue = jsUndefined(); 1361 else { 1362 stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 1363 RETURN_IF_EXCEPTION(throwScope, { }); 1364 } 1005 1365 if (!stringWithoutDefaultValue.isUndefined()) { 1006 1366 result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue); … … 1025 1385 } 1026 1386 TestObj::ConditionalDictionaryC result; 1027 JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 1387 JSValue stringWithoutDefaultValue; 1388 if (isNullOrUndefined) 1389 stringWithoutDefaultValue = jsUndefined(); 1390 else { 1391 stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault")); 1392 RETURN_IF_EXCEPTION(throwScope, { }); 1393 } 1028 1394 if (!stringWithoutDefaultValue.isUndefined()) { 1029 1395 result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp
r227701 r227985 53 53 } 54 54 TestPromiseRejectionEvent::Init result; 55 JSValue bubblesValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bubbles")); 55 JSValue bubblesValue; 56 if (isNullOrUndefined) 57 bubblesValue = jsUndefined(); 58 else { 59 bubblesValue = object->get(&state, Identifier::fromString(&state, "bubbles")); 60 RETURN_IF_EXCEPTION(throwScope, { }); 61 } 56 62 if (!bubblesValue.isUndefined()) { 57 63 result.bubbles = convert<IDLBoolean>(state, bubblesValue); … … 59 65 } else 60 66 result.bubbles = false; 61 JSValue cancelableValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "cancelable")); 67 JSValue cancelableValue; 68 if (isNullOrUndefined) 69 cancelableValue = jsUndefined(); 70 else { 71 cancelableValue = object->get(&state, Identifier::fromString(&state, "cancelable")); 72 RETURN_IF_EXCEPTION(throwScope, { }); 73 } 62 74 if (!cancelableValue.isUndefined()) { 63 75 result.cancelable = convert<IDLBoolean>(state, cancelableValue); … … 65 77 } else 66 78 result.cancelable = false; 67 JSValue composedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "composed")); 79 JSValue composedValue; 80 if (isNullOrUndefined) 81 composedValue = jsUndefined(); 82 else { 83 composedValue = object->get(&state, Identifier::fromString(&state, "composed")); 84 RETURN_IF_EXCEPTION(throwScope, { }); 85 } 68 86 if (!composedValue.isUndefined()) { 69 87 result.composed = convert<IDLBoolean>(state, composedValue); … … 71 89 } else 72 90 result.composed = false; 73 JSValue promiseValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "promise")); 91 JSValue promiseValue; 92 if (isNullOrUndefined) 93 promiseValue = jsUndefined(); 94 else { 95 promiseValue = object->get(&state, Identifier::fromString(&state, "promise")); 96 RETURN_IF_EXCEPTION(throwScope, { }); 97 } 74 98 if (!promiseValue.isUndefined()) { 75 99 result.promise = convert<IDLPromise<IDLAny>>(state, promiseValue); … … 79 103 return { }; 80 104 } 81 JSValue reasonValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "reason")); 105 JSValue reasonValue; 106 if (isNullOrUndefined) 107 reasonValue = jsUndefined(); 108 else { 109 reasonValue = object->get(&state, Identifier::fromString(&state, "reason")); 110 RETURN_IF_EXCEPTION(throwScope, { }); 111 } 82 112 if (!reasonValue.isUndefined()) { 83 113 result.reason = convert<IDLAny>(state, reasonValue); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
r223476 r227985 48 48 } 49 49 DictionaryImplName result; 50 JSValue boolMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "boolMember")); 50 JSValue boolMemberValue; 51 if (isNullOrUndefined) 52 boolMemberValue = jsUndefined(); 53 else { 54 boolMemberValue = object->get(&state, Identifier::fromString(&state, "boolMember")); 55 RETURN_IF_EXCEPTION(throwScope, { }); 56 } 51 57 if (!boolMemberValue.isUndefined()) { 52 58 result.boolMember = convert<IDLBoolean>(state, boolMemberValue); 53 59 RETURN_IF_EXCEPTION(throwScope, { }); 54 60 } 55 JSValue enumMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumMember")); 61 JSValue enumMemberValue; 62 if (isNullOrUndefined) 63 enumMemberValue = jsUndefined(); 64 else { 65 enumMemberValue = object->get(&state, Identifier::fromString(&state, "enumMember")); 66 RETURN_IF_EXCEPTION(throwScope, { }); 67 } 56 68 if (!enumMemberValue.isUndefined()) { 57 69 result.enumMember = convert<IDLEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>>(state, enumMemberValue); 58 70 RETURN_IF_EXCEPTION(throwScope, { }); 59 71 } 60 JSValue stringMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringMember")); 72 JSValue stringMemberValue; 73 if (isNullOrUndefined) 74 stringMemberValue = jsUndefined(); 75 else { 76 stringMemberValue = object->get(&state, Identifier::fromString(&state, "stringMember")); 77 RETURN_IF_EXCEPTION(throwScope, { }); 78 } 61 79 if (!stringMemberValue.isUndefined()) { 62 80 result.stringMember = convert<IDLDOMString>(state, stringMemberValue);
Note: See TracChangeset
for help on using the changeset viewer.