Changeset 196200 in webkit
- Timestamp:
- Feb 5, 2016 4:18:41 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196198 r196200 1 2016-02-05 Chris Dumez <cdumez@apple.com> 2 3 Instance property getters / setters cannot be called on another instance of the same type 4 https://bugs.webkit.org/show_bug.cgi?id=153895 5 6 Reviewed by Gavin Barraclough. 7 8 * js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: 9 * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: 10 Extend this layout test coverage to cover the getter case in addition to the 11 setter case. This test covers the compatibility mode where we don't throw. 12 I made sure to maintain this behavior when refactoring the bindings to avoid 13 breakage. 14 15 * js/instance-property-getter-other-instance-expected.txt: 16 Rebaseline now that this test passes. 17 18 * js/instance-property-setter-other-instance-expected.txt: Added. 19 * js/instance-property-setter-other-instance.html: Added. 20 Add test to cover the setter case. 21 22 1 23 2016-02-05 Ryan Haddad <ryanhaddad@apple.com> 2 24 -
trunk/LayoutTests/js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js
r169710 r196200 1 'use strict'; 2 1 3 description("Tests that we don't throw a type error in strict mode when assigning to an instance attribute that shadows navigator.geolocation. See <a href='https://bugs.webkit.org/show_bug.cgi?id=133559'>https://bugs.webkit.org/show_bug.cgi?id=133559</a>"); 2 4 … … 8 10 } 9 11 10 shouldNotThrow("'use strict'; var myNavigator = createObjectWithPrototype(window.navigator); myNavigator.geolocation = 1"); 12 var myNavigator = createObjectWithPrototype(window.navigator) 13 shouldBe("myNavigator.geolocation", "navigator.geolocation"); 14 shouldNotThrow("myNavigator.geolocation = 1"); 15 shouldBe("myNavigator.geolocation", "navigator.geolocation"); 11 16 12 17 window.jsTestIsAsync = false; -
trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt
r178527 r196200 1 CONSOLE MESSAGE: line 218: Deprecated attempt to access property 'geolocation' on a non-Navigator object. 1 2 CONSOLE MESSAGE: line 588: Deprecated attempt to set property 'geolocation' on a non-Navigator object. 3 CONSOLE MESSAGE: line 218: Deprecated attempt to access property 'geolocation' on a non-Navigator object. 2 4 Tests that we don't throw a type error in strict mode when assigning to an instance attribute that shadows navigator.geolocation. See https://bugs.webkit.org/show_bug.cgi?id=133559 3 5 … … 5 7 6 8 7 PASS 'use strict'; var myNavigator = createObjectWithPrototype(window.navigator); myNavigator.geolocation = 1 did not throw exception. 9 PASS myNavigator.geolocation is navigator.geolocation 10 PASS myNavigator.geolocation = 1 did not throw exception. 11 PASS myNavigator.geolocation is navigator.geolocation 8 12 PASS successfullyParsed is true 9 13 -
trunk/LayoutTests/js/instance-property-getter-other-instance-expected.txt
r196145 r196200 8 8 } 9 9 PASS locationGetter.call(otherWindow.document).toString() is "about:blank" 10 FAIL locationGetter.call(window.document) === window.document.location should be true. Was false. 10 PASS locationGetter.call(window.document) === window.document.location is true 11 11 PASS successfullyParsed is true 12 12 -
trunk/Source/WebCore/ChangeLog
r196191 r196200 1 2016-02-05 Chris Dumez <cdumez@apple.com> 2 3 Instance property getters / setters cannot be called on another instance of the same type 4 https://bugs.webkit.org/show_bug.cgi?id=153895 5 6 Reviewed by Gavin Barraclough. 7 8 It should be possible to call instance property getters / setters on 9 other instances of the same type, as per the WEB IDL specification: 10 - http://heycam.github.io/webidl/#dfn-attribute-getter 11 - http://heycam.github.io/webidl/#dfn-attribute-setter 12 13 This matches the behavior of Firefox. 14 15 The issue without our bindings was that the getters / setters were 16 using |slotBase| instead of |thisValue| and therefore ended up using 17 the instance the getter was taken from instead of the actual target 18 object. 19 20 Test: 21 js/instance-property-getter-other-instance.html 22 js/instance-property-setter-other-instance.html 23 24 * bindings/scripts/CodeGeneratorJS.pm: 25 (GenerateImplementation): 26 - Have instance getters / setters use thisValue instead of slotBase. 27 - In the case of interfaces that have attributes on the instance for 28 compatibility reasons, try the prototype object if |thisValue| does 29 does have the right type, instead of using slotBase like previously. 30 I believe this maintains the original compatibility intention while 31 also behaving correctly when called on another instance. 32 33 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: 34 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 35 * bindings/scripts/test/JS/JSTestException.cpp: 36 * bindings/scripts/test/JS/JSTestInterface.cpp: 37 * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: 38 * bindings/scripts/test/JS/JSTestNode.cpp: 39 * bindings/scripts/test/JS/JSTestNondeterministic.cpp: 40 * bindings/scripts/test/JS/JSTestObj.cpp: 41 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 42 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 43 * bindings/scripts/test/JS/JSattribute.cpp: 44 Rebaseline bindings tests. 45 1 46 2016-02-05 Brady Eidson <beidson@apple.com> 2 47 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r196145 r196200 2286 2286 push(@implContent, " UNUSED_PARAM(thisValue);\n"); 2287 2287 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { 2288 my $variableForTypeCheck = "castedThis";2289 2288 if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) { 2290 2289 push(@implContent, " auto* castedThis = to${className}(JSValue::decode(thisValue));\n"); 2291 } elsif (AttributeShouldBeOnInstance($interface, $attribute)) {2292 # FIXME: This does not seem right, we should likely use thisValue instead of slotBase here to match the specification:2293 # http://heycam.github.io/webidl/#dfn-attribute-getter2294 push(@implContent, " auto* castedThis = jsCast<JS${interfaceName}*>(slotBase);\n");2295 push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");2296 $variableForTypeCheck = "castedThisObject";2297 2290 } else { 2298 2291 push(@implContent, " ${className}* castedThis = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n"); 2299 2292 } 2300 # FIXME: Getters on a global should not require an explicit this. 2301 push(@implContent, " if (UNLIKELY(!$variableForTypeCheck))\n"); 2293 push(@implContent, " if (UNLIKELY(!castedThis)) {\n"); 2302 2294 if ($attribute->signature->extendedAttributes->{"LenientThis"}) { 2303 2295 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 2304 2296 } elsif (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) { 2297 # Fallback to trying to searching the prototype chain for compatibility reasons. 2298 push(@implContent, " JSObject* thisObject = JSValue::decode(thisValue).getObject();\n"); 2299 push(@implContent, " for (thisObject = thisObject ? thisObject->prototype().getObject() : nullptr; thisObject; thisObject = thisObject->prototype().getObject()) {\n"); 2300 push(@implContent, " if ((castedThis = " . GetCastingHelperForThisObject($interface) . "(thisObject)))\n"); 2301 push(@implContent, " break;\n"); 2302 push(@implContent, " }\n"); 2303 push(@implContent, " if (!castedThis)\n"); 2304 push(@implContent, " return throwGetterTypeError(*state, \"$interfaceName\", \"$name\");\n"); 2305 2305 push(@implContent, " reportDeprecatedGetterError(*state, \"$interfaceName\", \"$name\");\n"); 2306 2306 } else { 2307 2307 push(@implContent, " return throwGetterTypeError(*state, \"$interfaceName\", \"$name\");\n"); 2308 2308 } 2309 push(@implContent, " }\n"); 2309 2310 } 2310 2311 … … 2623 2624 push(@implContent, " UNUSED_PARAM(baseObject);\n"); 2624 2625 if (!$attribute->isStatic) { 2625 my $variableForTypeCheck = "castedThis";2626 2626 if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) { 2627 2627 push(@implContent, " ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n"); 2628 } elsif (AttributeShouldBeOnInstance($interface, $attribute)) {2629 push(@implContent, " auto* castedThis = jsCast<JS${interfaceName}*>(baseObject);\n");2630 push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");2631 $variableForTypeCheck = "castedThisObject";2632 2628 } else { 2633 2629 push(@implContent, " ${className}* castedThis = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n"); 2634 2630 } 2635 push(@implContent, " if (UNLIKELY(! $variableForTypeCheck)) {\n");2631 push(@implContent, " if (UNLIKELY(!castedThis)) {\n"); 2636 2632 if ($attribute->signature->extendedAttributes->{"LenientThis"}) { 2637 2633 push(@implContent, " return;\n"); 2638 2634 } elsif (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) { 2635 # Fallback to trying to searching the prototype chain for compatibility reasons. 2636 push(@implContent, " JSObject* thisObject = JSValue::decode(thisValue).getObject();\n"); 2637 push(@implContent, " for (thisObject = thisObject ? thisObject->prototype().getObject() : nullptr; thisObject; thisObject = thisObject->prototype().getObject()) {\n"); 2638 push(@implContent, " if ((castedThis = " . GetCastingHelperForThisObject($interface) . "(thisObject)))\n"); 2639 push(@implContent, " break;\n"); 2640 push(@implContent, " }\n"); 2641 push(@implContent, " if (!castedThis)\n"); 2642 push(@implContent, " return throwSetterTypeError(*state, \"$interfaceName\", \"$name\");\n"); 2639 2643 push(@implContent, " reportDeprecatedSetterError(*state, \"$interfaceName\", \"$name\");\n"); 2640 2644 } else { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
r196145 r196200 150 150 UNUSED_PARAM(slotBase); 151 151 UNUSED_PARAM(thisValue); 152 auto* castedThis = jsCast<JSTestActiveDOMObject*>(slotBase); 153 JSTestActiveDOMObject* castedThisObject = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); 154 if (UNLIKELY(!castedThisObject)) 152 JSTestActiveDOMObject* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); 153 if (UNLIKELY(!castedThis)) { 155 154 return throwGetterTypeError(*state, "TestActiveDOMObject", "excitingAttr"); 155 } 156 156 if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis->wrapped())) 157 157 return JSValue::encode(jsUndefined()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
r195907 r196200 163 163 UNUSED_PARAM(thisValue); 164 164 JSTestEventConstructor* castedThis = jsDynamicCast<JSTestEventConstructor*>(JSValue::decode(thisValue)); 165 if (UNLIKELY(!castedThis)) 165 if (UNLIKELY(!castedThis)) { 166 166 return throwGetterTypeError(*state, "TestEventConstructor", "attr1"); 167 } 167 168 auto& impl = castedThis->wrapped(); 168 169 JSValue result = jsStringWithCache(state, impl.attr1()); … … 177 178 UNUSED_PARAM(thisValue); 178 179 JSTestEventConstructor* castedThis = jsDynamicCast<JSTestEventConstructor*>(JSValue::decode(thisValue)); 179 if (UNLIKELY(!castedThis)) 180 if (UNLIKELY(!castedThis)) { 180 181 return throwGetterTypeError(*state, "TestEventConstructor", "attr2"); 182 } 181 183 auto& impl = castedThis->wrapped(); 182 184 JSValue result = jsStringWithCache(state, impl.attr2()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
r196145 r196200 140 140 UNUSED_PARAM(slotBase); 141 141 UNUSED_PARAM(thisValue); 142 auto* castedThis = jsCast<JSTestException*>(slotBase); 143 JSTestException* castedThisObject = jsDynamicCast<JSTestException*>(JSValue::decode(thisValue)); 144 if (UNLIKELY(!castedThisObject)) 142 JSTestException* castedThis = jsDynamicCast<JSTestException*>(JSValue::decode(thisValue)); 143 if (UNLIKELY(!castedThis)) { 145 144 return throwGetterTypeError(*state, "TestException", "name"); 145 } 146 146 auto& impl = castedThis->wrapped(); 147 147 JSValue result = jsStringWithCache(state, impl.name()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r195969 r196200 435 435 UNUSED_PARAM(thisValue); 436 436 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 437 if (UNLIKELY(!castedThis)) 437 if (UNLIKELY(!castedThis)) { 438 438 return throwGetterTypeError(*state, "TestInterface", "implementsStr1"); 439 } 439 440 auto& impl = castedThis->wrapped(); 440 441 JSValue result = jsStringWithCache(state, impl.implementsStr1()); … … 451 452 UNUSED_PARAM(thisValue); 452 453 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 453 if (UNLIKELY(!castedThis)) 454 if (UNLIKELY(!castedThis)) { 454 455 return throwGetterTypeError(*state, "TestInterface", "implementsStr2"); 456 } 455 457 auto& impl = castedThis->wrapped(); 456 458 JSValue result = jsStringWithCache(state, impl.implementsStr2()); … … 467 469 UNUSED_PARAM(thisValue); 468 470 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 469 if (UNLIKELY(!castedThis)) 471 if (UNLIKELY(!castedThis)) { 470 472 return throwGetterTypeError(*state, "TestInterface", "implementsStr3"); 473 } 471 474 return JSValue::encode(castedThis->implementsStr3(*state)); 472 475 } … … 481 484 UNUSED_PARAM(thisValue); 482 485 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 483 if (UNLIKELY(!castedThis)) 486 if (UNLIKELY(!castedThis)) { 484 487 return throwGetterTypeError(*state, "TestInterface", "implementsNode"); 488 } 485 489 auto& impl = castedThis->wrapped(); 486 490 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsNode())); … … 521 525 UNUSED_PARAM(thisValue); 522 526 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 523 if (UNLIKELY(!castedThis)) 527 if (UNLIKELY(!castedThis)) { 524 528 return throwGetterTypeError(*state, "TestInterface", "supplementalStr1"); 529 } 525 530 auto& impl = castedThis->wrapped(); 526 531 JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr1(impl)); … … 537 542 UNUSED_PARAM(thisValue); 538 543 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 539 if (UNLIKELY(!castedThis)) 544 if (UNLIKELY(!castedThis)) { 540 545 return throwGetterTypeError(*state, "TestInterface", "supplementalStr2"); 546 } 541 547 auto& impl = castedThis->wrapped(); 542 548 JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr2(impl)); … … 553 559 UNUSED_PARAM(thisValue); 554 560 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 555 if (UNLIKELY(!castedThis)) 561 if (UNLIKELY(!castedThis)) { 556 562 return throwGetterTypeError(*state, "TestInterface", "supplementalStr3"); 563 } 557 564 return JSValue::encode(castedThis->supplementalStr3(*state)); 558 565 } … … 567 574 UNUSED_PARAM(thisValue); 568 575 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 569 if (UNLIKELY(!castedThis)) 576 if (UNLIKELY(!castedThis)) { 570 577 return throwGetterTypeError(*state, "TestInterface", "supplementalNode"); 578 } 571 579 auto& impl = castedThis->wrapped(); 572 580 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalNode(impl))); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp
r195969 r196200 132 132 UNUSED_PARAM(thisValue); 133 133 JSTestJSBuiltinConstructor* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue)); 134 if (UNLIKELY(!castedThis)) 134 if (UNLIKELY(!castedThis)) { 135 135 return throwGetterTypeError(*state, "TestJSBuiltinConstructor", "testAttributeCustom"); 136 } 136 137 return JSValue::encode(castedThis->testAttributeCustom(*state)); 137 138 } … … 144 145 UNUSED_PARAM(thisValue); 145 146 JSTestJSBuiltinConstructor* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue)); 146 if (UNLIKELY(!castedThis)) 147 if (UNLIKELY(!castedThis)) { 147 148 return throwGetterTypeError(*state, "TestJSBuiltinConstructor", "testAttributeRWCustom"); 149 } 148 150 return JSValue::encode(castedThis->testAttributeRWCustom(*state)); 149 151 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
r195907 r196200 123 123 UNUSED_PARAM(thisValue); 124 124 JSTestNode* castedThis = jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue)); 125 if (UNLIKELY(!castedThis)) 125 if (UNLIKELY(!castedThis)) { 126 126 return throwGetterTypeError(*state, "TestNode", "name"); 127 } 127 128 auto& impl = castedThis->wrapped(); 128 129 JSValue result = jsStringWithCache(state, impl.name()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
r195907 r196200 144 144 UNUSED_PARAM(thisValue); 145 145 JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue)); 146 if (UNLIKELY(!castedThis)) 146 if (UNLIKELY(!castedThis)) { 147 147 return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicReadonlyAttr"); 148 } 148 149 #if ENABLE(WEB_REPLAY) 149 150 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 178 179 UNUSED_PARAM(thisValue); 179 180 JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue)); 180 if (UNLIKELY(!castedThis)) 181 if (UNLIKELY(!castedThis)) { 181 182 return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicWriteableAttr"); 183 } 182 184 #if ENABLE(WEB_REPLAY) 183 185 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 212 214 UNUSED_PARAM(thisValue); 213 215 JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue)); 214 if (UNLIKELY(!castedThis)) 216 if (UNLIKELY(!castedThis)) { 215 217 return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicExceptionAttr"); 218 } 216 219 #if ENABLE(WEB_REPLAY) 217 220 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 246 249 UNUSED_PARAM(thisValue); 247 250 JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue)); 248 if (UNLIKELY(!castedThis)) 251 if (UNLIKELY(!castedThis)) { 249 252 return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicGetterExceptionAttr"); 253 } 250 254 ExceptionCode ec = 0; 251 255 #if ENABLE(WEB_REPLAY) … … 284 288 UNUSED_PARAM(thisValue); 285 289 JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue)); 286 if (UNLIKELY(!castedThis)) 290 if (UNLIKELY(!castedThis)) { 287 291 return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicSetterExceptionAttr"); 292 } 288 293 #if ENABLE(WEB_REPLAY) 289 294 JSGlobalObject* globalObject = state->lexicalGlobalObject(); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r196145 r196200 749 749 UNUSED_PARAM(thisValue); 750 750 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 751 if (UNLIKELY(!castedThis)) 751 if (UNLIKELY(!castedThis)) { 752 752 return throwGetterTypeError(*state, "TestObj", "readOnlyLongAttr"); 753 } 753 754 auto& impl = castedThis->wrapped(); 754 755 JSValue result = jsNumber(impl.readOnlyLongAttr()); … … 763 764 UNUSED_PARAM(thisValue); 764 765 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 765 if (UNLIKELY(!castedThis)) 766 if (UNLIKELY(!castedThis)) { 766 767 return throwGetterTypeError(*state, "TestObj", "readOnlyStringAttr"); 768 } 767 769 auto& impl = castedThis->wrapped(); 768 770 JSValue result = jsStringWithCache(state, impl.readOnlyStringAttr()); … … 777 779 UNUSED_PARAM(thisValue); 778 780 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 779 if (UNLIKELY(!castedThis)) 781 if (UNLIKELY(!castedThis)) { 780 782 return throwGetterTypeError(*state, "TestObj", "readOnlyTestObjAttr"); 783 } 781 784 auto& impl = castedThis->wrapped(); 782 785 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.readOnlyTestObjAttr())); … … 810 813 UNUSED_PARAM(slotBase); 811 814 UNUSED_PARAM(thisValue); 812 auto* castedThis = jsCast<JSTestObj*>(slotBase); 813 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 814 if (UNLIKELY(!castedThisObject)) 815 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 816 if (UNLIKELY(!castedThis)) { 815 817 return throwGetterTypeError(*state, "TestObj", "TestSubObj"); 818 } 816 819 return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject())); 817 820 } … … 823 826 UNUSED_PARAM(slotBase); 824 827 UNUSED_PARAM(thisValue); 825 auto* castedThis = jsCast<JSTestObj*>(slotBase); 826 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 827 if (UNLIKELY(!castedThisObject)) 828 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 829 if (UNLIKELY(!castedThis)) { 828 830 return throwGetterTypeError(*state, "TestObj", "TestSubObjEnabledBySetting"); 831 } 829 832 if (!castedThis->wrapped().frame()) 830 833 return JSValue::encode(jsUndefined()); … … 842 845 UNUSED_PARAM(thisValue); 843 846 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 844 if (UNLIKELY(!castedThis)) 847 if (UNLIKELY(!castedThis)) { 845 848 return throwGetterTypeError(*state, "TestObj", "enumAttr"); 849 } 846 850 auto& impl = castedThis->wrapped(); 847 851 JSValue result = jsStringWithCache(state, impl.enumAttr()); … … 856 860 UNUSED_PARAM(thisValue); 857 861 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 858 if (UNLIKELY(!castedThis)) 862 if (UNLIKELY(!castedThis)) { 859 863 return throwGetterTypeError(*state, "TestObj", "byteAttr"); 864 } 860 865 auto& impl = castedThis->wrapped(); 861 866 JSValue result = jsNumber(impl.byteAttr()); … … 870 875 UNUSED_PARAM(thisValue); 871 876 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 872 if (UNLIKELY(!castedThis)) 877 if (UNLIKELY(!castedThis)) { 873 878 return throwGetterTypeError(*state, "TestObj", "octetAttr"); 879 } 874 880 auto& impl = castedThis->wrapped(); 875 881 JSValue result = jsNumber(impl.octetAttr()); … … 884 890 UNUSED_PARAM(thisValue); 885 891 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 886 if (UNLIKELY(!castedThis)) 892 if (UNLIKELY(!castedThis)) { 887 893 return throwGetterTypeError(*state, "TestObj", "shortAttr"); 894 } 888 895 auto& impl = castedThis->wrapped(); 889 896 JSValue result = jsNumber(impl.shortAttr()); … … 898 905 UNUSED_PARAM(thisValue); 899 906 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 900 if (UNLIKELY(!castedThis)) 907 if (UNLIKELY(!castedThis)) { 901 908 return throwGetterTypeError(*state, "TestObj", "unsignedShortAttr"); 909 } 902 910 auto& impl = castedThis->wrapped(); 903 911 JSValue result = jsNumber(impl.unsignedShortAttr()); … … 912 920 UNUSED_PARAM(thisValue); 913 921 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 914 if (UNLIKELY(!castedThis)) 922 if (UNLIKELY(!castedThis)) { 915 923 return throwGetterTypeError(*state, "TestObj", "longAttr"); 924 } 916 925 auto& impl = castedThis->wrapped(); 917 926 JSValue result = jsNumber(impl.longAttr()); … … 926 935 UNUSED_PARAM(thisValue); 927 936 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 928 if (UNLIKELY(!castedThis)) 937 if (UNLIKELY(!castedThis)) { 929 938 return throwGetterTypeError(*state, "TestObj", "longLongAttr"); 939 } 930 940 auto& impl = castedThis->wrapped(); 931 941 JSValue result = jsNumber(impl.longLongAttr()); … … 940 950 UNUSED_PARAM(thisValue); 941 951 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 942 if (UNLIKELY(!castedThis)) 952 if (UNLIKELY(!castedThis)) { 943 953 return throwGetterTypeError(*state, "TestObj", "unsignedLongLongAttr"); 954 } 944 955 auto& impl = castedThis->wrapped(); 945 956 JSValue result = jsNumber(impl.unsignedLongLongAttr()); … … 954 965 UNUSED_PARAM(thisValue); 955 966 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 956 if (UNLIKELY(!castedThis)) 967 if (UNLIKELY(!castedThis)) { 957 968 return throwGetterTypeError(*state, "TestObj", "stringAttr"); 969 } 958 970 auto& impl = castedThis->wrapped(); 959 971 JSValue result = jsStringWithCache(state, impl.stringAttr()); … … 968 980 UNUSED_PARAM(thisValue); 969 981 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 970 if (UNLIKELY(!castedThis)) 982 if (UNLIKELY(!castedThis)) { 971 983 return throwGetterTypeError(*state, "TestObj", "testObjAttr"); 984 } 972 985 auto& impl = castedThis->wrapped(); 973 986 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.testObjAttr())); … … 982 995 UNUSED_PARAM(thisValue); 983 996 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 984 if (UNLIKELY(!castedThis)) 985 return JSValue::encode(jsUndefined()); 997 if (UNLIKELY(!castedThis)) { 998 return JSValue::encode(jsUndefined()); 999 } 986 1000 auto& impl = castedThis->wrapped(); 987 1001 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.lenientTestObjAttr())); … … 996 1010 UNUSED_PARAM(thisValue); 997 1011 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 998 if (UNLIKELY(!castedThis)) 1012 if (UNLIKELY(!castedThis)) { 999 1013 return throwGetterTypeError(*state, "TestObj", "XMLObjAttr"); 1014 } 1000 1015 auto& impl = castedThis->wrapped(); 1001 1016 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.xmlObjAttr())); … … 1010 1025 UNUSED_PARAM(thisValue); 1011 1026 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1012 if (UNLIKELY(!castedThis)) 1027 if (UNLIKELY(!castedThis)) { 1013 1028 return throwGetterTypeError(*state, "TestObj", "create"); 1029 } 1014 1030 auto& impl = castedThis->wrapped(); 1015 1031 JSValue result = jsBoolean(impl.isCreate()); … … 1024 1040 UNUSED_PARAM(thisValue); 1025 1041 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1026 if (UNLIKELY(!castedThis)) 1042 if (UNLIKELY(!castedThis)) { 1027 1043 return throwGetterTypeError(*state, "TestObj", "readOnlySymbolAttr"); 1044 } 1028 1045 auto& impl = castedThis->wrapped(); 1029 1046 JSValue result = Symbol::create(state->vm(), *(impl.readOnlySymbolAttr()).uid()); … … 1048 1065 UNUSED_PARAM(thisValue); 1049 1066 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1050 if (UNLIKELY(!castedThis)) 1067 if (UNLIKELY(!castedThis)) { 1051 1068 return throwGetterTypeError(*state, "TestObj", "reflectedStringAttr"); 1069 } 1052 1070 auto& impl = castedThis->wrapped(); 1053 1071 JSValue result = jsStringWithCache(state, impl.fastGetAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); … … 1062 1080 UNUSED_PARAM(thisValue); 1063 1081 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1064 if (UNLIKELY(!castedThis)) 1082 if (UNLIKELY(!castedThis)) { 1065 1083 return throwGetterTypeError(*state, "TestObj", "reflectedIntegralAttr"); 1084 } 1066 1085 auto& impl = castedThis->wrapped(); 1067 1086 JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); … … 1076 1095 UNUSED_PARAM(thisValue); 1077 1096 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1078 if (UNLIKELY(!castedThis)) 1097 if (UNLIKELY(!castedThis)) { 1079 1098 return throwGetterTypeError(*state, "TestObj", "reflectedUnsignedIntegralAttr"); 1099 } 1080 1100 auto& impl = castedThis->wrapped(); 1081 1101 JSValue result = jsNumber(std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr))); … … 1090 1110 UNUSED_PARAM(thisValue); 1091 1111 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1092 if (UNLIKELY(!castedThis)) 1112 if (UNLIKELY(!castedThis)) { 1093 1113 return throwGetterTypeError(*state, "TestObj", "reflectedBooleanAttr"); 1114 } 1094 1115 auto& impl = castedThis->wrapped(); 1095 1116 JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); … … 1104 1125 UNUSED_PARAM(thisValue); 1105 1126 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1106 if (UNLIKELY(!castedThis)) 1127 if (UNLIKELY(!castedThis)) { 1107 1128 return throwGetterTypeError(*state, "TestObj", "reflectedURLAttr"); 1129 } 1108 1130 auto& impl = castedThis->wrapped(); 1109 1131 JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); … … 1118 1140 UNUSED_PARAM(thisValue); 1119 1141 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1120 if (UNLIKELY(!castedThis)) 1142 if (UNLIKELY(!castedThis)) { 1121 1143 return throwGetterTypeError(*state, "TestObj", "reflectedStringAttr"); 1144 } 1122 1145 auto& impl = castedThis->wrapped(); 1123 1146 JSValue result = jsStringWithCache(state, impl.fastGetAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); … … 1132 1155 UNUSED_PARAM(thisValue); 1133 1156 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1134 if (UNLIKELY(!castedThis)) 1157 if (UNLIKELY(!castedThis)) { 1135 1158 return throwGetterTypeError(*state, "TestObj", "reflectedCustomIntegralAttr"); 1159 } 1136 1160 auto& impl = castedThis->wrapped(); 1137 1161 JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); … … 1146 1170 UNUSED_PARAM(thisValue); 1147 1171 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1148 if (UNLIKELY(!castedThis)) 1172 if (UNLIKELY(!castedThis)) { 1149 1173 return throwGetterTypeError(*state, "TestObj", "reflectedCustomBooleanAttr"); 1174 } 1150 1175 auto& impl = castedThis->wrapped(); 1151 1176 JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); … … 1160 1185 UNUSED_PARAM(thisValue); 1161 1186 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1162 if (UNLIKELY(!castedThis)) 1187 if (UNLIKELY(!castedThis)) { 1163 1188 return throwGetterTypeError(*state, "TestObj", "reflectedCustomURLAttr"); 1189 } 1164 1190 auto& impl = castedThis->wrapped(); 1165 1191 JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); … … 1174 1200 UNUSED_PARAM(thisValue); 1175 1201 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1176 if (UNLIKELY(!castedThis)) 1202 if (UNLIKELY(!castedThis)) { 1177 1203 return throwGetterTypeError(*state, "TestObj", "typedArrayAttr"); 1204 } 1178 1205 auto& impl = castedThis->wrapped(); 1179 1206 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.typedArrayAttr())); … … 1188 1215 UNUSED_PARAM(thisValue); 1189 1216 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1190 if (UNLIKELY(!castedThis)) 1217 if (UNLIKELY(!castedThis)) { 1191 1218 return throwGetterTypeError(*state, "TestObj", "attrWithGetterException"); 1219 } 1192 1220 ExceptionCode ec = 0; 1193 1221 auto& impl = castedThis->wrapped(); … … 1204 1232 UNUSED_PARAM(thisValue); 1205 1233 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1206 if (UNLIKELY(!castedThis)) 1234 if (UNLIKELY(!castedThis)) { 1207 1235 return throwGetterTypeError(*state, "TestObj", "attrWithGetterExceptionWithMessage"); 1236 } 1208 1237 ExceptionCodeWithMessage ec; 1209 1238 auto& impl = castedThis->wrapped(); … … 1220 1249 UNUSED_PARAM(thisValue); 1221 1250 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1222 if (UNLIKELY(!castedThis)) 1251 if (UNLIKELY(!castedThis)) { 1223 1252 return throwGetterTypeError(*state, "TestObj", "attrWithSetterException"); 1253 } 1224 1254 auto& impl = castedThis->wrapped(); 1225 1255 JSValue result = jsNumber(impl.attrWithSetterException()); … … 1234 1264 UNUSED_PARAM(thisValue); 1235 1265 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1236 if (UNLIKELY(!castedThis)) 1266 if (UNLIKELY(!castedThis)) { 1237 1267 return throwGetterTypeError(*state, "TestObj", "attrWithSetterExceptionWithMessage"); 1268 } 1238 1269 auto& impl = castedThis->wrapped(); 1239 1270 JSValue result = jsNumber(impl.attrWithSetterExceptionWithMessage()); … … 1248 1279 UNUSED_PARAM(thisValue); 1249 1280 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1250 if (UNLIKELY(!castedThis)) 1281 if (UNLIKELY(!castedThis)) { 1251 1282 return throwGetterTypeError(*state, "TestObj", "stringAttrWithGetterException"); 1283 } 1252 1284 ExceptionCode ec = 0; 1253 1285 auto& impl = castedThis->wrapped(); … … 1264 1296 UNUSED_PARAM(thisValue); 1265 1297 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1266 if (UNLIKELY(!castedThis)) 1298 if (UNLIKELY(!castedThis)) { 1267 1299 return throwGetterTypeError(*state, "TestObj", "stringAttrWithSetterException"); 1300 } 1268 1301 auto& impl = castedThis->wrapped(); 1269 1302 JSValue result = jsStringWithCache(state, impl.stringAttrWithSetterException()); … … 1278 1311 UNUSED_PARAM(thisValue); 1279 1312 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1280 if (UNLIKELY(!castedThis)) 1313 if (UNLIKELY(!castedThis)) { 1281 1314 return throwGetterTypeError(*state, "TestObj", "strictTypeCheckingAttribute"); 1315 } 1282 1316 auto& impl = castedThis->wrapped(); 1283 1317 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.strictTypeCheckingAttribute())); … … 1292 1326 UNUSED_PARAM(thisValue); 1293 1327 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1294 if (UNLIKELY(!castedThis)) 1328 if (UNLIKELY(!castedThis)) { 1295 1329 return throwGetterTypeError(*state, "TestObj", "customAttr"); 1330 } 1296 1331 return JSValue::encode(castedThis->customAttr(*state)); 1297 1332 } … … 1304 1339 UNUSED_PARAM(thisValue); 1305 1340 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1306 if (UNLIKELY(!castedThis)) 1341 if (UNLIKELY(!castedThis)) { 1307 1342 return throwGetterTypeError(*state, "TestObj", "onfoo"); 1343 } 1308 1344 UNUSED_PARAM(state); 1309 1345 return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().fooEvent)); … … 1317 1353 UNUSED_PARAM(thisValue); 1318 1354 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1319 if (UNLIKELY(!castedThis)) 1355 if (UNLIKELY(!castedThis)) { 1320 1356 return throwGetterTypeError(*state, "TestObj", "withScriptStateAttribute"); 1357 } 1321 1358 auto& impl = castedThis->wrapped(); 1322 1359 JSValue result = jsNumber(impl.withScriptStateAttribute(*state)); … … 1331 1368 UNUSED_PARAM(thisValue); 1332 1369 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1333 if (UNLIKELY(!castedThis)) 1370 if (UNLIKELY(!castedThis)) { 1334 1371 return throwGetterTypeError(*state, "TestObj", "withCallWithAndSetterCallWithAttribute"); 1372 } 1335 1373 auto& impl = castedThis->wrapped(); 1336 1374 JSValue result = jsNumber(impl.withCallWithAndSetterCallWithAttribute(*state)); … … 1345 1383 UNUSED_PARAM(thisValue); 1346 1384 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1347 if (UNLIKELY(!castedThis)) 1385 if (UNLIKELY(!castedThis)) { 1348 1386 return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAttribute"); 1387 } 1349 1388 auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 1350 1389 if (!scriptContext) … … 1362 1401 UNUSED_PARAM(thisValue); 1363 1402 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1364 if (UNLIKELY(!castedThis)) 1403 if (UNLIKELY(!castedThis)) { 1365 1404 return throwGetterTypeError(*state, "TestObj", "withScriptStateAttributeRaises"); 1405 } 1366 1406 ExceptionCode ec = 0; 1367 1407 auto& impl = castedThis->wrapped(); … … 1378 1418 UNUSED_PARAM(thisValue); 1379 1419 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1380 if (UNLIKELY(!castedThis)) 1420 if (UNLIKELY(!castedThis)) { 1381 1421 return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAttributeRaises"); 1422 } 1382 1423 ExceptionCode ec = 0; 1383 1424 auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); … … 1397 1438 UNUSED_PARAM(thisValue); 1398 1439 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1399 if (UNLIKELY(!castedThis)) 1440 if (UNLIKELY(!castedThis)) { 1400 1441 return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateAttribute"); 1442 } 1401 1443 auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 1402 1444 if (!scriptContext) … … 1414 1456 UNUSED_PARAM(thisValue); 1415 1457 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1416 if (UNLIKELY(!castedThis)) 1458 if (UNLIKELY(!castedThis)) { 1417 1459 return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateAttributeRaises"); 1460 } 1418 1461 ExceptionCode ec = 0; 1419 1462 auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); … … 1433 1476 UNUSED_PARAM(thisValue); 1434 1477 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1435 if (UNLIKELY(!castedThis)) 1478 if (UNLIKELY(!castedThis)) { 1436 1479 return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateWithSpacesAttribute"); 1480 } 1437 1481 auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 1438 1482 if (!scriptContext) … … 1450 1494 UNUSED_PARAM(thisValue); 1451 1495 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1452 if (UNLIKELY(!castedThis)) 1496 if (UNLIKELY(!castedThis)) { 1453 1497 return throwGetterTypeError(*state, "TestObj", "withScriptArgumentsAndCallStackAttribute"); 1498 } 1454 1499 auto& impl = castedThis->wrapped(); 1455 1500 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptArgumentsAndCallStackAttribute())); … … 1465 1510 UNUSED_PARAM(thisValue); 1466 1511 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1467 if (UNLIKELY(!castedThis)) 1512 if (UNLIKELY(!castedThis)) { 1468 1513 return throwGetterTypeError(*state, "TestObj", "conditionalAttr1"); 1514 } 1469 1515 auto& impl = castedThis->wrapped(); 1470 1516 JSValue result = jsNumber(impl.conditionalAttr1()); … … 1481 1527 UNUSED_PARAM(thisValue); 1482 1528 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1483 if (UNLIKELY(!castedThis)) 1529 if (UNLIKELY(!castedThis)) { 1484 1530 return throwGetterTypeError(*state, "TestObj", "conditionalAttr2"); 1531 } 1485 1532 auto& impl = castedThis->wrapped(); 1486 1533 JSValue result = jsNumber(impl.conditionalAttr2()); … … 1497 1544 UNUSED_PARAM(thisValue); 1498 1545 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1499 if (UNLIKELY(!castedThis)) 1546 if (UNLIKELY(!castedThis)) { 1500 1547 return throwGetterTypeError(*state, "TestObj", "conditionalAttr3"); 1548 } 1501 1549 auto& impl = castedThis->wrapped(); 1502 1550 JSValue result = jsNumber(impl.conditionalAttr3()); … … 1512 1560 UNUSED_PARAM(slotBase); 1513 1561 UNUSED_PARAM(thisValue); 1514 auto* castedThis = jsCast<JSTestObj*>(slotBase); 1515 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1516 if (UNLIKELY(!castedThisObject)) 1562 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1563 if (UNLIKELY(!castedThis)) { 1517 1564 return throwGetterTypeError(*state, "TestObj", "conditionalAttr4"); 1565 } 1518 1566 return JSValue::encode(JSTestObjectA::getConstructor(state->vm(), castedThis->globalObject())); 1519 1567 } … … 1527 1575 UNUSED_PARAM(slotBase); 1528 1576 UNUSED_PARAM(thisValue); 1529 auto* castedThis = jsCast<JSTestObj*>(slotBase); 1530 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1531 if (UNLIKELY(!castedThisObject)) 1577 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1578 if (UNLIKELY(!castedThis)) { 1532 1579 return throwGetterTypeError(*state, "TestObj", "conditionalAttr5"); 1580 } 1533 1581 return JSValue::encode(JSTestObjectB::getConstructor(state->vm(), castedThis->globalObject())); 1534 1582 } … … 1542 1590 UNUSED_PARAM(slotBase); 1543 1591 UNUSED_PARAM(thisValue); 1544 auto* castedThis = jsCast<JSTestObj*>(slotBase); 1545 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1546 if (UNLIKELY(!castedThisObject)) 1592 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1593 if (UNLIKELY(!castedThis)) { 1547 1594 return throwGetterTypeError(*state, "TestObj", "conditionalAttr6"); 1595 } 1548 1596 return JSValue::encode(JSTestObjectC::getConstructor(state->vm(), castedThis->globalObject())); 1549 1597 } … … 1557 1605 UNUSED_PARAM(thisValue); 1558 1606 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1559 if (UNLIKELY(!castedThis)) 1607 if (UNLIKELY(!castedThis)) { 1560 1608 return throwGetterTypeError(*state, "TestObj", "cachedAttribute1"); 1609 } 1561 1610 if (JSValue cachedValue = castedThis->m_cachedAttribute1.get()) 1562 1611 return JSValue::encode(cachedValue); … … 1574 1623 UNUSED_PARAM(thisValue); 1575 1624 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1576 if (UNLIKELY(!castedThis)) 1625 if (UNLIKELY(!castedThis)) { 1577 1626 return throwGetterTypeError(*state, "TestObj", "cachedAttribute2"); 1627 } 1578 1628 if (JSValue cachedValue = castedThis->m_cachedAttribute2.get()) 1579 1629 return JSValue::encode(cachedValue); … … 1591 1641 UNUSED_PARAM(thisValue); 1592 1642 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1593 if (UNLIKELY(!castedThis)) 1643 if (UNLIKELY(!castedThis)) { 1594 1644 return throwGetterTypeError(*state, "TestObj", "anyAttribute"); 1645 } 1595 1646 auto& impl = castedThis->wrapped(); 1596 1647 JSValue result = (impl.anyAttribute().hasNoValue() ? jsNull() : impl.anyAttribute().jsValue()); … … 1604 1655 UNUSED_PARAM(slotBase); 1605 1656 UNUSED_PARAM(thisValue); 1606 auto* castedThis = jsCast<JSTestObj*>(slotBase); 1607 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1608 if (UNLIKELY(!castedThisObject)) 1657 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1658 if (UNLIKELY(!castedThis)) { 1609 1659 return throwGetterTypeError(*state, "TestObj", "contentDocument"); 1660 } 1610 1661 auto& impl = castedThis->wrapped(); 1611 1662 return JSValue::encode(shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, castedThis->globalObject(), WTF::getPtr(impl.contentDocument())) : jsNull()); … … 1619 1670 UNUSED_PARAM(thisValue); 1620 1671 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1621 if (UNLIKELY(!castedThis)) 1672 if (UNLIKELY(!castedThis)) { 1622 1673 return throwGetterTypeError(*state, "TestObj", "mutablePoint"); 1674 } 1623 1675 auto& impl = castedThis->wrapped(); 1624 1676 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint))); … … 1633 1685 UNUSED_PARAM(thisValue); 1634 1686 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1635 if (UNLIKELY(!castedThis)) 1687 if (UNLIKELY(!castedThis)) { 1636 1688 return throwGetterTypeError(*state, "TestObj", "immutablePoint"); 1689 } 1637 1690 auto& impl = castedThis->wrapped(); 1638 1691 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint()))); … … 1647 1700 UNUSED_PARAM(thisValue); 1648 1701 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1649 if (UNLIKELY(!castedThis)) 1702 if (UNLIKELY(!castedThis)) { 1650 1703 return throwGetterTypeError(*state, "TestObj", "strawberry"); 1704 } 1651 1705 auto& impl = castedThis->wrapped(); 1652 1706 JSValue result = jsNumber(impl.blueberry()); … … 1661 1715 UNUSED_PARAM(thisValue); 1662 1716 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1663 if (UNLIKELY(!castedThis)) 1717 if (UNLIKELY(!castedThis)) { 1664 1718 return throwGetterTypeError(*state, "TestObj", "strictFloat"); 1719 } 1665 1720 auto& impl = castedThis->wrapped(); 1666 1721 JSValue result = jsNumber(impl.strictFloat()); … … 1675 1730 UNUSED_PARAM(thisValue); 1676 1731 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1677 if (UNLIKELY(!castedThis)) 1732 if (UNLIKELY(!castedThis)) { 1678 1733 return throwGetterTypeError(*state, "TestObj", "description"); 1734 } 1679 1735 auto& impl = castedThis->wrapped(); 1680 1736 JSValue result = jsNumber(impl.description()); … … 1689 1745 UNUSED_PARAM(thisValue); 1690 1746 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1691 if (UNLIKELY(!castedThis)) 1747 if (UNLIKELY(!castedThis)) { 1692 1748 return throwGetterTypeError(*state, "TestObj", "id"); 1749 } 1693 1750 auto& impl = castedThis->wrapped(); 1694 1751 JSValue result = jsNumber(impl.id()); … … 1703 1760 UNUSED_PARAM(thisValue); 1704 1761 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1705 if (UNLIKELY(!castedThis)) 1762 if (UNLIKELY(!castedThis)) { 1706 1763 return throwGetterTypeError(*state, "TestObj", "hash"); 1764 } 1707 1765 auto& impl = castedThis->wrapped(); 1708 1766 JSValue result = jsStringWithCache(state, impl.hash()); … … 1717 1775 UNUSED_PARAM(thisValue); 1718 1776 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1719 if (UNLIKELY(!castedThis)) 1777 if (UNLIKELY(!castedThis)) { 1720 1778 return throwGetterTypeError(*state, "TestObj", "replaceableAttribute"); 1779 } 1721 1780 auto& impl = castedThis->wrapped(); 1722 1781 JSValue result = jsNumber(impl.replaceableAttribute()); … … 1731 1790 UNUSED_PARAM(thisValue); 1732 1791 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1733 if (UNLIKELY(!castedThis)) 1792 if (UNLIKELY(!castedThis)) { 1734 1793 return throwGetterTypeError(*state, "TestObj", "nullableDoubleAttribute"); 1794 } 1735 1795 auto& impl = castedThis->wrapped(); 1736 1796 JSValue result = toNullableJSNumber(impl.nullableDoubleAttribute()); … … 1745 1805 UNUSED_PARAM(thisValue); 1746 1806 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1747 if (UNLIKELY(!castedThis)) 1807 if (UNLIKELY(!castedThis)) { 1748 1808 return throwGetterTypeError(*state, "TestObj", "nullableLongAttribute"); 1809 } 1749 1810 auto& impl = castedThis->wrapped(); 1750 1811 JSValue result = toNullableJSNumber(impl.nullableLongAttribute()); … … 1759 1820 UNUSED_PARAM(thisValue); 1760 1821 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1761 if (UNLIKELY(!castedThis)) 1822 if (UNLIKELY(!castedThis)) { 1762 1823 return throwGetterTypeError(*state, "TestObj", "nullableBooleanAttribute"); 1824 } 1763 1825 auto& impl = castedThis->wrapped(); 1764 1826 JSValue result = jsBoolean(impl.nullableBooleanAttribute()); … … 1773 1835 UNUSED_PARAM(thisValue); 1774 1836 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1775 if (UNLIKELY(!castedThis)) 1837 if (UNLIKELY(!castedThis)) { 1776 1838 return throwGetterTypeError(*state, "TestObj", "nullableStringAttribute"); 1839 } 1777 1840 auto& impl = castedThis->wrapped(); 1778 1841 JSValue result = jsStringWithCache(state, impl.nullableStringAttribute()); … … 1787 1850 UNUSED_PARAM(thisValue); 1788 1851 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1789 if (UNLIKELY(!castedThis)) 1852 if (UNLIKELY(!castedThis)) { 1790 1853 return throwGetterTypeError(*state, "TestObj", "nullableLongSettableAttribute"); 1854 } 1791 1855 auto& impl = castedThis->wrapped(); 1792 1856 JSValue result = toNullableJSNumber(impl.nullableLongSettableAttribute()); … … 1801 1865 UNUSED_PARAM(thisValue); 1802 1866 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1803 if (UNLIKELY(!castedThis)) 1867 if (UNLIKELY(!castedThis)) { 1804 1868 return throwGetterTypeError(*state, "TestObj", "nullableStringValue"); 1869 } 1805 1870 ExceptionCode ec = 0; 1806 1871 auto& impl = castedThis->wrapped(); … … 1817 1882 UNUSED_PARAM(thisValue); 1818 1883 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1819 if (UNLIKELY(!castedThis)) 1884 if (UNLIKELY(!castedThis)) { 1820 1885 return throwGetterTypeError(*state, "TestObj", "attribute"); 1886 } 1821 1887 auto& impl = castedThis->wrapped(); 1822 1888 JSValue result = jsStringWithCache(state, impl.attribute()); … … 1831 1897 UNUSED_PARAM(thisValue); 1832 1898 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1833 if (UNLIKELY(!castedThis)) 1899 if (UNLIKELY(!castedThis)) { 1834 1900 return throwGetterTypeError(*state, "TestObj", "attributeWithReservedEnumType"); 1901 } 1835 1902 auto& impl = castedThis->wrapped(); 1836 1903 JSValue result = jsStringWithCache(state, impl.attributeWithReservedEnumType()); … … 1845 1912 UNUSED_PARAM(thisValue); 1846 1913 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1847 if (UNLIKELY(!castedThis)) 1914 if (UNLIKELY(!castedThis)) { 1848 1915 return throwGetterTypeError(*state, "TestObj", "putForwardsAttribute"); 1916 } 1849 1917 auto& impl = castedThis->wrapped(); 1850 1918 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.putForwardsAttribute())); … … 1859 1927 UNUSED_PARAM(thisValue); 1860 1928 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1861 if (UNLIKELY(!castedThis)) 1929 if (UNLIKELY(!castedThis)) { 1862 1930 return throwGetterTypeError(*state, "TestObj", "putForwardsNullableAttribute"); 1931 } 1863 1932 auto& impl = castedThis->wrapped(); 1864 1933 JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.putForwardsNullableAttribute())); … … 1903 1972 JSValue value = JSValue::decode(encodedValue); 1904 1973 UNUSED_PARAM(baseObject); 1905 auto* castedThis = jsCast<JSTestObj*>(baseObject); 1906 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1907 if (UNLIKELY(!castedThisObject)) { 1974 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1975 if (UNLIKELY(!castedThis)) { 1908 1976 throwSetterTypeError(*state, "TestObj", "TestSubObjEnabledBySetting"); 1909 1977 return; … … 2691 2759 JSValue value = JSValue::decode(encodedValue); 2692 2760 UNUSED_PARAM(baseObject); 2693 auto* castedThis = jsCast<JSTestObj*>(baseObject); 2694 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 2695 if (UNLIKELY(!castedThisObject)) { 2761 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 2762 if (UNLIKELY(!castedThis)) { 2696 2763 throwSetterTypeError(*state, "TestObj", "conditionalAttr4"); 2697 2764 return; … … 2708 2775 JSValue value = JSValue::decode(encodedValue); 2709 2776 UNUSED_PARAM(baseObject); 2710 auto* castedThis = jsCast<JSTestObj*>(baseObject); 2711 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 2712 if (UNLIKELY(!castedThisObject)) { 2777 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 2778 if (UNLIKELY(!castedThis)) { 2713 2779 throwSetterTypeError(*state, "TestObj", "conditionalAttr5"); 2714 2780 return; … … 2725 2791 JSValue value = JSValue::decode(encodedValue); 2726 2792 UNUSED_PARAM(baseObject); 2727 auto* castedThis = jsCast<JSTestObj*>(baseObject); 2728 JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 2729 if (UNLIKELY(!castedThisObject)) { 2793 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 2794 if (UNLIKELY(!castedThis)) { 2730 2795 throwSetterTypeError(*state, "TestObj", "conditionalAttr6"); 2731 2796 return; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r195907 r196200 134 134 UNUSED_PARAM(thisValue); 135 135 JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue)); 136 if (UNLIKELY(!castedThis)) 136 if (UNLIKELY(!castedThis)) { 137 137 return throwGetterTypeError(*state, "TestSerializedScriptValueInterface", "value"); 138 } 138 139 auto& impl = castedThis->wrapped(); 139 140 JSValue result = impl.value() ? impl.value()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); … … 148 149 UNUSED_PARAM(thisValue); 149 150 JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue)); 150 if (UNLIKELY(!castedThis)) 151 if (UNLIKELY(!castedThis)) { 151 152 return throwGetterTypeError(*state, "TestSerializedScriptValueInterface", "readonlyValue"); 153 } 152 154 auto& impl = castedThis->wrapped(); 153 155 JSValue result = impl.readonlyValue() ? impl.readonlyValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); … … 162 164 UNUSED_PARAM(thisValue); 163 165 JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue)); 164 if (UNLIKELY(!castedThis)) 166 if (UNLIKELY(!castedThis)) { 165 167 return throwGetterTypeError(*state, "TestSerializedScriptValueInterface", "cachedValue"); 168 } 166 169 if (JSValue cachedValue = castedThis->m_cachedValue.get()) 167 170 return JSValue::encode(cachedValue); … … 179 182 UNUSED_PARAM(thisValue); 180 183 JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue)); 181 if (UNLIKELY(!castedThis)) 184 if (UNLIKELY(!castedThis)) { 182 185 return throwGetterTypeError(*state, "TestSerializedScriptValueInterface", "ports"); 186 } 183 187 auto& impl = castedThis->wrapped(); 184 188 JSValue result = jsArray(state, castedThis->globalObject(), impl.ports()); … … 193 197 UNUSED_PARAM(thisValue); 194 198 JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue)); 195 if (UNLIKELY(!castedThis)) 199 if (UNLIKELY(!castedThis)) { 196 200 return throwGetterTypeError(*state, "TestSerializedScriptValueInterface", "cachedReadonlyValue"); 201 } 197 202 if (JSValue cachedValue = castedThis->m_cachedReadonlyValue.get()) 198 203 return JSValue::encode(cachedValue); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r196145 r196200 217 217 UNUSED_PARAM(thisValue); 218 218 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 219 if (UNLIKELY(!castedThis)) 219 if (UNLIKELY(!castedThis)) { 220 220 return throwGetterTypeError(*state, "TestTypedefs", "unsignedLongLongAttr"); 221 } 221 222 auto& impl = castedThis->wrapped(); 222 223 JSValue result = jsNumber(impl.unsignedLongLongAttr()); … … 231 232 UNUSED_PARAM(thisValue); 232 233 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 233 if (UNLIKELY(!castedThis)) 234 if (UNLIKELY(!castedThis)) { 234 235 return throwGetterTypeError(*state, "TestTypedefs", "immutableSerializedScriptValue"); 236 } 235 237 auto& impl = castedThis->wrapped(); 236 238 JSValue result = impl.immutableSerializedScriptValue() ? impl.immutableSerializedScriptValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); … … 244 246 UNUSED_PARAM(slotBase); 245 247 UNUSED_PARAM(thisValue); 246 auto* castedThis = jsCast<JSTestTypedefs*>(slotBase); 247 JSTestTypedefs* castedThisObject = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 248 if (UNLIKELY(!castedThisObject)) 248 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 249 if (UNLIKELY(!castedThis)) { 249 250 return throwGetterTypeError(*state, "TestTypedefs", "TestSubObj"); 251 } 250 252 return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject())); 251 253 } … … 258 260 UNUSED_PARAM(thisValue); 259 261 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 260 if (UNLIKELY(!castedThis)) 262 if (UNLIKELY(!castedThis)) { 261 263 return throwGetterTypeError(*state, "TestTypedefs", "attrWithGetterException"); 264 } 262 265 ExceptionCode ec = 0; 263 266 auto& impl = castedThis->wrapped(); … … 274 277 UNUSED_PARAM(thisValue); 275 278 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 276 if (UNLIKELY(!castedThis)) 279 if (UNLIKELY(!castedThis)) { 277 280 return throwGetterTypeError(*state, "TestTypedefs", "attrWithSetterException"); 281 } 278 282 auto& impl = castedThis->wrapped(); 279 283 JSValue result = jsNumber(impl.attrWithSetterException()); … … 288 292 UNUSED_PARAM(thisValue); 289 293 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 290 if (UNLIKELY(!castedThis)) 294 if (UNLIKELY(!castedThis)) { 291 295 return throwGetterTypeError(*state, "TestTypedefs", "stringAttrWithGetterException"); 296 } 292 297 ExceptionCode ec = 0; 293 298 auto& impl = castedThis->wrapped(); … … 304 309 UNUSED_PARAM(thisValue); 305 310 JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 306 if (UNLIKELY(!castedThis)) 311 if (UNLIKELY(!castedThis)) { 307 312 return throwGetterTypeError(*state, "TestTypedefs", "stringAttrWithSetterException"); 313 } 308 314 auto& impl = castedThis->wrapped(); 309 315 JSValue result = jsStringWithCache(state, impl.stringAttrWithSetterException()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
r195907 r196200 119 119 UNUSED_PARAM(thisValue); 120 120 JSattribute* castedThis = jsDynamicCast<JSattribute*>(JSValue::decode(thisValue)); 121 if (UNLIKELY(!castedThis)) 121 if (UNLIKELY(!castedThis)) { 122 122 return throwGetterTypeError(*state, "attribute", "readonly"); 123 } 123 124 auto& impl = castedThis->wrapped(); 124 125 JSValue result = jsStringWithCache(state, impl.readonly());
Note: See TracChangeset
for help on using the changeset viewer.