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