Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Jun 2017 18:00:01 +0000 (18:00 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Jun 2017 18:00:01 +0000 (18:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172687

Reviewed by Darin Adler.

Source/WebCore:

- Adds support for generating the defineOwnProperty ClassInfo method table hook
  to add support for Object.defineProperty(). The implementation follows WebIDL
  section 3.9.3 [[DefineOwnProperty]].
  (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
- Adds support for generating named setters in addition to the already supported
  indexed setters as much of the required work was needed to make defineOwnProperty
  work for those properties. This patch does not aim to follow WebIDL faithfully,
  but rather to generate as close to the custom code as possible. A follow up
  change will attempt to match WebIDL more closely (which will also require changes
  to [[GetOwnPropertySlot]]).
- Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
  HTMLSelectElement. Gets us one function away from supporting Storage.
- Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
  together.
- Removes support for CustomIndexedSetter, which is no longer used.

Test: js/dom/legacy-platform-object-defineOwnProperty.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Removed now unneeded custom bindings.

* bindings/js/JSDOMStringMapCustom.cpp: Removed.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
* bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
* bindings/js/JSHTMLSelectElementCustom.h: Removed.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::putDelegate): Deleted.
Remove more code that is now generated.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateIndexedGetter):
- Add missing check for indexed setter operation when determining if the property should be ReadOnly.
- Add support for custom implementation name, matching GenerateNamedGetter.
- Convert to taking an outputArray and indent to allow more flexibility going forward.

(GenerateNamedGetter):
- Add missing check for named setter operation when determining if the property should be ReadOnly.
- Convert to taking an outputArray and indent to allow more flexibility going forward.

(GenerateGetOwnPropertySlotBody):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.

(GenerateGetOwnPropertySlotBodyByIndex):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.

(GenerateGetOwnPropertyNames):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomEnumerateProperty is set.

(GenerateInvokeIndexedPropertySetter):
Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)

(GenerateInvokeNamedPropertySetter):
Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)

(GeneratePut):
(GeneratePutByIndex):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomPut is set.
- Adds support for CEReactions.
- Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
  simplify code.
- Removes support for CustomIndexedSetter, which is no longer used.
- Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
  has it, which is how it is specified to work.

(GenerateIsUnforgeablePropertyName):
Added. Helper subroutine to generate a function that compares a property name
agains all the property names defined as Unforgeable on the interface. Used by
GenerateDefineOwnProperty.

(GenerateDefineOwnProperty):
Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
Adds support for CEReactions.

(GenerateDeletePropertyCommon):
Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.

(GenerateNamedDeleterDefinition):
Switch signature to match peer generators.

(InstanceOverridesGetOwnPropertySlot):
Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.

(InstanceOverridesGetOwnPropertySlotByIndex):
Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex
rather than CustomGetOwnPropertySlot.

(InstanceOverridesGetOwnPropertyNames):
Added. Moves complex predicate out of line.

(InstanceOverridesPut):
Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.

(InstanceOverridesDefineOwnProperty):
Added.

(GenerateHeader):
- Moves more structure flags together.
- Simplifies predicates and moves the ClassInfo method table hooks together.

(GenerateImplementation):
- Moves the ClassInfo method table hooks together
- Adds call to GenerateDefineOwnProperty.

(GenerateLegacyCallerDefinitions):
Simplify bail condition to match other generators.

(GeneratePrototypeDeclaration):
Update for new extended attribute names.

(InstanceOverridesCall):
Renamed from IsCallable for consistency.

(HasComplexGetOwnProperty):
Deleted. Unused.

(InstanceOverridesPutImplementation):
Deleted. Unused.

(InstanceOverridesPutDeclaration):
Deleted. Unused.

(IsCallable):
Renamed, for consistency, to InstanceOverridesCall .

* bindings/scripts/IDLAttributes.json:
Renames a few of the extended attributes to remove the JS prefix. This time
around I only did the ones in the area I was working, but we should probably
remove most of the rest.

* css/CSSStyleDeclaration.idl:
Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

* dom/DOMStringMap.idl:
Remove CustomNamedSetter and add uncomment out the setter.

* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::setNamedItem):
(WebCore::DatasetDOMStringMap::setItem): Deleted.
* dom/DatasetDOMStringMap.h:
Rename setItem to setNamedItem, which is what the generator expects.

* dom/Node.idl:
Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.

* html/HTMLAppletElement.idl:
* html/HTMLEmbedElement.idl:
* html/HTMLObjectElement.idl:
Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::isSupportedPropertyName):
* html/HTMLCollection.h:
Add isSupportedPropertyName function which is used by the bindings and is now needed.

* html/HTMLElement.idl:
Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.

* html/HTMLOptionsCollection.h:
(WebCore::HTMLOptionsCollection::setItem):
Add setItem() implementation which just forwards to the select element. Also, add
a type alias to make the implementations of item and namedItem less verbose.

* html/HTMLOptionsCollection.idl:
Remove CustomIndexedSetter and uncomment the setter.

* html/HTMLSelectElement.idl:
Remove CustomIndexedSetter and uncomment the setter. Also, reformat
to match the WHATWG spec.

* page/DOMWindow.idl:
Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add
CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
assumptions the generator was making.

* page/Location.idl:
Update for removal of JS prefix from a bunch of extended attributes.

* page/UserMessageHandlersNamespace.idl:
Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

* storage/Storage.idl:
Remove CustomNamedSetter and uncomment the setter.

* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
* bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
* bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
* bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
* bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
* bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
* bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
* bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
* bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
* bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
Added new tests and updated some results.

LayoutTests:

* js/dom/legacy-platform-object-defineOwnProperty-expected.txt: Added.
* js/dom/legacy-platform-object-defineOwnProperty.html: Added.
New tests for Object.defineProperty on Storage and DOMStringMap.

* js/dom/named-property-deleter.html:
Fix test which was deleting the wrong property. This doesn't change the result,
but is now actually testing the thing it meant to.

* storage/domstorage/localstorage/delete-defineproperty-removal-expected.txt:
* storage/domstorage/localstorage/delete-defineproperty-removal.html:
Convert to testharness.js and show that the results are now correct.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217773 268f45cc-cd09-0410-ab3c-d52691b4dbfc

82 files changed:
LayoutTests/ChangeLog
LayoutTests/js/dom/legacy-platform-object-defineOwnProperty-expected.txt [new file with mode: 0644]
LayoutTests/js/dom/legacy-platform-object-defineOwnProperty.html [new file with mode: 0644]
LayoutTests/js/dom/named-property-deleter.html
LayoutTests/storage/domstorage/localstorage/delete-defineproperty-removal-expected.txt
LayoutTests/storage/domstorage/localstorage/delete-defineproperty-removal.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSHTMLSelectElementCustom.h [deleted file]
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.json
Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h
Source/WebCore/bindings/scripts/test/TestIndexedSetterNoIdentifier.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestIndexedSetterThrowingException.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestIndexedSetterWithIdentifier.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedDeleterWithIdentifier.idl
Source/WebCore/bindings/scripts/test/TestNamedSetterNoIdentifier.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedSetterThrowingException.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedSetterWithIdentifier.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl [moved from Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp with 55% similarity]
Source/WebCore/bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl [new file with mode: 0644]
Source/WebCore/css/CSSStyleDeclaration.idl
Source/WebCore/dom/DOMStringMap.idl
Source/WebCore/dom/DatasetDOMStringMap.cpp
Source/WebCore/dom/DatasetDOMStringMap.h
Source/WebCore/dom/Node.idl
Source/WebCore/html/HTMLAppletElement.idl
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLCollection.h
Source/WebCore/html/HTMLElement.idl
Source/WebCore/html/HTMLEmbedElement.idl
Source/WebCore/html/HTMLObjectElement.idl
Source/WebCore/html/HTMLOptionsCollection.h
Source/WebCore/html/HTMLOptionsCollection.idl
Source/WebCore/html/HTMLSelectElement.idl
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/Location.idl
Source/WebCore/page/UserMessageHandlersNamespace.idl
Source/WebCore/storage/Storage.idl

index 0ae7b0a..c32637f 100644 (file)
@@ -1,3 +1,22 @@
+2017-06-03  Sam Weinig  <sam@webkit.org>
+
+        Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
+        https://bugs.webkit.org/show_bug.cgi?id=172687
+
+        Reviewed by Darin Adler.
+
+        * js/dom/legacy-platform-object-defineOwnProperty-expected.txt: Added.
+        * js/dom/legacy-platform-object-defineOwnProperty.html: Added.
+        New tests for Object.defineProperty on Storage and DOMStringMap.
+
+        * js/dom/named-property-deleter.html:
+        Fix test which was deleting the wrong property. This doesn't change the result,
+        but is now actually testing the thing it meant to.
+
+        * storage/domstorage/localstorage/delete-defineproperty-removal-expected.txt:
+        * storage/domstorage/localstorage/delete-defineproperty-removal.html:
+        Convert to testharness.js and show that the results are now correct.
+
 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
 
         Object bounding box wrong for some paths
diff --git a/LayoutTests/js/dom/legacy-platform-object-defineOwnProperty-expected.txt b/LayoutTests/js/dom/legacy-platform-object-defineOwnProperty-expected.txt
new file mode 100644 (file)
index 0000000..131a780
--- /dev/null
@@ -0,0 +1,16 @@
+
+PASS Test that the setting a non-existing named property with Object.defineProperty creates the property ([OverrideBuiltins] specified). 
+PASS Test that the setting a non-existing indexed property with Object.defineProperty creates the property ([OverrideBuiltins] specified). 
+PASS Test that the setting an existing named property with Object.defineProperty replaces the value ([OverrideBuiltins] specified). 
+PASS Test that the setting an existing indexed property with Object.defineProperty replaces the value ([OverrideBuiltins] specified). 
+PASS Test that the setting a non-existing but invalid named property with Object.defineProperty throws ([OverrideBuiltins] specified). 
+PASS Test that the setting a non-data descriptor property with Object.defineProperty does not set anything ([OverrideBuiltins] specified). 
+PASS Test that the setting a named property with Object.defineProperty that shadows an existing prototype value still creates the item ([OverrideBuiltins] specified). 
+PASS Test that the setting a non-existing named property with Object.defineProperty creates the property ([OverrideBuiltins] not specified). 
+PASS Test that the setting a non-existing indexed property with Object.defineProperty creates the property ([OverrideBuiltins] not specified). 
+PASS Test that the setting an existing named property with Object.defineProperty replaces the value ([OverrideBuiltins] not specified). 
+PASS Test that the setting an existing indexed property with Object.defineProperty replaces the value ([OverrideBuiltins] not specified). 
+PASS Test that the setting a non-data descriptor property with Object.defineProperty does not set anything ([OverrideBuiltins] not specified). 
+PASS Test that the setting a named property with Object.defineProperty that shadows an existing prototype value still creates the item ([OverrideBuiltins] not specified). 
+PASS Test that the trying to set a named property, matching a builtin property name, with Object.defineProperty does nothing ([OverrideBuiltins] not specified). 
+
diff --git a/LayoutTests/js/dom/legacy-platform-object-defineOwnProperty.html b/LayoutTests/js/dom/legacy-platform-object-defineOwnProperty.html
new file mode 100644 (file)
index 0000000..d4a92bc
--- /dev/null
@@ -0,0 +1,209 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../../resources/testharness.js"></script>
+    <script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+    // To test a named property setter with [OverrideBuiltins] specified, we use DOMStringMap via element.dataset.
+    test(() => {
+        let element = document.createElement("div");
+        element.dataset["a"] = "value1";
+        element.dataset["b"] = "value2";
+        
+        Object.defineProperty(element.dataset, "c", { value: "value3" });
+        assert_equals(element.dataset["c"], "value3");
+        assert_equals(element.getAttribute("data-c"), "value3")
+    }, "Test that the setting a non-existing named property with Object.defineProperty creates the property ([OverrideBuiltins] specified).");
+
+    test(() => {
+        let element = document.createElement("div");
+        element.dataset[1] = "value1";
+        element.dataset[2] = "value2";
+        
+        Object.defineProperty(element.dataset, 3, { value: "value3" });
+        assert_equals(element.dataset[3], "value3");
+        assert_equals(element.getAttribute("data-3"), "value3")
+    }, "Test that the setting a non-existing indexed property with Object.defineProperty creates the property ([OverrideBuiltins] specified).");
+
+    test(() => {
+        let element = document.createElement("div");
+        element.dataset["a"] = "value1";
+        element.dataset["b"] = "value2";
+        
+        Object.defineProperty(element.dataset, "a", { value: "value3" });
+        assert_equals(element.dataset["a"], "value3");
+        assert_equals(element.getAttribute("data-a"), "value3")
+    }, "Test that the setting an existing named property with Object.defineProperty replaces the value ([OverrideBuiltins] specified).");
+
+    test(() => {
+        let element = document.createElement("div");
+        element.dataset[1] = "value1";
+        element.dataset[2] = "value2";
+        
+        Object.defineProperty(element.dataset, 1, { value: "value3" });
+        assert_equals(element.dataset[1], "value3");
+        assert_equals(element.getAttribute("data-1"), "value3")
+    }, "Test that the setting an existing indexed property with Object.defineProperty replaces the value ([OverrideBuiltins] specified).");
+
+    test(() => {
+        let element = document.createElement("div");
+        element.dataset["a"] = "value1";
+        element.dataset["b"] = "value2";
+        
+        assert_throws("SyntaxError", () => {
+            Object.defineProperty(element.dataset, "-invalid", { value: "value3" });            
+        });
+        assert_not_equals(element.dataset["-invalid"], 'value3');
+        assert_not_equals(element.getAttribute("data--invalid"), "value3")
+    }, "Test that the setting a non-existing but invalid named property with Object.defineProperty throws ([OverrideBuiltins] specified).");
+
+    test(() => {
+        let element = document.createElement("div");
+        element.dataset["a"] = "value1";
+        element.dataset["b"] = "value2";
+        
+        assert_equals(element.dataset["c"], undefined);
+        Object.defineProperty(element.dataset, "c", { 
+            get: function() { return 1; },
+            set: function(newValue) { }
+        });
+        assert_equals(element.dataset["c"], undefined);
+    }, "Test that the setting a non-data descriptor property with Object.defineProperty does not set anything ([OverrideBuiltins] specified).");
+
+    test((t) => {
+        t.add_cleanup(() => {
+          delete DOMStringMap.prototype["c"];
+        });
+    
+        let element = document.createElement("div");
+    
+        DOMStringMap.prototype["c"] = 'prototype-value';
+        Object.defineProperty(element.dataset, "c", { value: "map-value" });
+        
+        assert_equals(element.dataset["c"], "map-value");
+        assert_equals(element.getAttribute("data-c"), "map-value")
+        assert_equals(DOMStringMap.prototype["c"], "prototype-value")
+    }, "Test that the setting a named property with Object.defineProperty that shadows an existing prototype value still creates the item ([OverrideBuiltins] specified).");
+
+
+    // To test a named property setter without [OverrideBuiltins] specified, we use Storage via window.sessionStorage.
+    test((t) => {
+        t.add_cleanup(() => {
+          window.sessionStorage.clear();
+        });
+        
+        window.sessionStorage.clear();
+        assert_equals(window.sessionStorage.length, 0);
+    
+        window.sessionStorage["a"] = "value1";
+        window.sessionStorage["b"] = "value2";
+        
+        Object.defineProperty(window.sessionStorage, "c", { value: "value3" });
+        assert_equals(window.sessionStorage["c"], "value3");
+        assert_equals(window.sessionStorage.getItem("c"), "value3")
+    }, "Test that the setting a non-existing named property with Object.defineProperty creates the property ([OverrideBuiltins] not specified).");
+
+    test((t) => {
+        t.add_cleanup(() => {
+          window.sessionStorage.clear();
+        });
+        
+        window.sessionStorage.clear();
+        assert_equals(window.sessionStorage.length, 0);
+    
+        window.sessionStorage["a"] = "value1";
+        window.sessionStorage["b"] = "value2";
+            
+        Object.defineProperty(window.sessionStorage, 3, { value: "value3" });
+        assert_equals(window.sessionStorage[3], "value3");
+        assert_equals(window.sessionStorage.getItem("3"), "value3")
+    }, "Test that the setting a non-existing indexed property with Object.defineProperty creates the property ([OverrideBuiltins] not specified).");
+
+    test((t) => {
+        t.add_cleanup(() => {
+          window.sessionStorage.clear();
+        });
+        
+        window.sessionStorage.clear();
+        assert_equals(window.sessionStorage.length, 0);
+    
+        window.sessionStorage["a"] = "value1";
+        window.sessionStorage["b"] = "value2";
+        
+        Object.defineProperty(window.sessionStorage, "a", { value: "value3" });
+        assert_equals(window.sessionStorage["a"], "value3");
+        assert_equals(window.sessionStorage.getItem("a"), "value3")
+    }, "Test that the setting an existing named property with Object.defineProperty replaces the value ([OverrideBuiltins] not specified).");
+
+    test((t) => {
+        t.add_cleanup(() => {
+          window.sessionStorage.clear();
+        });
+        
+        window.sessionStorage.clear();
+        assert_equals(window.sessionStorage.length, 0);
+    
+        window.sessionStorage["a"] = "value1";
+        window.sessionStorage["b"] = "value2";
+            
+        Object.defineProperty(window.sessionStorage, 1, { value: "value3" });
+        assert_equals(window.sessionStorage[1], "value3");
+        assert_equals(window.sessionStorage.getItem("1"), "value3")
+    }, "Test that the setting an existing indexed property with Object.defineProperty replaces the value ([OverrideBuiltins] not specified).");
+
+    test((t) => {
+        t.add_cleanup(() => {
+          window.sessionStorage.clear();
+        });
+        
+        window.sessionStorage.clear();
+        assert_equals(window.sessionStorage.length, 0);
+    
+        window.sessionStorage["a"] = "value1";
+        window.sessionStorage["b"] = "value2";
+        
+        assert_equals(window.sessionStorage["c"], undefined);
+        Object.defineProperty(window.sessionStorage, "c", { 
+            get: function() { return 1; },
+            set: function(newValue) { }
+        });
+        assert_equals(window.sessionStorage["c"], undefined);
+    }, "Test that the setting a non-data descriptor property with Object.defineProperty does not set anything ([OverrideBuiltins] not specified).");
+
+    test((t) => {
+        t.add_cleanup(() => {
+            window.sessionStorage.clear();
+            delete Storage.prototype["c"];
+        });
+        
+        Storage.prototype["c"] = 'prototype-value';
+        Object.defineProperty(window.sessionStorage, "c", { value: "map-value" });
+        
+        assert_equals(window.sessionStorage["c"], "prototype-value");
+        assert_equals(window.sessionStorage.getItem("c"), "map-value")
+        assert_equals(Storage.prototype["c"], "prototype-value")
+    }, "Test that the setting a named property with Object.defineProperty that shadows an existing prototype value still creates the item ([OverrideBuiltins] not specified).");
+
+
+    test((t) => {
+        t.add_cleanup(() => {
+          window.sessionStorage.clear();
+        });
+        
+        window.sessionStorage.clear();
+        assert_equals(window.sessionStorage.length, 0);
+    
+        window.sessionStorage["a"] = "value1";
+        window.sessionStorage["b"] = "value2";
+
+        let currentLength = window.sessionStorage.length;
+        
+        Object.defineProperty(window.sessionStorage, "length", { value: "value3" });
+        assert_equals(window.sessionStorage['length'], currentLength + 1);
+        assert_equals(window.sessionStorage.getItem("length"), "value3")
+    }, "Test that the trying to set a named property, matching a builtin property name, with Object.defineProperty does nothing ([OverrideBuiltins] not specified).");
+</script>
+</body>
+</html>
index eed1297..4baadd3 100644 (file)
@@ -36,7 +36,7 @@
         let element = document.createElement("div");
 
         DOMStringMap.prototype["customProperty"] = 'prototype-value';
-        assert_true(delete element["customProperty"], "");
+        assert_true(delete element.dataset["customProperty"], "");
         assert_equals(DOMStringMap.prototype["customProperty"], 'prototype-value');
     }, "Test that deleting a property that does not exist in the map, but does on the prototype, will return true and not remove the property from the prototype ([OverrideBuiltins] specified).");
 
index 6ac38e8..c420556 100644 (file)
@@ -1,32 +1,6 @@
-localStorage.clear()
-Object.getOwnPropertyNames(localStorage) is ()
-
-Object.defineProperty(localStorage, '1', {value: 'present'})
-Object.getOwnPropertyNames(localStorage) is (1)
-localStorage.getItem('1') is null
-
-delete localStorage[1]
-Object.getOwnPropertyNames(localStorage) is (1)
-
-Object.defineProperty(localStorage, '2', {value: 'present',  configurable: true})
-Object.getOwnPropertyNames(localStorage) is (1,2)
-localStorage.getItem('2') is null
-
-delete localStorage[2]
-Object.getOwnPropertyNames(localStorage) is (1)
-
-Object.defineProperty(localStorage, 'Test', {value: 'present',  configurable: true})
-Object.getOwnPropertyNames(localStorage) is (1,Test)
-localStorage.getItem('Test') is null
-
-delete localStorage['Test']
-Object.getOwnPropertyNames(localStorage) is (1)
-
-Object.defineProperty(localStorage, 'Test1', {value: 'present'})
-Object.getOwnPropertyNames(localStorage) is (1,Test1)
-localStorage.getItem('Test1') is null
-
-delete localStorage['Test1']
-Object.getOwnPropertyNames(localStorage) is (1,Test1)
 
+PASS Object.getOwnPropertyNames(localStorage) on an empty local storage should return an empty array. 
+PASS Object.defineProperty can be used to add items to localStorage. 
+PASS Operator delete can be used to remove items from localStorage. 
+PASS The configurable modifier does effect the result when used in adding properties to localStorage with Object.defineProperty. 
 
index 1c28df5..747a021 100644 (file)
@@ -1,60 +1,34 @@
-<pre id='console'></pre>
+<head>
+    <script src="../../../resources/testharness.js"></script>
+    <script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
 <script>
-function runTest() {
-    function log(msg)
-    {
-        document.getElementById('console').append(msg + '\n');
-    }
+    localStorage.clear();
 
-    function logAndEval(str)
-    {
-        log(str);
-        eval(str);
-    }
+    test(() => {
+        assert_array_equals(Object.getOwnPropertyNames(localStorage), []);
+    }, "Object.getOwnPropertyNames(localStorage) on an empty local storage should return an empty array.");
 
-    if (window.testRunner)
-       testRunner.dumpAsText();
+    test(() => {
+        Object.defineProperty(localStorage, '1', {value: 'present'});
+        assert_equals(localStorage.getItem('1'), 'present');
+        assert_array_equals(Object.getOwnPropertyNames(localStorage), ['1']);
+    }, "Object.defineProperty can be used to add items to localStorage.");
 
-    if (!window.localStorage) {
-        log("window.localStorage DOES NOT exist");
-        return;
-    }
+    test(() => {
+        assert_equals(delete localStorage[1], true);
+        assert_array_equals(Object.getOwnPropertyNames(localStorage), []);
+    }, "Operator delete can be used to remove items from localStorage.");
 
-    logAndEval("localStorage.clear()");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")\n");
-    
-    logAndEval("Object.defineProperty(localStorage, '1', {value: 'present'})");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")");
-    // FIXME: This is incorrect. It should return 'present'. See https://webkit.org/b/172687.
-    log("localStorage.getItem('1') is " + localStorage.getItem('1') + "\n");
-    
-    logAndEval("delete localStorage[1]");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")\n");
-    
-    logAndEval("Object.defineProperty(localStorage, '2', {value: 'present',  configurable: true})");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")");
-    // FIXME: This is incorrect. It should return 'present'. See https://webkit.org/b/172687.
-    log("localStorage.getItem('2') is " + localStorage.getItem('2') + "\n");
-    
-    logAndEval("delete localStorage[2]");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")\n");
+    test(() => {
+        Object.defineProperty(localStorage, '2', {value: 'present', configurable: false});
+        assert_equals(localStorage.getItem('2'), 'present');
+        assert_array_equals(Object.getOwnPropertyNames(localStorage), ['2']);
+        
+        assert_equals(delete localStorage[2], true);
+        assert_array_equals(Object.getOwnPropertyNames(localStorage), []);
+    }, "The configurable modifier does effect the result when used in adding properties to localStorage with Object.defineProperty.");
 
-    logAndEval("Object.defineProperty(localStorage, 'Test', {value: 'present',  configurable: true})");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")");
-    // FIXME: This is incorrect. It should return 'present'. See https://webkit.org/b/172687.
-    log("localStorage.getItem('Test') is " + localStorage.getItem('Test') + "\n");
-  
-    logAndEval("delete localStorage['Test']");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")\n");
-
-    logAndEval("Object.defineProperty(localStorage, 'Test1', {value: 'present'})");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")");
-    // FIXME: This is incorrect. It should return 'present'. See https://webkit.org/b/172687.
-    log("localStorage.getItem('Test1') is " + localStorage.getItem('Test1') + "\n");
-  
-    logAndEval("delete localStorage['Test1']");
-    log("Object.getOwnPropertyNames(localStorage) is (" + Object.getOwnPropertyNames(localStorage) + ")\n");
-}
 </script>
-<body onload="runTest();">
 </body>
index 6083e13..ad21bf6 100644 (file)
@@ -1166,7 +1166,6 @@ set(WebCore_SOURCES
     bindings/js/JSDOMGuardedObject.cpp
     bindings/js/JSDOMMapLike.cpp
     bindings/js/JSDOMPromiseDeferred.cpp
-    bindings/js/JSDOMStringMapCustom.cpp
     bindings/js/JSDOMWindowBase.cpp
     bindings/js/JSDOMWindowCustom.cpp
     bindings/js/JSDOMWindowProperties.cpp
@@ -1189,8 +1188,6 @@ set(WebCore_SOURCES
     bindings/js/JSHTMLEmbedElementCustom.cpp
     bindings/js/JSHTMLFrameSetElementCustom.cpp
     bindings/js/JSHTMLObjectElementCustom.cpp
-    bindings/js/JSHTMLOptionsCollectionCustom.cpp
-    bindings/js/JSHTMLSelectElementCustom.cpp
     bindings/js/JSHTMLTemplateElementCustom.cpp
     bindings/js/JSHistoryCustom.cpp
     bindings/js/JSIDBCursorCustom.cpp
index e8bdb19..f133c05 100644 (file)
@@ -1,3 +1,249 @@
+2017-06-03  Sam Weinig  <sam@webkit.org>
+
+        Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
+        https://bugs.webkit.org/show_bug.cgi?id=172687
+
+        Reviewed by Darin Adler.
+
+        - Adds support for generating the defineOwnProperty ClassInfo method table hook
+          to add support for Object.defineProperty(). The implementation follows WebIDL
+          section 3.9.3 [[DefineOwnProperty]].
+          (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
+        - Adds support for generating named setters in addition to the already supported
+          indexed setters as much of the required work was needed to make defineOwnProperty
+          work for those properties. This patch does not aim to follow WebIDL faithfully,
+          but rather to generate as close to the custom code as possible. A follow up 
+          change will attempt to match WebIDL more closely (which will also require changes
+          to [[GetOwnPropertySlot]]).
+        - Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
+          HTMLSelectElement. Gets us one function away from supporting Storage.
+        - Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
+          together.
+        - Removes support for CustomIndexedSetter, which is no longer used.
+
+        Test: js/dom/legacy-platform-object-defineOwnProperty.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        Removed now unneeded custom bindings.
+
+        * bindings/js/JSDOMStringMapCustom.cpp: Removed.
+        * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
+        * bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
+        * bindings/js/JSHTMLSelectElementCustom.h: Removed.
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::putDelegate): Deleted.
+        Remove more code that is now generated.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateIndexedGetter):
+        - Add missing check for indexed setter operation when determining if the property should be ReadOnly.
+        - Add support for custom implementation name, matching GenerateNamedGetter.
+        - Convert to taking an outputArray and indent to allow more flexibility going forward.
+
+        (GenerateNamedGetter):
+        - Add missing check for named setter operation when determining if the property should be ReadOnly.
+        - Convert to taking an outputArray and indent to allow more flexibility going forward.
+
+        (GenerateGetOwnPropertySlotBody):
+        - Convert to taking an outputArray and indent to allow more flexibility going forward.
+        - Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.
+
+        (GenerateGetOwnPropertySlotBodyByIndex):
+        - Convert to taking an outputArray and indent to allow more flexibility going forward.
+        - Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.
+
+        (GenerateGetOwnPropertyNames):
+        - Convert to taking an outputArray and indent to allow more flexibility going forward.
+        - Take over responsibility for checking and bailing if CustomEnumerateProperty is set.
+
+        (GenerateInvokeIndexedPropertySetter):
+        Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)
+
+        (GenerateInvokeNamedPropertySetter):
+        Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)
+
+        (GeneratePut):
+        (GeneratePutByIndex):
+        - Convert to taking an outputArray and indent to allow more flexibility going forward.
+        - Take over responsibility for checking and bailing if CustomPut is set.
+        - Adds support for CEReactions.
+        - Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
+          simplify code.
+        - Removes support for CustomIndexedSetter, which is no longer used.
+        - Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
+          has it, which is how it is specified to work.
+
+        (GenerateIsUnforgeablePropertyName):
+        Added. Helper subroutine to generate a function that compares a property name
+        agains all the property names defined as Unforgeable on the interface. Used by
+        GenerateDefineOwnProperty.
+
+        (GenerateDefineOwnProperty):
+        Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
+        Adds support for CEReactions.
+
+        (GenerateDeletePropertyCommon):
+        Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.
+
+        (GenerateNamedDeleterDefinition):
+        Switch signature to match peer generators.
+
+        (InstanceOverridesGetOwnPropertySlot):
+        Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.
+
+        (InstanceOverridesGetOwnPropertySlotByIndex):
+        Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex 
+        rather than CustomGetOwnPropertySlot.
+
+        (InstanceOverridesGetOwnPropertyNames):
+        Added. Moves complex predicate out of line.
+
+        (InstanceOverridesPut):
+        Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.
+
+        (InstanceOverridesDefineOwnProperty):
+        Added.
+
+        (GenerateHeader):
+        - Moves more structure flags together.
+        - Simplifies predicates and moves the ClassInfo method table hooks together.
+
+        (GenerateImplementation):
+        - Moves the ClassInfo method table hooks together
+        - Adds call to GenerateDefineOwnProperty.
+
+        (GenerateLegacyCallerDefinitions):
+        Simplify bail condition to match other generators.
+
+        (GeneratePrototypeDeclaration):
+        Update for new extended attribute names.
+
+        (InstanceOverridesCall): 
+        Renamed from IsCallable for consistency.
+        
+        (HasComplexGetOwnProperty): 
+        Deleted. Unused.
+        
+        (InstanceOverridesPutImplementation): 
+        Deleted. Unused.
+        
+        (InstanceOverridesPutDeclaration): 
+        Deleted. Unused.
+        
+        (IsCallable): 
+        Renamed, for consistency, to InstanceOverridesCall .
+
+        * bindings/scripts/IDLAttributes.json:
+        Renames a few of the extended attributes to remove the JS prefix. This time
+        around I only did the ones in the area I was working, but we should probably
+        remove most of the rest.
+    
+        * css/CSSStyleDeclaration.idl:
+        Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
+
+        * dom/DOMStringMap.idl:
+        Remove CustomNamedSetter and add uncomment out the setter.
+
+        * dom/DatasetDOMStringMap.cpp:
+        (WebCore::DatasetDOMStringMap::setNamedItem):
+        (WebCore::DatasetDOMStringMap::setItem): Deleted.
+        * dom/DatasetDOMStringMap.h:
+        Rename setItem to setNamedItem, which is what the generator expects.
+
+        * dom/Node.idl:
+        Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
+
+        * html/HTMLAppletElement.idl:
+        * html/HTMLEmbedElement.idl:
+        * html/HTMLObjectElement.idl:
+        Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
+
+        * html/HTMLCollection.cpp:
+        (WebCore::HTMLCollection::isSupportedPropertyName):
+        * html/HTMLCollection.h:
+        Add isSupportedPropertyName function which is used by the bindings and is now needed.
+
+        * html/HTMLElement.idl:
+        Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
+
+        * html/HTMLOptionsCollection.h:
+        (WebCore::HTMLOptionsCollection::setItem):
+        Add setItem() implementation which just forwards to the select element. Also, add 
+        a type alias to make the implementations of item and namedItem less verbose.
+
+        * html/HTMLOptionsCollection.idl:
+        Remove CustomIndexedSetter and uncomment the setter.
+
+        * html/HTMLSelectElement.idl:
+        Remove CustomIndexedSetter and uncomment the setter. Also, reformat
+        to match the WHATWG spec.
+
+        * page/DOMWindow.idl:
+        Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add 
+        CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
+        assumptions the generator was making.
+
+        * page/Location.idl:
+        Update for removal of JS prefix from a bunch of extended attributes.
+
+        * page/UserMessageHandlersNamespace.idl:
+        Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
+
+        * storage/Storage.idl:
+        Remove CustomNamedSetter and uncomment the setter.
+
+        * bindings/scripts/test/JS/JSInterfaceName.h:
+        * bindings/scripts/test/JS/JSTestEventTarget.h:
+        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
+        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
+        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
+        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
+        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
+        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
+        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
+        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
+        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
+        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
+        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
+        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
+        * bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
+        * bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
+        * bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
+        * bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
+        * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
+        * bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
+        * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
+        * bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
+        * bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
+        * bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
+        * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
+        * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
+        * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
+        Added new tests and updated some results.
+
 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
 
         Object bounding box wrong for some paths
index 3d09602..e16ea5f 100644 (file)
                447958051643B4B2001E0A7F /* ParsedContentType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 447958021643B47B001E0A7F /* ParsedContentType.cpp */; };
                448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                448A29C00A46D9CB0030759F /* JSHTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 448A29BE0A46D9CB0030759F /* JSHTMLOptionsCollection.cpp */; };
-               448AD27C0A48137A0023D179 /* JSHTMLOptionsCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */; };
                448B1B7A0F3A2F9B0047A9E2 /* TextSizeAdjustment.h in Headers */ = {isa = PBXBuildFile; fileRef = 448B1B780F3A2F9B0047A9E2 /* TextSizeAdjustment.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4496E39D1398136C003EE32A /* JSSVGAnimateMotionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4496E39B1398136C003EE32A /* JSSVGAnimateMotionElement.cpp */; };
                4496E39E1398136C003EE32A /* JSSVGAnimateMotionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4496E39C1398136C003EE32A /* JSSVGAnimateMotionElement.h */; };
                AB247A6C0AFD6383003FA5FD /* RenderSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB247A6A0AFD6383003FA5FD /* RenderSlider.cpp */; };
                AB247A6D0AFD6383003FA5FD /* RenderSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = AB247A6B0AFD6383003FA5FD /* RenderSlider.h */; };
                AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AB31C91D10AE1B8E000C7B92 /* LineClampValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               AB4CB4EB0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */; };
                AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB67D1A6097F3AE300F9392E /* RenderTextControl.cpp */; };
                AB67D1A9097F3AE300F9392E /* RenderTextControl.h in Headers */ = {isa = PBXBuildFile; fileRef = AB67D1A7097F3AE300F9392E /* RenderTextControl.h */; settings = {ATTRIBUTES = (Private, ); }; };
                AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = AB7170880B3118080017123E /* SearchPopupMenu.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC128B01137C8D4600CAC845 /* RenderGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC128B00137C8D4600CAC845 /* RenderGrid.cpp */; };
                BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */; };
                BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1402890E83680800319717 /* ScrollbarThemeComposite.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */; };
                BC1A7D9718FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1A7D9518FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp */; };
                BC1A7D9818FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A7D9618FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h */; };
                BC1BDF24156C1883001C1243 /* DOMError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1BDF20156C17A9001C1243 /* DOMError.cpp */; };
                BC64641D11D7F416006455B0 /* DatasetDOMStringMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64641B11D7F416006455B0 /* DatasetDOMStringMap.cpp */; };
                BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64649511D82349006455B0 /* JSDOMStringMap.cpp */; };
                BC64649811D82349006455B0 /* JSDOMStringMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64649611D82349006455B0 /* JSDOMStringMap.h */; };
-               BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */; };
                BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4C90CB4295D005F2B62 /* CachedFont.cpp */; };
                BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CA0CB4295D005F2B62 /* CachedFont.h */; };
                BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */; };
                447958031643B47B001E0A7F /* ParsedContentType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParsedContentType.h; sourceTree = "<group>"; };
                448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionsCollection.h; sourceTree = "<group>"; };
                448A29BE0A46D9CB0030759F /* JSHTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionsCollection.cpp; sourceTree = "<group>"; };
-               448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionsCollectionCustom.cpp; sourceTree = "<group>"; };
                448B1B780F3A2F9B0047A9E2 /* TextSizeAdjustment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextSizeAdjustment.h; sourceTree = "<group>"; };
                449098B10F8F82520076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                4496E39B1398136C003EE32A /* JSSVGAnimateMotionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimateMotionElement.cpp; sourceTree = "<group>"; };
                AB247A6A0AFD6383003FA5FD /* RenderSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSlider.cpp; sourceTree = "<group>"; };
                AB247A6B0AFD6383003FA5FD /* RenderSlider.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderSlider.h; sourceTree = "<group>"; };
                AB31C91D10AE1B8E000C7B92 /* LineClampValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineClampValue.h; sourceTree = "<group>"; };
-               AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLSelectElementCustom.h; sourceTree = "<group>"; };
                AB67D1A6097F3AE300F9392E /* RenderTextControl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControl.cpp; sourceTree = "<group>"; };
                AB67D1A7097F3AE300F9392E /* RenderTextControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTextControl.h; sourceTree = "<group>"; };
                AB7170880B3118080017123E /* SearchPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SearchPopupMenu.h; sourceTree = "<group>"; };
                BC128B00137C8D4600CAC845 /* RenderGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderGrid.cpp; sourceTree = "<group>"; };
                BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeComposite.cpp; sourceTree = "<group>"; };
                BC1402890E83680800319717 /* ScrollbarThemeComposite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeComposite.h; sourceTree = "<group>"; };
-               BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElementCustom.cpp; sourceTree = "<group>"; };
                BC1A7D9518FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnSpannerPlaceholder.cpp; sourceTree = "<group>"; };
                BC1A7D9618FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnSpannerPlaceholder.h; sourceTree = "<group>"; };
                BC1BDF20156C17A9001C1243 /* DOMError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMError.cpp; sourceTree = "<group>"; };
                BC64647911D800CD006455B0 /* DOMStringMap.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMStringMap.idl; sourceTree = "<group>"; };
                BC64649511D82349006455B0 /* JSDOMStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringMap.cpp; sourceTree = "<group>"; };
                BC64649611D82349006455B0 /* JSDOMStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMStringMap.h; sourceTree = "<group>"; };
-               BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringMapCustom.cpp; sourceTree = "<group>"; };
                BC64B4C90CB4295D005F2B62 /* CachedFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedFont.cpp; sourceTree = "<group>"; };
                BC64B4CA0CB4295D005F2B62 /* CachedFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFont.h; sourceTree = "<group>"; };
                BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFace.cpp; sourceTree = "<group>"; };
                                DEC2975D1B4DEB2A005F5945 /* JSCustomEventCustom.cpp */,
                                49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
                                ADDA94BF19686F8000453029 /* JSDocumentCustom.h */,
-                               BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */,
                                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
                                652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
                                C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */,
                                BC6D44BD0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp */,
                                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */,
                                BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */,
-                               448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */,
-                               BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
-                               AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
                                D6F7960C166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp */,
                                7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
                                BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
                                1AE2AEC80A1D297B00B42B25 /* JSHTMLQuoteElement.h in Headers */,
                                1AE2ABAD0A1CE90500B42B25 /* JSHTMLScriptElement.h in Headers */,
                                E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */,
-                               AB4CB4EB0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h in Headers */,
                                9B69D3B91B99100700E3512B /* JSHTMLSlotElement.h in Headers */,
                                E446143C0CD689CC00FADA75 /* JSHTMLSourceElement.h in Headers */,
                                9752D38E1413104B003305BD /* JSHTMLSpanElement.h in Headers */,
                                BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
                                C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
                                BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
-                               BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
                                7694563C1214D97C0007CBAE /* JSDOMTokenList.cpp in Sources */,
                                2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
                                1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
                                A80E7E9C0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.cpp in Sources */,
                                A80E7E9A0A1A83E3007FB8C5 /* JSHTMLOptionElement.cpp in Sources */,
                                448A29C00A46D9CB0030759F /* JSHTMLOptionsCollection.cpp in Sources */,
-                               448AD27C0A48137A0023D179 /* JSHTMLOptionsCollectionCustom.cpp in Sources */,
                                4AD0173C127E82860015035F /* JSHTMLOutputElement.cpp in Sources */,
                                1AE2ABA60A1CE90500B42B25 /* JSHTMLParagraphElement.cpp in Sources */,
                                1AE2ABA80A1CE90500B42B25 /* JSHTMLParamElement.cpp in Sources */,
                                1AE2AEC70A1D297B00B42B25 /* JSHTMLQuoteElement.cpp in Sources */,
                                1AE2ABAC0A1CE90500B42B25 /* JSHTMLScriptElement.cpp in Sources */,
                                E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */,
-                               BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */,
                                9B69D3B81B99100700E3512B /* JSHTMLSlotElement.cpp in Sources */,
                                E446143B0CD689CC00FADA75 /* JSHTMLSourceElement.cpp in Sources */,
                                9752D38D1413104B003305BD /* JSHTMLSpanElement.cpp in Sources */,
index 8a606de..612d8d5 100644 (file)
@@ -51,7 +51,6 @@
 #include "JSDOMGlobalObject.cpp"
 #include "JSDOMGlobalObjectTask.cpp"
 #include "JSDOMPromiseDeferred.cpp"
-#include "JSDOMStringMapCustom.cpp"
 #include "JSDOMWindowBase.cpp"
 #include "JSDOMWindowCustom.cpp"
 #include "JSDOMWindowProperties.cpp"
@@ -74,8 +73,6 @@
 #include "JSHTMLEmbedElementCustom.cpp"
 #include "JSHTMLFrameSetElementCustom.cpp"
 #include "JSHTMLObjectElementCustom.cpp"
-#include "JSHTMLOptionsCollectionCustom.cpp"
-#include "JSHTMLSelectElementCustom.cpp"
 #include "JSHTMLTemplateElementCustom.cpp"
 #include "JSHistoryCustom.cpp"
 #include "JSImageDataCustom.cpp"
diff --git a/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
deleted file mode 100644 (file)
index 356679a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "JSHTMLOptionsCollection.h"
-
-#include "CustomElementReactionQueue.h"
-#include "ExceptionCode.h"
-#include "JSHTMLOptionElement.h"
-#include "JSHTMLSelectElement.h"
-#include "JSHTMLSelectElementCustom.h"
-#include <wtf/MathExtras.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-void JSHTMLOptionsCollection::indexSetter(ExecState* state, unsigned index, JSValue value)
-{
-    CustomElementReactionStack customElementReactionStack;
-    selectElementIndexSetter(*state, wrapped().selectElement(), index, value);
-}
-
-}
diff --git a/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp
deleted file mode 100644 (file)
index c74aed3..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Alexey Proskuryakov (ap@webkit.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "JSHTMLSelectElementCustom.h"
-
-#include "CustomElementReactionQueue.h"
-#include "ExceptionCode.h"
-#include "HTMLNames.h"
-#include "HTMLOptionElement.h"
-#include "HTMLSelectElement.h"
-#include "JSHTMLOptionElement.h"
-#include "JSHTMLSelectElement.h"
-
-namespace WebCore {
-
-using namespace JSC;
-using namespace HTMLNames;
-
-void selectElementIndexSetter(JSC::ExecState& state, HTMLSelectElement& element, unsigned index, JSC::JSValue value)
-{
-    VM& vm = state.vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-
-    auto* option = convert<IDLNullable<IDLInterface<HTMLOptionElement>>>(state, value);
-    RETURN_IF_EXCEPTION(throwScope, void());
-
-    propagateException(state, throwScope, element.setItem(index, option));
-}
-
-void JSHTMLSelectElement::indexSetter(JSC::ExecState* state, unsigned index, JSC::JSValue value)
-{
-    CustomElementReactionStack customElementReactionStack;
-    selectElementIndexSetter(*state, wrapped(), index, value);
-}
-
-}
diff --git a/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.h b/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.h
deleted file mode 100644 (file)
index e012bcc..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#pragma once
-
-namespace JSC {
-class ExecState;
-class JSValue;
-}
-
-namespace WebCore {
-
-class HTMLSelectElement;
-
-void selectElementIndexSetter(JSC::ExecState&, HTMLSelectElement&, unsigned index, JSC::JSValue);
-
-}
index ce7482d..739b6c7 100644 (file)
@@ -60,34 +60,4 @@ void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* state, Property
     Base::getOwnPropertyNames(&thisObject, state, propertyNames, mode);
 }
 
-bool JSStorage::putDelegate(ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot&, bool& putResult)
-{
-    VM& vm = state->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    if (propertyName.isSymbol())
-        return false;
-
-    // Only perform the custom put if the object doesn't have a native property by this name.
-    // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
-    // the native property slots manually.
-    PropertySlot slot { this, PropertySlot::InternalMethodType::GetOwnProperty };
-
-    JSValue prototype = this->getPrototypeDirect();
-    if (prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))
-        return false;
-
-    auto stringValue = convert<IDLDOMString>(*state, value);
-    RETURN_IF_EXCEPTION(scope, true);
-
-    auto setItemResult = wrapped().setItem(propertyNameToString(propertyName), stringValue);
-    if (setItemResult.hasException()) {
-        propagateException(*state, scope, setItemResult.releaseException());
-        return true;
-    }
-
-    putResult = true;
-    return true;
-}
-
 } // namespace WebCore
index 7f5322d..51b4d2f 100644 (file)
@@ -406,143 +406,138 @@ sub ShouldUseGlobalObjectPrototype
 
 sub GenerateIndexedGetter
 {
-    my ($interface, $indexedGetterOperation) = @_;
-
-    my @output = ();
-
+    my ($outputArray, $indent, $interface, $indexedGetterOperation) = @_;
+    
     my @attributes = ();
-    push(@attributes, "ReadOnly") if !$interface->extendedAttributes->{CustomNamedSetter};
+    push(@attributes, "ReadOnly") if !GetIndexedSetterOperation($interface) && !$interface->extendedAttributes->{CustomNamedSetter};
 
     my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0");
 
-    my $indexedGetterFunctionName = $indexedGetterOperation->name || "item";
+    my $indexedGetterFunctionName = $indexedGetterOperation->extendedAttributes->{ImplementedAs} || $indexedGetterOperation->name || "item";
     my $nativeToJSConversion = NativeToJSValueUsingPointers($indexedGetterOperation, $interface, "thisObject->wrapped().${indexedGetterFunctionName}(index)", "*thisObject->globalObject()");
 
-    push(@output, "        slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n");
-    push(@output, "        return true;\n");
-
-    return @output;
+    push(@$outputArray, $indent . "slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n");
+    push(@$outputArray, $indent . "return true;\n");
 }
 
 sub GenerateNamedGetter
 {
-    my ($interface, $namedGetterOperation) = @_;
-
-    my @output = ();
+    my ($outputArray, $indent, $interface, $namedGetterOperation) = @_;
 
     my @attributes = ();
-    push(@attributes, "ReadOnly") if !$interface->extendedAttributes->{CustomNamedSetter};
+    push(@attributes, "ReadOnly") if !GetNamedSetterOperation($interface) && !$interface->extendedAttributes->{CustomNamedSetter};
     push(@attributes, "DontEnum") if $interface->extendedAttributes->{LegacyUnenumerableNamedProperties};
 
     my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0");
 
     if ($interface->extendedAttributes->{CustomNamedGetter}) {
-        push(@output, "        JSValue value;\n");
-        push(@output, "        if (thisObject->nameGetter(state, propertyName, value)) {\n");
-        push(@output, "            slot.setValue(thisObject, ${attributeString}, value);\n");
+        push(@$outputArray, $indent . "JSValue value;\n");
+        push(@$outputArray, $indent . "if (thisObject->nameGetter(state, propertyName, value)) {\n");
+        push(@$outputArray, $indent . "    slot.setValue(thisObject, ${attributeString}, value);\n");
     } else {
         my $namedGetterFunctionName = $namedGetterOperation->extendedAttributes->{ImplementedAs} || $namedGetterOperation->name || "namedItem";
         my $itemVariable = "item";
-        push(@output, "        auto item = thisObject->wrapped().${namedGetterFunctionName}(propertyNameToAtomicString(propertyName));\n");
+        push(@$outputArray, $indent . "auto item = thisObject->wrapped().${namedGetterFunctionName}(propertyNameToAtomicString(propertyName));\n");
 
         if ($namedGetterOperation->extendedAttributes->{MayThrowException}) {
-            push(@output, "        if (item.hasException()) {\n");
-            push(@output, "            auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
-            push(@output, "            propagateException(*state, throwScope, item.releaseException());\n");
-            push(@output, "            return true;\n");
-            push(@output, "        }\n\n");
-            push(@output, "        auto itemValue = item.releaseReturnValue();\n");
+            push(@$outputArray, $indent . "if (item.hasException()) {\n");
+            push(@$outputArray, $indent . "    auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
+            push(@$outputArray, $indent . "    propagateException(*state, throwScope, item.releaseException());\n");
+            push(@$outputArray, $indent . "    return true;\n");
+            push(@$outputArray, $indent . "}\n\n");
+            push(@$outputArray, $indent . "auto itemValue = item.releaseReturnValue();\n");
 
             $itemVariable = "itemValue";
         }
 
         my $IDLType = GetIDLType($interface, $namedGetterOperation->type);
-        push(@output, "        if (!${IDLType}::isNullValue(${itemVariable})) {\n");
-
         my $nativeToJSConversion = NativeToJSValueUsingPointers($namedGetterOperation, $interface, $itemVariable, "*thisObject->globalObject()", 1);
-        push(@output, "            slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n");
+        push(@$outputArray, $indent . "if (!${IDLType}::isNullValue(${itemVariable})) {\n");
+        push(@$outputArray, $indent . "    slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n");
     }
     
-    push(@output, "            return true;\n");
-    push(@output, "        }\n");
-
-    return @output;
+    push(@$outputArray, $indent . "    return true;\n");
+    push(@$outputArray, $indent . "}\n");
 }
 
 sub GenerateGetOwnPropertySlotBody
 {
-    my ($interface, $className, $indexedGetterOperation, $namedGetterOperation) = @_;
-
-    my @output = ();
-
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomGetOwnPropertySlot};
+    
+    my $namedGetterOperation = GetNamedGetterOperation($interface);
+    my $indexedGetterOperation = GetIndexedGetterOperation($interface);
+    
     my $ownPropertyCheck = sub {
-        push(@output, "    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n");
-        push(@output, "        return true;\n");
+        push(@$outputArray, "    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n");
+        push(@$outputArray, "        return true;\n");
     };
 
     # FIXME: As per the Web IDL specification, the prototype check is supposed to skip "named properties objects":
     # https://heycam.github.io/webidl/#dfn-named-property-visibility
     # https://heycam.github.io/webidl/#dfn-named-properties-object
     my $prototypeCheck = sub {
-        push(@output, "    JSValue proto = thisObject->getPrototypeDirect();\n");
-        push(@output, "    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))\n");
-        push(@output, "        return false;\n\n");
+        push(@$outputArray, "    JSValue proto = thisObject->getPrototypeDirect();\n");
+        push(@$outputArray, "    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))\n");
+        push(@$outputArray, "        return false;\n\n");
     };
 
-    push(@output, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
-    push(@output, "{\n");
-    push(@output, "    auto* thisObject = jsCast<${className}*>(object);\n");
-    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+    push(@$outputArray, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@$outputArray, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
 
 
     if ($indexedGetterOperation) {
-        push(@output, "    auto optionalIndex = parseIndex(propertyName);\n");
-        push(@output, "    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n");
-        push(@output, "        auto index = optionalIndex.value();\n");
-        push(@output, GenerateIndexedGetter($interface, $indexedGetterOperation));
-        push(@output, "    }\n");
+        push(@$outputArray, "    auto optionalIndex = parseIndex(propertyName);\n");
+        push(@$outputArray, "    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n");
+        push(@$outputArray, "        auto index = optionalIndex.value();\n");
+        GenerateIndexedGetter($outputArray, "        ", $interface, $indexedGetterOperation);
+        push(@$outputArray, "    }\n");
     }
 
     my $hasNamedGetter = $namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter};
     if ($hasNamedGetter) {
-        if (!$interface->extendedAttributes->{OverrideBuiltins}) {
+        if (!$codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins")) {
             &$ownPropertyCheck();
             &$prototypeCheck();
         }
         if ($indexedGetterOperation) {
-            push(@output, "    if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n");
+            push(@$outputArray, "    if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n");
         } else {
-            push(@output, "    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n");
+            push(@$outputArray, "    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n");
         }
-        push(@output, GenerateNamedGetter($interface, $namedGetterOperation));
-        push(@output, "    }\n");
+        GenerateNamedGetter($outputArray, "        ", $interface, $namedGetterOperation);
+        push(@$outputArray, "    }\n");
     }
 
-    if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
-        push(@output, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
-        push(@output, "        return true;\n");
+    if ($interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}) {
+        push(@$outputArray, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
+        push(@$outputArray, "        return true;\n");
     }
 
-    if (!$hasNamedGetter || $interface->extendedAttributes->{OverrideBuiltins}) {
+    if (!$hasNamedGetter || $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins")) {
         &$ownPropertyCheck();
     }
 
-    push(@output, "    return false;\n");
-    push(@output, "}\n\n");
-
-    return @output;
+    push(@$outputArray, "    return false;\n");
+    push(@$outputArray, "}\n\n");
 }
 
 sub GenerateGetOwnPropertySlotBodyByIndex
 {
-    my ($interface, $className, $indexedGetterOperation, $namedGetterOperation) = @_;
-
-    my @output = ();
-
-    push(@output, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)\n");
-    push(@output, "{\n");
-    push(@output, "    auto* thisObject = jsCast<${className}*>(object);\n");
-    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomGetOwnPropertySlotByIndex};
+    
+    my $namedGetterOperation = GetNamedGetterOperation($interface);
+    my $indexedGetterOperation = GetIndexedGetterOperation($interface);
+    
+    push(@$outputArray, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@$outputArray, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
     
     # Sink the int-to-string conversion that happens when we create a PropertyName
     # to the point where we actually need it.
@@ -551,55 +546,55 @@ sub GenerateGetOwnPropertySlotBodyByIndex
         if ($generatedPropertyName) {
             return;
         }
-        push(@output, "    Identifier propertyName = Identifier::from(state, index);\n");
+        push(@$outputArray, "    Identifier propertyName = Identifier::from(state, index);\n");
         $generatedPropertyName = 1;
     };
     
     if ($indexedGetterOperation) {
-        push(@output, "    if (LIKELY(index < thisObject->wrapped().length())) {\n");
-        push(@output, GenerateIndexedGetter($interface, $indexedGetterOperation));
-        push(@output, "    }\n");
+        push(@$outputArray, "    if (LIKELY(index < thisObject->wrapped().length())) {\n");
+        GenerateIndexedGetter($outputArray, "        ", $interface, $indexedGetterOperation);
+        push(@$outputArray, "    }\n");
     }
 
     # Indexing an object with an integer that is not a supported property index should not call the named property getter.
     # https://heycam.github.io/webidl/#idl-indexed-properties
     if (!$indexedGetterOperation && ($namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter})) {
         &$propertyNameGeneration();
-        push(@output, "    if (thisObject->classInfo() == info()) {\n");
-        push(@output, GenerateNamedGetter($interface, $namedGetterOperation));
-        push(@output, "    }\n");
+        push(@$outputArray, "    if (thisObject->classInfo() == info()) {\n");
+        GenerateNamedGetter($outputArray, "        ", $interface, $namedGetterOperation);
+        push(@$outputArray, "    }\n");
     }
 
-    if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
+    if ($interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}) {
         &$propertyNameGeneration();
-        push(@output, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
-        push(@output, "        return true;\n");
+        push(@$outputArray, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
+        push(@$outputArray, "        return true;\n");
     }
 
-    push(@output, "    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);\n");
-    push(@output, "}\n\n");
-
-    return @output;
+    push(@$outputArray, "    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);\n");
+    push(@$outputArray, "}\n\n");
 }
 
+# https://heycam.github.io/webidl/#legacy-platform-object-property-enumeration
 sub GenerateGetOwnPropertyNames
 {
-    my ($interface, $className, $indexedGetterOperation, $namedGetterOperation) = @_;
-
-    my @output = ();
-
-    # Property enumeration - https://heycam.github.io/webidl/#legacy-platform-object-property-enumeration
-
-    push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)\n");
-    push(@implContent, "{\n");
-    push(@implContent, "    auto* thisObject = jsCast<${className}*>(object);\n");
-    push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomEnumerateProperty};
+    
+    my $namedGetterOperation = GetNamedGetterOperation($interface);
+    my $indexedGetterOperation = GetIndexedGetterOperation($interface);
+    
+    push(@$outputArray, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@$outputArray, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
 
     # 1. If the object supports indexed properties, then the object’s supported
     #    property indices are enumerated first, in numerical order.
     if ($indexedGetterOperation) {
-        push(@implContent, "    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)\n");
-        push(@implContent, "        propertyNames.add(Identifier::from(state, i));\n");
+        push(@$outputArray, "    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)\n");
+        push(@$outputArray, "        propertyNames.add(Identifier::from(state, i));\n");
     }
 
     # 2. If the object supports named properties and doesn’t implement an interface
@@ -609,125 +604,334 @@ sub GenerateGetOwnPropertyNames
     #    the definition of the set of supported property names.
     if ($namedGetterOperation) {
         if (!$interface->extendedAttributes->{LegacyUnenumerableNamedProperties}) {
-            push(@implContent, "    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
-            push(@implContent, "        propertyNames.add(Identifier::fromString(state, propertyName));\n");
+            push(@$outputArray, "    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
+            push(@$outputArray, "        propertyNames.add(Identifier::fromString(state, propertyName));\n");
         } else {
-            push(@implContent, "    if (mode.includeDontEnumProperties()) {\n");
-            push(@implContent, "        for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
-            push(@implContent, "            propertyNames.add(Identifier::fromString(state, propertyName));\n");
-            push(@implContent, "    }\n");
+            push(@$outputArray, "    if (mode.includeDontEnumProperties()) {\n");
+            push(@$outputArray, "        for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
+            push(@$outputArray, "            propertyNames.add(Identifier::fromString(state, propertyName));\n");
+            push(@$outputArray, "    }\n");
         }
     }
+    
     # 3. Finally, any enumerable own properties or properties from the object’s
     #    prototype chain are then enumerated, in no defined order.
-    push(@implContent, "    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n");
-    push(@implContent, "}\n\n");
-
-    return @output;
+    push(@$outputArray, "    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n");
+    push(@$outputArray, "}\n\n");
 }
 
-sub GeneratePut
+# https://heycam.github.io/webidl/#invoke-indexed-setter
+sub GenerateInvokeIndexedPropertySetter
 {
-    my ($interface, $className, $indexedSetterOperation, $namedSetterOperation) = @_;
-
-    assert("Named setters are not supported.") if $namedSetterOperation;
-
-    my @output = ();
-
-    push(@output, "bool ${className}::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n");
-    push(@output, "{\n");
-    push(@output, "    auto* thisObject = jsCast<${className}*>(cell);\n");
-    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+    my ($outputArray, $indent, $interface, $indexedSetterOperation, $indexExpression, $value) = @_;
     
-    if ($indexedSetterOperation || $interface->extendedAttributes->{CustomIndexedSetter}) {
-        if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-            push(@output, "    if (auto index = parseIndex(propertyName)) {\n");
-            push(@output, "        thisObject->indexSetter(state, index.value(), value);\n");
-            push(@output, "        return true;\n");
-            push(@output, "    }\n");
-        } else {
-            # The second argument of the indexed setter operation is the argument being converted.
-            my $argument = @{$indexedSetterOperation->arguments}[1];
-            my $nativeValue = JSValueToNative($interface, $argument, "value", $indexedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", "");
-
-            push(@output, "    if (auto index = parseIndex(propertyName)) {\n");
-            push(@output, "        auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
-            push(@output, "        auto nativeValue = ${nativeValue};\n");
-            push(@output, "        RETURN_IF_EXCEPTION(throwScope, true);\n");
+    # The second argument of the indexed setter operation is the argument being converted.
+    my $argument = @{$indexedSetterOperation->arguments}[1];
+    my $nativeValue = JSValueToNative($interface, $argument, $value, $indexedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", "");
+    
+    push(@$outputArray, $indent . "auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
+    push(@$outputArray, $indent . "auto nativeValue = ${nativeValue};\n");
+    push(@$outputArray, $indent . "RETURN_IF_EXCEPTION(throwScope, true);\n");
+    
+    my $indexedSetterFunctionName = $indexedSetterOperation->name || "setItem";
+    my $nativeValuePassExpression = PassArgumentExpression("nativeValue", $argument);
+    my $functionString = "thisObject->wrapped().${indexedSetterFunctionName}(${indexExpression}, ${nativeValuePassExpression})";
+    $functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation);
+    
+    push(@$outputArray, $indent . $functionString . ";\n");
+}
 
-            my $indexedSetterFunctionName = $indexedSetterOperation->name || "setItem";
-            my $functionString = "${indexedSetterFunctionName}(index, WTFMove(nativeValue))";
-            $functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation);
+# https://heycam.github.io/webidl/#invoke-named-setter
+sub GenerateInvokeNamedPropertySetter
+{
+    my ($outputArray, $indent, $interface, $namedSetterOperation, $value) = @_;
+    
+    my $argument = @{$namedSetterOperation->arguments}[1];
+    my $nativeValue = JSValueToNative($interface, $argument, $value, $namedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", "");
+    
+    push(@$outputArray, $indent . "auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
+    push(@$outputArray, $indent . "auto nativeValue = ${nativeValue};\n");
+    push(@$outputArray, $indent . "RETURN_IF_EXCEPTION(throwScope, true);\n");
+    
+    my $namedSetterFunctionName = $namedSetterOperation->name || "setNamedItem";
+    my $nativeValuePassExpression = PassArgumentExpression("nativeValue", $argument);
+    my $functionString = "thisObject->wrapped().${namedSetterFunctionName}(propertyNameToString(propertyName), ${nativeValuePassExpression})";
+    $functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($namedSetterOperation);
+    
+    push(@$outputArray, $indent . $functionString . ";\n");
+}
 
-            push(@output, "        ${functionString};\n");
-            push(@output, "        return true;\n");
-            push(@output, "    }\n");
+sub GeneratePut
+{
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomPutFunction};
+    
+    my $namedSetterOperation = GetNamedSetterOperation($interface);
+    my $indexedSetterOperation = GetIndexedSetterOperation($interface);
+    
+    push(@$outputArray, "bool ${className}::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    auto* thisObject = jsCast<${className}*>(cell);\n");
+    push(@$outputArray, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n\n");
+    
+    if (($namedSetterOperation && $namedSetterOperation->extendedAttributes->{CEReactions}) || ($indexedSetterOperation && $indexedSetterOperation->extendedAttributes->{CEReactions})) {
+        push(@$outputArray, "    CustomElementReactionStack customElementReactionStack;\n\n");
+        AddToImplIncludes("CustomElementReactionQueue.h");
+    }
+    
+    if ($indexedSetterOperation) {
+        push(@$outputArray, "    if (auto index = parseIndex(propertyName)) {\n");
+        
+        GenerateInvokeIndexedPropertySetter($outputArray, "        ", $interface, $indexedSetterOperation, "index.value()", "value");
+        
+        push(@$outputArray, "        return true;\n");
+        push(@$outputArray, "    }\n\n");
+    }
+    
+    if ($namedSetterOperation) {
+        # FIMXE: We need a more comprehensive story for Symbols.
+        push(@$outputArray, "    if (!propertyName.isSymbol()) {\n");
+        
+        my $additionalIndent = "";
+        
+        my $overrideBuiltins = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins");
+        if (!$overrideBuiltins) {
+            push(@$outputArray, "        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n");
+            push(@$outputArray, "        JSValue prototype = thisObject->getPrototypeDirect();\n");
+            push(@$outputArray, "        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {\n");
+            $additionalIndent .= "    ";
+        }
+        
+        GenerateInvokeNamedPropertySetter($outputArray, $additionalIndent . "        ", $interface, $namedSetterOperation, "value");
+        push(@$outputArray, $additionalIndent . "        return true;\n");
+        
+        if (!$overrideBuiltins) {
+            push(@$outputArray, "        }\n");
         }
+        
+        push(@$outputArray, "    }\n\n");
     }
     
+    assert("Using both a named property setter and [CustomNamedSetter] together is not supported.") if $namedSetterOperation && $interface->extendedAttributes->{CustomNamedSetter};
     if ($interface->extendedAttributes->{CustomNamedSetter}) {
-        push(@output, "    bool putResult = false;\n");
-        push(@output, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
-        push(@output, "        return putResult;\n");
+        push(@$outputArray, "    bool putResult = false;\n");
+        push(@$outputArray, "    if (thisObject->putDelegate(state, propertyName, value, putPropertySlot, putResult))\n");
+        push(@$outputArray, "        return putResult;\n\n");
     }
-
-    push(@output, "    return Base::put(thisObject, state, propertyName, value, slot);\n");
-    push(@output, "}\n\n");
-
-    return @output;
+    
+    push(@$outputArray, "    return Base::put(thisObject, state, propertyName, value, putPropertySlot);\n");
+    push(@$outputArray, "}\n\n");
 }
 
 sub GeneratePutByIndex
 {
-    my ($interface, $className, $indexedSetterOperation, $namedSetterOperation) = @_;
-
-    assert("Named setters are not supported.") if $namedSetterOperation;
-
-    my @output = ();
-
-    push(@output, "bool ${className}::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)\n");
-    push(@output, "{\n");
-    push(@output, "    auto* thisObject = jsCast<${className}*>(cell);\n");
-    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-
-    if ($indexedSetterOperation || $interface->extendedAttributes->{CustomIndexedSetter}) {
-        if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-            push(@output, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
-            push(@output, "        thisObject->indexSetter(state, index, value);\n");
-            push(@output, "        return true;\n");
-            push(@output, "    }\n");
-        } else {
-            # The second argument of the indexed setter operation is the argument being converted.
-            my $argument = @{$indexedSetterOperation->arguments}[1];
-            my $nativeValue = JSValueToNative($interface, $argument, "value", $indexedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", "");
-
-            push(@output, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
-            push(@output, "        auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
-            push(@output, "        auto nativeValue = ${nativeValue};\n");
-            push(@output, "        RETURN_IF_EXCEPTION(throwScope, true);\n");
-
-            my $indexedSetterFunctionName = $indexedSetterOperation->name || "setItem";
-            my $functionString = "${indexedSetterFunctionName}(index, WTFMove(nativeValue))";
-            $functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation);
-
-            push(@output, "        ${functionString};\n");
-            push(@output, "        return true;\n");
-            push(@output, "    }\n");
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomPutFunction};
+    
+    my $namedSetterOperation = GetNamedSetterOperation($interface);
+    my $indexedSetterOperation = GetIndexedSetterOperation($interface);
+    
+    my $overrideBuiltins = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins");
+    my $ellidesCallsToBase = ($namedSetterOperation && $overrideBuiltins) && !$interface->extendedAttributes->{CustomNamedSetter};
+    
+    push(@$outputArray, "bool ${className}::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool" . (!$ellidesCallsToBase ? " shouldThrow" : "") . ")\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    auto* thisObject = jsCast<${className}*>(cell);\n");
+    push(@$outputArray, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n\n");
+    
+    if (($namedSetterOperation && $namedSetterOperation->extendedAttributes->{CEReactions}) || ($indexedSetterOperation && $indexedSetterOperation->extendedAttributes->{CEReactions})) {
+        push(@$outputArray, "    CustomElementReactionStack customElementReactionStack;\n\n");
+        AddToImplIncludes("CustomElementReactionQueue.h");
+    }
+    
+    if ($indexedSetterOperation ) {
+        push(@$outputArray, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
+        
+        GenerateInvokeIndexedPropertySetter($outputArray, "        ", $interface, $indexedSetterOperation, "index", "value");
+        
+        push(@$outputArray, "        return true;\n");
+        push(@$outputArray, "    }\n\n");
+    }
+    
+    if ($namedSetterOperation) {
+        push(@$outputArray, "    Identifier propertyName = Identifier::from(state, index);\n");
+                
+        my $additionalIndent = "";
+        if (!$overrideBuiltins) {
+            push(@$outputArray, "    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n");
+            push(@$outputArray, "    JSValue prototype = thisObject->getPrototypeDirect();\n");
+            push(@$outputArray, "    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {\n");
+            $additionalIndent .= "    ";
+        }
+        
+        GenerateInvokeNamedPropertySetter($outputArray, $additionalIndent . "    ", $interface, $namedSetterOperation, "value");
+        push(@$outputArray, $additionalIndent . "    return true;\n");
+        
+        if (!$overrideBuiltins) {
+            push(@$outputArray, "    }\n\n");
         }
     }
-
+    
+    assert("Using both a named property setter and [CustomNamedSetter] together is not supported.") if $namedSetterOperation && $interface->extendedAttributes->{CustomNamedSetter};
     if ($interface->extendedAttributes->{CustomNamedSetter}) {
-        push(@output, "    Identifier propertyName = Identifier::from(state, index);\n");
-        push(@output, "    PutPropertySlot slot(thisObject, shouldThrow);\n");
-        push(@output, "    bool putResult = false;\n");
-        push(@output, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
-        push(@output, "        return putResult;\n");
+        push(@$outputArray, "    Identifier propertyName = Identifier::from(state, index);\n");
+        push(@$outputArray, "    PutPropertySlot slot(thisObject, shouldThrow);\n");
+        push(@$outputArray, "    bool putResult = false;\n");
+        push(@$outputArray, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
+        push(@$outputArray, "        return putResult;\n\n");
     }
+    
+    if (!$ellidesCallsToBase) {
+        push(@$outputArray, "    return Base::putByIndex(cell, state, index, value, shouldThrow);\n");
+    }
+    
+    push(@$outputArray, "}\n\n");
+}
 
-    push(@output, "    return Base::putByIndex(cell, state, index, value, shouldThrow);\n");
-    push(@output, "}\n\n");
+sub GenerateIsUnforgeablePropertyName
+{
+    my ($outputArray, $interface) = @_;
+    
+    my @unforgeablePropertyNames = ();
+    foreach my $property (@{$interface->attributes}, @{$interface->operations}) {
+        next if $property->isStatic;
+        
+        if (IsUnforgeable($interface, $property)) {
+            push(@unforgeablePropertyNames, $property->name);
+        }
+    }
+    
+    return 0 if (scalar(@unforgeablePropertyNames) == 0);
+    
+    my $condition = join(" || ", map { "propertyName == \"" . $_ . "\"" } @unforgeablePropertyNames);
+    
+    push(@$outputArray, "static bool isUnforgeablePropertyName(PropertyName propertyName)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    return ${condition};\n");
+    push(@$outputArray, "}\n\n");
+    
+    return 1;
+}
 
-    return @output;
+# https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty
+sub GenerateDefineOwnProperty
+{
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomDefineOwnProperty};
+    
+    my $namedSetterOperation = GetNamedSetterOperation($interface);
+    my $indexedSetterOperation = GetIndexedSetterOperation($interface);
+    
+    return if !$namedSetterOperation && !$indexedSetterOperation;
+    
+    push(@$outputArray, "bool ${className}::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@$outputArray, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n\n");
+    
+    if (($namedSetterOperation && $namedSetterOperation->extendedAttributes->{CEReactions}) || ($indexedSetterOperation && $indexedSetterOperation->extendedAttributes->{CEReactions})) {
+        push(@$outputArray, "    CustomElementReactionStack customElementReactionStack;\n\n");
+        AddToImplIncludes("CustomElementReactionQueue.h");
+    }
+    
+    # 1. If O supports indexed properties and P is an array index property name, then:
+    if (GetIndexedGetterOperation($interface)) {
+        push(@$outputArray, "    if (auto index = parseIndex(propertyName)) {\n");
+        
+        # NOTE: The numbers are out of order because there is no reason doing steps 1, 3, and 4 if there
+        # is no indexed property setter.
+        
+        if (!$indexedSetterOperation) {
+            # 2. If O does not implement an interface with an indexed property setter, then return false.
+            push(@$outputArray, "        return false;\n");
+        } else {
+            # 1. If the result of calling IsDataDescriptor(Desc) is false, then return false.
+            push(@$outputArray, "        if (!propertyDescriptor.isDataDescriptor())\n");
+            push(@$outputArray, "            return false;\n");
+            
+            # 3. Invoke the indexed property setter with P and Desc.[[Value]].
+            GenerateInvokeIndexedPropertySetter($outputArray, "        ", $interface, $indexedSetterOperation, "index.value()", "propertyDescriptor.value()");
+            
+            # 4. Return true.
+            push(@$outputArray, "        return true;\n");
+        }
+        push(@$outputArray, "    }\n\n");
+    }
+    
+    # 2. If O supports named properties, O does not implement an interface with the [Global] or [PrimaryGlobal]
+    #    extended attribute and P is not an unforgeable property name of O, then:
+    if (GetNamedGetterOperation($interface) && !IsGlobalOrPrimaryGlobalInterface($interface)) {
+        # FIMXE: We need a more comprehensive story for Symbols.
+        push(@$outputArray, "    if (!propertyName.isSymbol()) {\n");
+        
+        my $additionalIndent = "";
+        
+        my $hasUnforgableProperties = GenerateIsUnforgeablePropertyName($outputArray, $interface);
+        if ($hasUnforgableProperties) {
+            push(@$outputArray, "        if (!isUnforgeablePropertyName(propertyName)) {\n");
+            $additionalIndent .= "    ";
+        }
+        
+        # 1. Let creating be true if P is not a supported property name, and false otherwise.
+        # NOTE: This step is strength reduced into the only use of 'creating' in step 2.2.1
+        
+        # 2. If O implements an interface with the [OverrideBuiltins] extended attribute or O
+        #    does not have an own property named P, then:
+        my $overrideBuiltins = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins");
+        if (!$overrideBuiltins) {
+            # FIXME: Is Base::getOwnPropertySlot the right function to call? Is there a function that will
+            #        only look at the actual properties, and not call into our implementation of the
+            #        [[GetOwnProperty]] hook?
+            push(@$outputArray, $additionalIndent. "        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n");
+            push(@$outputArray, $additionalIndent. "        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {\n");
+            $additionalIndent .= "    ";
+        }
+        if (!$namedSetterOperation) {
+            # 2.1. If creating is false and O does not implement an interface with a named property setter, then return false.
+            push(@$outputArray, $additionalIndent . "        if (thisObject->wrapped().isSupportedPropertyName(propertyNameToString(propertyName)))\n");
+            push(@$outputArray, $additionalIndent . "            return false;\n");
+        } else {
+            # 2.2. If O implements an interface with a named property setter, then:
+            
+            # 2.2.1. If the result of calling IsDataDescriptor(Desc) is false, then return false.
+            push(@$outputArray, $additionalIndent . "        if (!propertyDescriptor.isDataDescriptor())\n");
+            push(@$outputArray, $additionalIndent . "            return false;\n");
+            
+            # 2.2.2. Invoke the named property setter with P and Desc.[[Value]].
+            GenerateInvokeNamedPropertySetter($outputArray, $additionalIndent . "        ", $interface, $namedSetterOperation, "propertyDescriptor.value()");
+            
+            # 2.2.3. Return true.
+            push(@$outputArray, $additionalIndent . "        return true;\n");
+        }
+        
+        if (!$overrideBuiltins) {
+            push(@$outputArray, $additionalIndent . "    }\n");
+        }
+        
+        if ($hasUnforgableProperties) {
+            push(@$outputArray, "        }\n");
+        }
+        
+        # Close the !propertyName.isSymbol() condition.
+        push(@$outputArray, "    }\n\n");
+    }
+    
+    push(@$outputArray, "    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;\n");
+        
+    # 3. If O does not implement an interface with the [Global] or [PrimaryGlobal] extended attribute,
+    #    then set Desc.[[Configurable]] to true.
+    if (!IsGlobalOrPrimaryGlobalInterface($interface)) {
+        push(@$outputArray, "    newPropertyDescriptor.setConfigurable(true);\n");
+    }
+    
+    # 4. Return OrdinaryDefineOwnProperty(O, P, Desc).
+    # FIXME: Does this do the same thing?
+    push(@$outputArray, "    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);\n");
+    
+    push(@$outputArray, "}\n\n");
 }
 
 sub GenerateDeletePropertyCommon
@@ -745,7 +949,7 @@ sub GenerateDeletePropertyCommon
     assert("Named property deleters are not allowed on global object interfaces.") if IsGlobalOrPrimaryGlobalInterface($interface);
 
     AddToImplIncludes("JSDOMAbstractOperations.h", $conditional);
-    my $overrideBuiltin = $interface->extendedAttributes->{OverrideBuiltins} ? "true" : "false";
+    my $overrideBuiltin = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins") ? "true" : "false";
     push(@$outputArray, "    if (isVisibleNamedProperty<${overrideBuiltin}>(*state, thisObject, propertyName)) {\n");
 
     if ($operation->extendedAttributes->{CEReactions}) {
@@ -877,22 +1081,26 @@ sub GenerateDeletePropertyByIndexDefinition
 
 sub GenerateNamedDeleterDefinition
 {
-    my ($outputArray, $interface, $className, $operation) = @_;
+    my ($outputArray, $interface, $className) = @_;
+    
+    return if $interface->extendedAttributes->{CustomDeleteProperty};
 
+    my $namedDeleterOperation = GetNamedDeleterOperation($interface);
+    
     # This implements https://heycam.github.io/webidl/#legacy-platform-object-delete using
     # the deleteProperty and deletePropertyByIndex override hooks.
 
     assert("Named property deleters are not allowed without a corresponding named property getter.") if !GetNamedGetterOperation($interface);
     assert("Named property deleters are not allowed on global object interfaces.") if IsGlobalOrPrimaryGlobalInterface($interface);
 
-    my $conditional = $operation->extendedAttributes->{Conditional};
+    my $conditional = $namedDeleterOperation->extendedAttributes->{Conditional};
     if ($conditional) {
         my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional);
         push(@$outputArray, "#if ${conditionalString}\n\n");;
     }
 
-    GenerateDeletePropertyDefinition($outputArray, $interface, $className, $operation, $conditional);
-    GenerateDeletePropertyByIndexDefinition($outputArray, $interface, $className, $operation, $conditional);
+    GenerateDeletePropertyDefinition($outputArray, $interface, $className, $namedDeleterOperation, $conditional);
+    GenerateDeletePropertyByIndexDefinition($outputArray, $interface, $className, $namedDeleterOperation, $conditional);
 
     push(@implContent, "#endif\n\n") if $conditional;
 }
@@ -1108,14 +1316,6 @@ sub GetSpecialAccessorOperationForType
     return 0;
 }
 
-sub HasComplexGetOwnProperty
-{
-    my $interface = shift;
-    return $interface->extendedAttributes->{CheckSecurity}
-        || IsDOMGlobalObject($interface)
-        || InstanceOverridesGetOwnPropertySlot($interface);
-}
-
 sub IsGlobalOrPrimaryGlobalInterface
 {
     my $interface = shift;
@@ -1306,7 +1506,25 @@ sub InstanceOverridesGetOwnPropertySlot
     my $interface = shift;
     return $interface->extendedAttributes->{CustomGetOwnPropertySlot}
         || $interface->extendedAttributes->{CustomNamedGetter}
-        || $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}
+        || $interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}
+        || GetIndexedGetterOperation($interface)
+        || GetNamedGetterOperation($interface);
+}
+
+sub InstanceOverridesGetOwnPropertySlotByIndex
+{
+    my $interface = shift;
+    return $interface->extendedAttributes->{CustomGetOwnPropertySlotByIndex}
+        || $interface->extendedAttributes->{CustomNamedGetter}
+        || $interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}
+        || GetIndexedGetterOperation($interface)
+        || GetNamedGetterOperation($interface);
+}
+
+sub InstanceOverridesGetOwnPropertyNames
+{
+    my $interface = shift;
+    return $interface->extendedAttributes->{CustomEnumerateProperty}
         || GetIndexedGetterOperation($interface)
         || GetNamedGetterOperation($interface);
 }
@@ -1315,7 +1533,15 @@ sub InstanceOverridesPut
 {
     my $interface = shift;
     return $interface->extendedAttributes->{CustomNamedSetter}
-        || $interface->extendedAttributes->{CustomIndexedSetter}
+        || $interface->extendedAttributes->{CustomPutFunction}
+        || GetIndexedSetterOperation($interface)
+        || GetNamedSetterOperation($interface);
+}
+
+sub InstanceOverridesDefineOwnProperty
+{
+    my $interface = shift;
+    return $interface->extendedAttributes->{CustomDefineOwnProperty}
         || GetIndexedSetterOperation($interface)
         || GetNamedSetterOperation($interface);
 }
@@ -1334,21 +1560,6 @@ sub PrototypeHasStaticPropertyTable
     return $numConstants > 0 || PrototypePropertyCount($interface) > 0;
 }
 
-sub InstanceOverridesPutImplementation
-{
-    my $interface = shift;
-    return $interface->extendedAttributes->{CustomNamedSetter}
-        || $interface->extendedAttributes->{CustomIndexedSetter};
-}
-
-sub InstanceOverridesPutDeclaration
-{
-    my $interface = shift;
-    return $interface->extendedAttributes->{CustomPutFunction}
-        || $interface->extendedAttributes->{CustomNamedSetter}
-        || $interface->extendedAttributes->{CustomIndexedSetter};
-}
-
 sub InstanceNeedsVisitChildren
 {
     my $interface = shift;
@@ -1999,7 +2210,9 @@ sub GenerateHeader
     $structureFlags{"JSC::HasStaticPropertyTable"} = 1 if InstancePropertyCount($interface) > 0;
     $structureFlags{"JSC::NewImpurePropertyFiresWatchpoints"} = 1 if $interface->extendedAttributes->{NewImpurePropertyFiresWatchpoints};
     $structureFlags{"JSC::IsImmutablePrototypeExoticObject"} = 1 if $interface->extendedAttributes->{IsImmutablePrototypeExoticObject};
-
+    $structureFlags{"JSC::MasqueradesAsUndefined"} = 1 if $interface->extendedAttributes->{MasqueradesAsUndefined};
+    $structureFlags{"JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance"} = 1 if $interfaceName eq "DOMWindow";
+        
     # Prototype
     unless (ShouldUseGlobalObjectPrototype($interface)) {
         push(@headerContent, "    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);\n");
@@ -2026,51 +2239,78 @@ sub GenerateHeader
     my $namedGetterOperation = GetNamedGetterOperation($interface);
     my $indexedGetterOperation = GetIndexedGetterOperation($interface);
 
-    my $hasNamedGetter = $namedGetterOperation
-        || $interface->extendedAttributes->{CustomNamedGetter};
-
-    my $hasComplexGetter = $indexedGetterOperation
-        || $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}
-        || $interface->extendedAttributes->{CustomGetOwnPropertySlot}
-        || $hasNamedGetter;
-
-    if ($hasNamedGetter) {
-        if ($interface->extendedAttributes->{OverrideBuiltins}) {
+    # FIXME: Why doesn't this also include Indexed Getters, {CustomGetOwnPropertySlot} and {CustomGetOwnPropertySlotAndDescriptor}
+    if ($namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter}) {
+        if ($codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins")) {
             $structureFlags{"JSC::GetOwnPropertySlotIsImpure"} = 1;
         } else {
             $structureFlags{"JSC::GetOwnPropertySlotIsImpureForPropertyAbsence"} = 1;
         }
     }
-
-    my $overridesGet = InstanceOverridesGetOwnPropertySlot($interface);
-    if ($overridesGet) {
+    
+    # ClassInfo MethodTable declarations.
+    
+    if (InstanceOverridesGetOwnPropertySlot($interface)) {
         push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
         $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
-
-        if ($hasComplexGetter) {
-            push(@headerContent, "    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n");
-            $structureFlags{"JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero"} = 1;
-        }
     }
-
-    my $overridesPut = InstanceOverridesPutDeclaration($interface);
-    if ($overridesPut) {
+    
+    if (InstanceOverridesGetOwnPropertySlotByIndex($interface)) {
+        push(@headerContent, "    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n");
+        $structureFlags{"JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero"} = 1;
+    }
+    
+    # FIXME: Currently only DOMWindow needs to override the getPropertyNames family of functions, but even
+    #        so, it should probably be turned into an extended attribute.
+    if ($interfaceName eq "DOMWindow") {
+        push(@headerContent, "    static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
+        push(@headerContent, "    static void getGenericPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
+        push(@headerContent, "    static void getStructurePropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
+        push(@headerContent, "    static uint32_t getEnumerableLength(JSC::ExecState*, JSC::JSObject*);\n");
+        $structureFlags{"JSC::OverridesGetPropertyNames"} = 1;
+    }
+    
+    if (InstanceOverridesGetOwnPropertyNames($interface)) {
+        push(@headerContent, "    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
+        $structureFlags{"JSC::OverridesGetPropertyNames"} = 1;
+    }
+    
+    if (InstanceOverridesPut($interface)) {
         push(@headerContent, "    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n");
         push(@headerContent, "    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);\n");
     }
+    
+    if (InstanceOverridesDefineOwnProperty($interface)) {
+        push(@headerContent, "    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n");
+    }
 
     if (InstanceOverridesDelete($interface)) {
         push(@headerContent, "    static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);\n");
         push(@headerContent, "    static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);\n");
     }
 
-    # LegacyCaller and custom call functions
-    if (IsCallable($interface)) {
+    if (InstanceOverridesCall($interface)) {
         push(@headerContent, "    static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n");
         $headerIncludes{"<runtime/CallData.h>"} = 1;
         $structureFlags{"JSC::TypeOfShouldCallGetCallData"} = 1;
     }
-
+    
+    if ($interface->extendedAttributes->{CustomGetPrototype}) {
+        push(@headerContent, "    static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*);\n");
+    }
+    
+    if ($interface->extendedAttributes->{CustomToStringName}) {
+        push(@headerContent, "    static String toStringName(const JSC::JSObject*, JSC::ExecState*);\n");
+    }
+    
+    if ($interface->extendedAttributes->{CustomPreventExtensions}) {
+        push(@headerContent, "    static bool preventExtensions(JSC::JSObject*, JSC::ExecState*);\n");
+    }
+    
+    if (InstanceNeedsEstimatedSize($interface)) {
+        push(@headerContent, "    static size_t estimatedSize(JSCell*);\n");
+    }
+    
     if (!$hasParent) {
         push(@headerContent, "    static void destroy(JSC::JSCell*);\n");
     }
@@ -2088,7 +2328,6 @@ sub GenerateHeader
     }
 
     # Structure ID
-    $structureFlags{"JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance"} = 1 if $interfaceName eq "DOMWindow";
     push(@headerContent, "    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n");
     push(@headerContent, "    {\n");
     if (IsDOMGlobalObject($interface)) {
@@ -2104,37 +2343,10 @@ sub GenerateHeader
     push(@headerContent, "    }\n\n");
 
     # Custom pushEventHandlerScope function
-    push(@headerContent, "    JSC::JSScope* pushEventHandlerScope(JSC::ExecState*, JSC::JSScope*) const;\n\n") if $interface->extendedAttributes->{JSCustomPushEventHandlerScope};
-
-    # Custom getPropertyNames function exists on DOMWindow
-    if ($interfaceName eq "DOMWindow") {
-        push(@headerContent, "    static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
-        push(@headerContent, "    static void getGenericPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
-        push(@headerContent, "    static void getStructurePropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
-        push(@headerContent, "    static uint32_t getEnumerableLength(JSC::ExecState*, JSC::JSObject*);\n");
-        $structureFlags{"JSC::OverridesGetPropertyNames"} = 1;
+    if ($interface->extendedAttributes->{CustomPushEventHandlerScope}) {
+        push(@headerContent, "    JSC::JSScope* pushEventHandlerScope(JSC::ExecState*, JSC::JSScope*) const;\n\n");
     }
-
-    # Custom getOwnPropertyNames function
-    if ($interface->extendedAttributes->{CustomEnumerateProperty} || $indexedGetterOperation || $namedGetterOperation) {
-        push(@headerContent, "    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n");
-        $structureFlags{"JSC::OverridesGetPropertyNames"} = 1;       
-    }
-
-    # Custom defineOwnProperty function
-    push(@headerContent, "    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n") if $interface->extendedAttributes->{JSCustomDefineOwnProperty};
-
-    # Custom getPrototype / setPrototype functions.
-    push (@headerContent, "    static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomGetPrototype};
-
-    # Custom toStringName function.
-    push (@headerContent, "    static String toStringName(const JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomToStringName};
-
-    # Custom preventExtensions function.
-    push(@headerContent, "    static bool preventExtensions(JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomPreventExtensions};
     
-    $structureFlags{"JSC::MasqueradesAsUndefined"} = 1 if $interface->extendedAttributes->{MasqueradesAsUndefined};
-
     # Constructor object getter
     unless ($interface->extendedAttributes->{NoInterfaceObject}) {
         push(@headerContent, "    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n");
@@ -2142,8 +2354,10 @@ sub GenerateHeader
     }
 
     # Serializer function.
-    push(@headerContent, "    static JSC::JSObject* serialize(JSC::ExecState*, JS${interfaceName}* thisObject, JSC::ThrowScope&);\n") if $interface->serializable;
-
+    if ($interface->serializable) {
+        push(@headerContent, "    static JSC::JSObject* serialize(JSC::ExecState*, ${className}* thisObject, JSC::ThrowScope&);\n");
+    }
+    
     my $numCustomOperations = 0;
     my $numCustomAttributes = 0;
 
@@ -2193,11 +2407,7 @@ sub GenerateHeader
             push(@headerContent, "    template<typename> static JSC::Subspace* subspaceFor(JSC::VM& vm) { return $subspaceFunc(vm); }\n");
         }
     }
-
-    if (InstanceNeedsEstimatedSize($interface)) {
-        push(@headerContent, "    static size_t estimatedSize(JSCell*);\n");
-    }
-
+    
     if ($numCustomAttributes > 0) {
         push(@headerContent, "\n    // Custom attributes\n");
 
@@ -2295,7 +2505,7 @@ sub GenerateHeader
         push(@headerContent, "    void finishCreation(JSC::VM&);\n");
     }
 
-    if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
+    if ($interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}) {
         push(@headerContent, "    bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
     }
 
@@ -2306,11 +2516,7 @@ sub GenerateHeader
     if ($interface->extendedAttributes->{CustomNamedSetter}) {
         push(@headerContent, "    bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n");
     }
-
-    if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-        push(@headerContent, "    void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n");
-    }
-
+    
     push(@headerContent, "};\n\n");
 
     if (ShouldGenerateWrapperOwnerCode($hasParent, $interface)) {
@@ -3613,7 +3819,7 @@ sub GenerateImplementation
         push(@implContent, "}\n\n");
     }
 
-    if ($interface->extendedAttributes->{JSCustomNamedGetterOnPrototype}) {
+    if ($interface->extendedAttributes->{CustomNamedGetterOnPrototype}) {
         push(@implContent, "bool ${className}Prototype::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n");
         push(@implContent, "{\n");
         push(@implContent, "    auto* thisObject = jsCast<${className}Prototype*>(cell);\n");
@@ -3792,43 +3998,35 @@ sub GenerateImplementation
         push(@implContent, "}\n\n");
     }
 
-    my $overridesGet = InstanceOverridesGetOwnPropertySlot($interface);
-    if ($overridesGet) {
-        if (!$interface->extendedAttributes->{CustomGetOwnPropertySlot}) {
-            push(@implContent, GenerateGetOwnPropertySlotBody($interface, $className, $indexedGetterOperation, $namedGetterOperation));
-        }
-
-        if ($indexedGetterOperation || $namedGetterOperation
-                || $interface->extendedAttributes->{CustomNamedGetter}
-                || $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
-            push(@implContent, GenerateGetOwnPropertySlotBodyByIndex($interface, $className, $indexedGetterOperation, $namedGetterOperation));
-        }
+    if (InstanceOverridesGetOwnPropertySlot($interface)) {
+        GenerateGetOwnPropertySlotBody(\@implContent, $interface, $className);
     }
-
-
-    if (($indexedGetterOperation || $namedGetterOperation) && !$interface->extendedAttributes->{CustomEnumerateProperty}) {
-        push(@implContent, GenerateGetOwnPropertyNames($interface, $className, $indexedGetterOperation, $namedGetterOperation));
+    
+    if (InstanceOverridesGetOwnPropertySlotByIndex($interface)) {
+        GenerateGetOwnPropertySlotBodyByIndex(\@implContent, $interface, $className);
     }
-
-    my $namedSetterOperation = GetNamedSetterOperation($interface);
-    my $indexedSetterOperation = GetIndexedSetterOperation($interface);
-
-    my $hasSetter = InstanceOverridesPut($interface);
-    if ($hasSetter) {
-        if (!$interface->extendedAttributes->{CustomPutFunction}) {
-            push(@implContent, GeneratePut($interface, $className, $indexedSetterOperation, $namedSetterOperation));
-            
-            if ($interface->extendedAttributes->{CustomIndexedSetter} || $interface->extendedAttributes->{CustomNamedSetter}) {
-                push(@implContent, GeneratePutByIndex($interface, $className, $indexedSetterOperation, $namedSetterOperation));
-            }
-        }
+    
+    if (InstanceOverridesGetOwnPropertyNames($interface)) {
+        GenerateGetOwnPropertyNames(\@implContent, $interface, $className);
     }
-
-    my $namedDeleterOperation = GetNamedDeleterOperation($interface);
-    if ($namedDeleterOperation) {
-        GenerateNamedDeleterDefinition(\@implContent, $interface, $className, $namedDeleterOperation);
+    
+    if (InstanceOverridesPut($interface)) {
+        GeneratePut(\@implContent, $interface, $className);
+        GeneratePutByIndex(\@implContent, $interface, $className);
+    }
+    
+    if (InstanceOverridesDefineOwnProperty($interface)) {
+        GenerateDefineOwnProperty(\@implContent, $interface, $className);
     }
 
+    if (InstanceOverridesDelete($interface)) {
+        GenerateNamedDeleterDefinition(\@implContent, $interface, $className);
+    }
+    
+    if (InstanceOverridesCall($interface)) {
+        GenerateLegacyCallerDefinitions($interface, $className);
+    }
+    
     if ($numAttributes > 0) {
         AddToImplIncludes("JSDOMAttribute.h");
 
@@ -3908,8 +4106,7 @@ sub GenerateImplementation
     foreach my $operation (@operations) {
         GenerateOperationDefinition($interface, $className, $operation);
     }
-
-    GenerateLegacyCallerDefinitions($interface, $className);
+    
     GenerateIterableDefinition($interface) if $interface->iterable;
     GenerateSerializerDefinition($interface, $className) if $interface->serializable;
 
@@ -4769,10 +4966,8 @@ sub GenerateLegacyCallerDefinitions
 {
     my ($interface, $className) = @_;
 
-    if (!IsCallable($interface) || $interface->extendedAttributes->{CustomCall}) {
-        return;
-    }
-
+    return if $interface->extendedAttributes->{CustomCall};
+    
     my @legacyCallers = @{$interface->{LegacyCallers}};
     if (@legacyCallers > 1) {
         foreach my $legacyCaller (@legacyCallers) {
@@ -6312,14 +6507,14 @@ sub GeneratePrototypeDeclaration
         }
     }
 
-    if ($interface->extendedAttributes->{JSCustomNamedGetterOnPrototype}) {
+    if ($interface->extendedAttributes->{CustomNamedGetterOnPrototype}) {
         push(@$outputArray, "\n");
         push(@$outputArray, "    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n");
         push(@$outputArray, "    bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n");
     }
 
     # Custom defineOwnProperty function
-    if ($interface->extendedAttributes->{JSCustomDefineOwnPropertyOnPrototype}) {
+    if ($interface->extendedAttributes->{CustomDefineOwnPropertyOnPrototype}) {
         push(@$outputArray, "\n");
         push(@$outputArray, "    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n");
     }
@@ -6580,7 +6775,7 @@ sub IsConstructable
         || $interface->extendedAttributes->{JSBuiltinConstructor};
 }
 
-sub IsCallable
+sub InstanceOverridesCall
 {
     my $interface = shift;
     return $interface->extendedAttributes->{CustomCall} || $interface->{LegacyCallers}
@@ -6589,7 +6784,9 @@ sub IsCallable
 sub HeaderNeedsPrototypeDeclaration
 {
     my $interface = shift;
-    return IsDOMGlobalObject($interface) || $interface->extendedAttributes->{JSCustomNamedGetterOnPrototype} || $interface->extendedAttributes->{JSCustomDefineOwnPropertyOnPrototype};
+    return IsDOMGlobalObject($interface)
+        || $interface->extendedAttributes->{CustomNamedGetterOnPrototype}
+        || $interface->extendedAttributes->{CustomDefineOwnPropertyOnPrototype};
 }
 
 sub IsUnforgeable
index 439be3b..0e5035e 100644 (file)
         "CustomConstructor": {
             "contextsAllowed": ["interface"]
         },
+        "CustomDefineOwnProperty": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomDefineOwnPropertyOnPrototype": {
+            "contextsAllowed": ["interface"]
+        },
         "CustomDeleteProperty": {
             "contextsAllowed": ["interface"]
         },
         "CustomGetOwnPropertySlot": {
             "contextsAllowed": ["interface"]
         },
+        "CustomGetOwnPropertySlotByIndex": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomGetOwnPropertySlotAndDescriptor": {
+            "contextsAllowed": ["interface"]
+        },
         "CustomGetPrototype": {
             "contextsAllowed": ["interface"]
         },
         "CustomNamedGetter": {
             "contextsAllowed": ["interface"]
         },
+        "CustomNamedGetterOnPrototype": {
+            "contextsAllowed": ["interface"]
+        },
         "CustomNamedSetter": {
             "contextsAllowed": ["interface"]
         },
         "CustomProxyToJSObject": {
             "contextsAllowed": ["interface"]
         },
+        "CustomPushEventHandlerScope": {
+            "contextsAllowed": ["interface"]
+        },
         "CustomPutFunction": {
             "contextsAllowed": ["interface"]
         },
         "JSBuiltinConstructor": {
             "contextsAllowed": ["interface"]
         },
-        "JSCustomDefineOwnProperty": {
-            "contextsAllowed": ["interface"]
-        },
-        "JSCustomDefineOwnPropertyOnPrototype": {
-            "contextsAllowed": ["interface"]
-        },
         "JSCustomFinalize": {
             "contextsAllowed": ["interface"]
         },
-        "JSCustomGetOwnPropertySlotAndDescriptor": {
-            "contextsAllowed": ["interface"]
-        },
         "JSCustomHeader": {
             "contextsAllowed": ["interface"]
         },
         "JSCustomMarkFunction": {
             "contextsAllowed": ["interface"]
         },
-        "JSCustomNamedGetterOnPrototype": {
-            "contextsAllowed": ["interface"]
-        },
-        "JSCustomPushEventHandlerScope": {
-            "contextsAllowed": ["interface"]
-        },
         "JSCustomToNativeObject": {
             "contextsAllowed": ["interface"]
         },
index bc1a126..a123148 100644 (file)
@@ -39,6 +39,7 @@ public:
     static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
     static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
     static InterfaceName* toWrapped(JSC::VM&, JSC::JSValue);
+    static size_t estimatedSize(JSCell*);
     static void destroy(JSC::JSCell*);
 
     DECLARE_INFO;
@@ -51,7 +52,6 @@ public:
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
-    static size_t estimatedSize(JSCell*);
 protected:
     JSInterfaceName(JSC::Structure*, JSDOMGlobalObject&, Ref<InterfaceName>&&);
 
index 612b9b5..f6cdfef 100644 (file)
@@ -42,6 +42,7 @@ public:
     static TestEventTarget* toWrapped(JSC::VM&, JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
 
     DECLARE_INFO;
 
@@ -50,7 +51,6 @@ public:
         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 
-    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
     TestEventTarget& wrapped() const
     {
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp
new file mode 100644 (file)
index 0000000..6c8b1a4
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestIndexedSetterNoIdentifier.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestIndexedSetterNoIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestIndexedSetterNoIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestIndexedSetterNoIdentifierPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestIndexedSetterNoIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestIndexedSetterNoIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestIndexedSetterNoIdentifierPrototype>(vm.heap)) JSTestIndexedSetterNoIdentifierPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestIndexedSetterNoIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestIndexedSetterNoIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestIndexedSetterNoIdentifier>;
+
+template<> JSValue JSTestIndexedSetterNoIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestIndexedSetterNoIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestIndexedSetterNoIdentifier::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestIndexedSetterNoIdentifier"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestIndexedSetterNoIdentifierConstructor::s_info = { "TestIndexedSetterNoIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterNoIdentifierConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestIndexedSetterNoIdentifierPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestIndexedSetterNoIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestIndexedSetterNoIdentifierConstructor) } },
+};
+
+const ClassInfo JSTestIndexedSetterNoIdentifierPrototype::s_info = { "TestIndexedSetterNoIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterNoIdentifierPrototype) };
+
+void JSTestIndexedSetterNoIdentifierPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestIndexedSetterNoIdentifierPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestIndexedSetterNoIdentifier::s_info = { "TestIndexedSetterNoIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterNoIdentifier) };
+
+JSTestIndexedSetterNoIdentifier::JSTestIndexedSetterNoIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestIndexedSetterNoIdentifier>&& impl)
+    : JSDOMWrapper<TestIndexedSetterNoIdentifier>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestIndexedSetterNoIdentifier::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestIndexedSetterNoIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestIndexedSetterNoIdentifierPrototype::create(vm, &globalObject, JSTestIndexedSetterNoIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestIndexedSetterNoIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestIndexedSetterNoIdentifier>(vm, globalObject);
+}
+
+JSValue JSTestIndexedSetterNoIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestIndexedSetterNoIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestIndexedSetterNoIdentifier::destroy(JSC::JSCell* cell)
+{
+    JSTestIndexedSetterNoIdentifier* thisObject = static_cast<JSTestIndexedSetterNoIdentifier*>(cell);
+    thisObject->JSTestIndexedSetterNoIdentifier::~JSTestIndexedSetterNoIdentifier();
+}
+
+bool JSTestIndexedSetterNoIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    auto optionalIndex = parseIndex(propertyName);
+    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
+        auto index = optionalIndex.value();
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    return false;
+}
+
+bool JSTestIndexedSetterNoIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (LIKELY(index < thisObject->wrapped().length())) {
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestIndexedSetterNoIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
+        propertyNames.add(Identifier::from(state, i));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestIndexedSetterNoIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestIndexedSetterNoIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (LIKELY(index <= MAX_ARRAY_INDEX)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setItem(index, WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestIndexedSetterNoIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestIndexedSetterNoIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestIndexedSetterNoIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestIndexedSetterNoIdentifier::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestIndexedSetterNoIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestIndexedSetterNoIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestIndexedSetterNoIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestIndexedSetterNoIdentifier = static_cast<JSTestIndexedSetterNoIdentifier*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestIndexedSetterNoIdentifier->wrapped(), jsTestIndexedSetterNoIdentifier);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestIndexedSetterNoIdentifier@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore29TestIndexedSetterNoIdentifierE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestIndexedSetterNoIdentifier>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestIndexedSetterNoIdentifier@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore29TestIndexedSetterNoIdentifierE[2];
+#if COMPILER(CLANG)
+    // If this fails TestIndexedSetterNoIdentifier does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestIndexedSetterNoIdentifier), "TestIndexedSetterNoIdentifier is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestIndexedSetterNoIdentifier has subclasses. If TestIndexedSetterNoIdentifier has subclasses that get passed
+    // to toJS() we currently require TestIndexedSetterNoIdentifier you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestIndexedSetterNoIdentifier>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestIndexedSetterNoIdentifier& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestIndexedSetterNoIdentifier* JSTestIndexedSetterNoIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestIndexedSetterNoIdentifier*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h
new file mode 100644 (file)
index 0000000..866c415
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestIndexedSetterNoIdentifier.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestIndexedSetterNoIdentifier : public JSDOMWrapper<TestIndexedSetterNoIdentifier> {
+public:
+    using Base = JSDOMWrapper<TestIndexedSetterNoIdentifier>;
+    static JSTestIndexedSetterNoIdentifier* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestIndexedSetterNoIdentifier>&& impl)
+    {
+        JSTestIndexedSetterNoIdentifier* ptr = new (NotNull, JSC::allocateCell<JSTestIndexedSetterNoIdentifier>(globalObject->vm().heap)) JSTestIndexedSetterNoIdentifier(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestIndexedSetterNoIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestIndexedSetterNoIdentifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestIndexedSetterNoIdentifier>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestIndexedSetterNoIdentifierOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestIndexedSetterNoIdentifier*)
+{
+    static NeverDestroyed<JSTestIndexedSetterNoIdentifierOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestIndexedSetterNoIdentifier* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestIndexedSetterNoIdentifier&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestIndexedSetterNoIdentifier* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestIndexedSetterNoIdentifier>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestIndexedSetterNoIdentifier>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestIndexedSetterNoIdentifier> {
+    using WrapperClass = JSTestIndexedSetterNoIdentifier;
+    using ToWrappedReturnType = TestIndexedSetterNoIdentifier*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp
new file mode 100644 (file)
index 0000000..aa7cde1
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestIndexedSetterThrowingException.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestIndexedSetterThrowingExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestIndexedSetterThrowingExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestIndexedSetterThrowingExceptionPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestIndexedSetterThrowingExceptionPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestIndexedSetterThrowingExceptionPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestIndexedSetterThrowingExceptionPrototype>(vm.heap)) JSTestIndexedSetterThrowingExceptionPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestIndexedSetterThrowingExceptionPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestIndexedSetterThrowingExceptionConstructor = JSDOMConstructorNotConstructable<JSTestIndexedSetterThrowingException>;
+
+template<> JSValue JSTestIndexedSetterThrowingExceptionConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestIndexedSetterThrowingExceptionConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestIndexedSetterThrowingException::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestIndexedSetterThrowingException"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestIndexedSetterThrowingExceptionConstructor::s_info = { "TestIndexedSetterThrowingException", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterThrowingExceptionConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestIndexedSetterThrowingExceptionPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestIndexedSetterThrowingExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestIndexedSetterThrowingExceptionConstructor) } },
+};
+
+const ClassInfo JSTestIndexedSetterThrowingExceptionPrototype::s_info = { "TestIndexedSetterThrowingExceptionPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterThrowingExceptionPrototype) };
+
+void JSTestIndexedSetterThrowingExceptionPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestIndexedSetterThrowingExceptionPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestIndexedSetterThrowingException::s_info = { "TestIndexedSetterThrowingException", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterThrowingException) };
+
+JSTestIndexedSetterThrowingException::JSTestIndexedSetterThrowingException(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestIndexedSetterThrowingException>&& impl)
+    : JSDOMWrapper<TestIndexedSetterThrowingException>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestIndexedSetterThrowingException::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestIndexedSetterThrowingException::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestIndexedSetterThrowingExceptionPrototype::create(vm, &globalObject, JSTestIndexedSetterThrowingExceptionPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestIndexedSetterThrowingException::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestIndexedSetterThrowingException>(vm, globalObject);
+}
+
+JSValue JSTestIndexedSetterThrowingException::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestIndexedSetterThrowingExceptionConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestIndexedSetterThrowingException::destroy(JSC::JSCell* cell)
+{
+    JSTestIndexedSetterThrowingException* thisObject = static_cast<JSTestIndexedSetterThrowingException*>(cell);
+    thisObject->JSTestIndexedSetterThrowingException::~JSTestIndexedSetterThrowingException();
+}
+
+bool JSTestIndexedSetterThrowingException::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    auto optionalIndex = parseIndex(propertyName);
+    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
+        auto index = optionalIndex.value();
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    return false;
+}
+
+bool JSTestIndexedSetterThrowingException::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (LIKELY(index < thisObject->wrapped().length())) {
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestIndexedSetterThrowingException::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
+        propertyNames.add(Identifier::from(state, i));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestIndexedSetterThrowingException::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
+        return true;
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestIndexedSetterThrowingException::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (LIKELY(index <= MAX_ARRAY_INDEX)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setItem(index, WTFMove(nativeValue)));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestIndexedSetterThrowingException::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
+        return true;
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestIndexedSetterThrowingExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestIndexedSetterThrowingExceptionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestIndexedSetterThrowingException::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestIndexedSetterThrowingExceptionConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestIndexedSetterThrowingExceptionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestIndexedSetterThrowingExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestIndexedSetterThrowingException = static_cast<JSTestIndexedSetterThrowingException*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestIndexedSetterThrowingException->wrapped(), jsTestIndexedSetterThrowingException);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestIndexedSetterThrowingException@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore34TestIndexedSetterThrowingExceptionE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestIndexedSetterThrowingException>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestIndexedSetterThrowingException@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore34TestIndexedSetterThrowingExceptionE[2];
+#if COMPILER(CLANG)
+    // If this fails TestIndexedSetterThrowingException does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestIndexedSetterThrowingException), "TestIndexedSetterThrowingException is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestIndexedSetterThrowingException has subclasses. If TestIndexedSetterThrowingException has subclasses that get passed
+    // to toJS() we currently require TestIndexedSetterThrowingException you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestIndexedSetterThrowingException>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestIndexedSetterThrowingException& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestIndexedSetterThrowingException* JSTestIndexedSetterThrowingException::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestIndexedSetterThrowingException*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h
new file mode 100644 (file)
index 0000000..088c4bb
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestIndexedSetterThrowingException.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestIndexedSetterThrowingException : public JSDOMWrapper<TestIndexedSetterThrowingException> {
+public:
+    using Base = JSDOMWrapper<TestIndexedSetterThrowingException>;
+    static JSTestIndexedSetterThrowingException* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestIndexedSetterThrowingException>&& impl)
+    {
+        JSTestIndexedSetterThrowingException* ptr = new (NotNull, JSC::allocateCell<JSTestIndexedSetterThrowingException>(globalObject->vm().heap)) JSTestIndexedSetterThrowingException(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestIndexedSetterThrowingException* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestIndexedSetterThrowingException(JSC::Structure*, JSDOMGlobalObject&, Ref<TestIndexedSetterThrowingException>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestIndexedSetterThrowingExceptionOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestIndexedSetterThrowingException*)
+{
+    static NeverDestroyed<JSTestIndexedSetterThrowingExceptionOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestIndexedSetterThrowingException* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestIndexedSetterThrowingException&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestIndexedSetterThrowingException* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestIndexedSetterThrowingException>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestIndexedSetterThrowingException>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestIndexedSetterThrowingException> {
+    using WrapperClass = JSTestIndexedSetterThrowingException;
+    using ToWrappedReturnType = TestIndexedSetterThrowingException*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp
new file mode 100644 (file)
index 0000000..b503f6b
--- /dev/null
@@ -0,0 +1,335 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestIndexedSetterWithIdentifier.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMOperation.h"
+#include "JSDOMWrapperCache.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestIndexedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestIndexedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestIndexedSetterWithIdentifierPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestIndexedSetterWithIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestIndexedSetterWithIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestIndexedSetterWithIdentifierPrototype>(vm.heap)) JSTestIndexedSetterWithIdentifierPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestIndexedSetterWithIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestIndexedSetterWithIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestIndexedSetterWithIdentifier>;
+
+template<> JSValue JSTestIndexedSetterWithIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestIndexedSetterWithIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestIndexedSetterWithIdentifier::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestIndexedSetterWithIdentifier"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestIndexedSetterWithIdentifierConstructor::s_info = { "TestIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterWithIdentifierConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestIndexedSetterWithIdentifierPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestIndexedSetterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestIndexedSetterWithIdentifierConstructor) } },
+    { "indexedSetter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter), (intptr_t) (2) } },
+};
+
+const ClassInfo JSTestIndexedSetterWithIdentifierPrototype::s_info = { "TestIndexedSetterWithIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterWithIdentifierPrototype) };
+
+void JSTestIndexedSetterWithIdentifierPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestIndexedSetterWithIdentifierPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestIndexedSetterWithIdentifier::s_info = { "TestIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestIndexedSetterWithIdentifier) };
+
+JSTestIndexedSetterWithIdentifier::JSTestIndexedSetterWithIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestIndexedSetterWithIdentifier>&& impl)
+    : JSDOMWrapper<TestIndexedSetterWithIdentifier>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestIndexedSetterWithIdentifier::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestIndexedSetterWithIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestIndexedSetterWithIdentifierPrototype::create(vm, &globalObject, JSTestIndexedSetterWithIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestIndexedSetterWithIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestIndexedSetterWithIdentifier>(vm, globalObject);
+}
+
+JSValue JSTestIndexedSetterWithIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestIndexedSetterWithIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestIndexedSetterWithIdentifier::destroy(JSC::JSCell* cell)
+{
+    JSTestIndexedSetterWithIdentifier* thisObject = static_cast<JSTestIndexedSetterWithIdentifier*>(cell);
+    thisObject->JSTestIndexedSetterWithIdentifier::~JSTestIndexedSetterWithIdentifier();
+}
+
+bool JSTestIndexedSetterWithIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    auto optionalIndex = parseIndex(propertyName);
+    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
+        auto index = optionalIndex.value();
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    return false;
+}
+
+bool JSTestIndexedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (LIKELY(index < thisObject->wrapped().length())) {
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestIndexedSetterWithIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
+        propertyNames.add(Identifier::from(state, i));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestIndexedSetterWithIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestIndexedSetterWithIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (LIKELY(index <= MAX_ARRAY_INDEX)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestIndexedSetterWithIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+template<> inline JSTestIndexedSetterWithIdentifier* IDLOperation<JSTestIndexedSetterWithIdentifier>::cast(ExecState& state)
+{
+    return jsDynamicDowncast<JSTestIndexedSetterWithIdentifier*>(state.vm(), state.thisValue());
+}
+
+EncodedJSValue jsTestIndexedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestIndexedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestIndexedSetterWithIdentifier::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestIndexedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestIndexedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+static inline JSC::EncodedJSValue jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestIndexedSetterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    if (UNLIKELY(state->argumentCount() < 2))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    impl.indexedSetter(WTFMove(index), WTFMove(value));
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(ExecState* state)
+{
+    return IDLOperation<JSTestIndexedSetterWithIdentifier>::call<jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody>(*state, "indexedSetter");
+}
+
+bool JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestIndexedSetterWithIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestIndexedSetterWithIdentifier = static_cast<JSTestIndexedSetterWithIdentifier*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestIndexedSetterWithIdentifier->wrapped(), jsTestIndexedSetterWithIdentifier);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestIndexedSetterWithIdentifier@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore31TestIndexedSetterWithIdentifierE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestIndexedSetterWithIdentifier>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestIndexedSetterWithIdentifier@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore31TestIndexedSetterWithIdentifierE[2];
+#if COMPILER(CLANG)
+    // If this fails TestIndexedSetterWithIdentifier does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestIndexedSetterWithIdentifier), "TestIndexedSetterWithIdentifier is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestIndexedSetterWithIdentifier has subclasses. If TestIndexedSetterWithIdentifier has subclasses that get passed
+    // to toJS() we currently require TestIndexedSetterWithIdentifier you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestIndexedSetterWithIdentifier>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestIndexedSetterWithIdentifier& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestIndexedSetterWithIdentifier* JSTestIndexedSetterWithIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestIndexedSetterWithIdentifier*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h
new file mode 100644 (file)
index 0000000..83ebf52
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestIndexedSetterWithIdentifier.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestIndexedSetterWithIdentifier : public JSDOMWrapper<TestIndexedSetterWithIdentifier> {
+public:
+    using Base = JSDOMWrapper<TestIndexedSetterWithIdentifier>;
+    static JSTestIndexedSetterWithIdentifier* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestIndexedSetterWithIdentifier>&& impl)
+    {
+        JSTestIndexedSetterWithIdentifier* ptr = new (NotNull, JSC::allocateCell<JSTestIndexedSetterWithIdentifier>(globalObject->vm().heap)) JSTestIndexedSetterWithIdentifier(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestIndexedSetterWithIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestIndexedSetterWithIdentifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestIndexedSetterWithIdentifier>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestIndexedSetterWithIdentifierOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestIndexedSetterWithIdentifier*)
+{
+    static NeverDestroyed<JSTestIndexedSetterWithIdentifierOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestIndexedSetterWithIdentifier* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestIndexedSetterWithIdentifier&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestIndexedSetterWithIdentifier* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestIndexedSetterWithIdentifier>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestIndexedSetterWithIdentifier>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestIndexedSetterWithIdentifier> {
+    using WrapperClass = JSTestIndexedSetterWithIdentifier;
+    using ToWrappedReturnType = TestIndexedSetterWithIdentifier*;
+};
+
+} // namespace WebCore
index ce09a3c..d9f28da 100644 (file)
@@ -407,25 +407,29 @@ void JSTestInterface::destroy(JSC::JSCell* cell)
     thisObject->JSTestInterface::~JSTestInterface();
 }
 
-bool JSTestInterface::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
+bool JSTestInterface::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
 {
     auto* thisObject = jsCast<JSTestInterface*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
     bool putResult = false;
-    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))
+    if (thisObject->putDelegate(state, propertyName, value, putPropertySlot, putResult))
         return putResult;
-    return Base::put(thisObject, state, propertyName, value, slot);
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
 }
 
 bool JSTestInterface::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
 {
     auto* thisObject = jsCast<JSTestInterface*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
     Identifier propertyName = Identifier::from(state, index);
     PutPropertySlot slot(thisObject, shouldThrow);
     bool putResult = false;
     if (thisObject->putDelegate(state, propertyName, value, slot, putResult))
         return putResult;
+
     return Base::putByIndex(cell, state, index, value, shouldThrow);
 }
 
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp
new file mode 100644 (file)
index 0000000..8c7ff00
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedAndIndexedSetterNoIdentifier.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedAndIndexedSetterNoIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedAndIndexedSetterNoIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedAndIndexedSetterNoIdentifierPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedAndIndexedSetterNoIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedAndIndexedSetterNoIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterNoIdentifierPrototype>(vm.heap)) JSTestNamedAndIndexedSetterNoIdentifierPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedAndIndexedSetterNoIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedAndIndexedSetterNoIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestNamedAndIndexedSetterNoIdentifier>;
+
+template<> JSValue JSTestNamedAndIndexedSetterNoIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedAndIndexedSetterNoIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedAndIndexedSetterNoIdentifier::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedAndIndexedSetterNoIdentifier"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedAndIndexedSetterNoIdentifierConstructor::s_info = { "TestNamedAndIndexedSetterNoIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterNoIdentifierConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedAndIndexedSetterNoIdentifierPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedAndIndexedSetterNoIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedAndIndexedSetterNoIdentifierConstructor) } },
+};
+
+const ClassInfo JSTestNamedAndIndexedSetterNoIdentifierPrototype::s_info = { "TestNamedAndIndexedSetterNoIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterNoIdentifierPrototype) };
+
+void JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedAndIndexedSetterNoIdentifierPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedAndIndexedSetterNoIdentifier::s_info = { "TestNamedAndIndexedSetterNoIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterNoIdentifier) };
+
+JSTestNamedAndIndexedSetterNoIdentifier::JSTestNamedAndIndexedSetterNoIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedAndIndexedSetterNoIdentifier>&& impl)
+    : JSDOMWrapper<TestNamedAndIndexedSetterNoIdentifier>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedAndIndexedSetterNoIdentifier::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedAndIndexedSetterNoIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedAndIndexedSetterNoIdentifierPrototype::create(vm, &globalObject, JSTestNamedAndIndexedSetterNoIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedAndIndexedSetterNoIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedAndIndexedSetterNoIdentifier>(vm, globalObject);
+}
+
+JSValue JSTestNamedAndIndexedSetterNoIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedAndIndexedSetterNoIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedAndIndexedSetterNoIdentifier::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedAndIndexedSetterNoIdentifier* thisObject = static_cast<JSTestNamedAndIndexedSetterNoIdentifier*>(cell);
+    thisObject->JSTestNamedAndIndexedSetterNoIdentifier::~JSTestNamedAndIndexedSetterNoIdentifier();
+}
+
+bool JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    auto optionalIndex = parseIndex(propertyName);
+    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
+        auto index = optionalIndex.value();
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (LIKELY(index < thisObject->wrapped().length())) {
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
+        propertyNames.add(Identifier::from(state, i));
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedAndIndexedSetterNoIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedAndIndexedSetterNoIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (LIKELY(index <= MAX_ARRAY_INDEX)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setItem(index, WTFMove(nativeValue));
+        return true;
+    }
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedAndIndexedSetterNoIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestNamedAndIndexedSetterNoIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedAndIndexedSetterNoIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedAndIndexedSetterNoIdentifier::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedAndIndexedSetterNoIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedAndIndexedSetterNoIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedAndIndexedSetterNoIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedAndIndexedSetterNoIdentifier = static_cast<JSTestNamedAndIndexedSetterNoIdentifier*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedAndIndexedSetterNoIdentifier->wrapped(), jsTestNamedAndIndexedSetterNoIdentifier);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedAndIndexedSetterNoIdentifier@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore37TestNamedAndIndexedSetterNoIdentifierE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterNoIdentifier>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedAndIndexedSetterNoIdentifier@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore37TestNamedAndIndexedSetterNoIdentifierE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedAndIndexedSetterNoIdentifier does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedAndIndexedSetterNoIdentifier), "TestNamedAndIndexedSetterNoIdentifier is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedAndIndexedSetterNoIdentifier has subclasses. If TestNamedAndIndexedSetterNoIdentifier has subclasses that get passed
+    // to toJS() we currently require TestNamedAndIndexedSetterNoIdentifier you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedAndIndexedSetterNoIdentifier>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterNoIdentifier& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedAndIndexedSetterNoIdentifier* JSTestNamedAndIndexedSetterNoIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedAndIndexedSetterNoIdentifier*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h
new file mode 100644 (file)
index 0000000..2b82b09
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedAndIndexedSetterNoIdentifier.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedAndIndexedSetterNoIdentifier : public JSDOMWrapper<TestNamedAndIndexedSetterNoIdentifier> {
+public:
+    using Base = JSDOMWrapper<TestNamedAndIndexedSetterNoIdentifier>;
+    static JSTestNamedAndIndexedSetterNoIdentifier* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterNoIdentifier>&& impl)
+    {
+        JSTestNamedAndIndexedSetterNoIdentifier* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterNoIdentifier>(globalObject->vm().heap)) JSTestNamedAndIndexedSetterNoIdentifier(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedAndIndexedSetterNoIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedAndIndexedSetterNoIdentifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedAndIndexedSetterNoIdentifier>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedAndIndexedSetterNoIdentifierOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedAndIndexedSetterNoIdentifier*)
+{
+    static NeverDestroyed<JSTestNamedAndIndexedSetterNoIdentifierOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedAndIndexedSetterNoIdentifier* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedAndIndexedSetterNoIdentifier&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterNoIdentifier* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedAndIndexedSetterNoIdentifier>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedAndIndexedSetterNoIdentifier>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedAndIndexedSetterNoIdentifier> {
+    using WrapperClass = JSTestNamedAndIndexedSetterNoIdentifier;
+    using ToWrappedReturnType = TestNamedAndIndexedSetterNoIdentifier*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp
new file mode 100644 (file)
index 0000000..4a5f94b
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedAndIndexedSetterThrowingException.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedAndIndexedSetterThrowingExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedAndIndexedSetterThrowingExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedAndIndexedSetterThrowingExceptionPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedAndIndexedSetterThrowingExceptionPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedAndIndexedSetterThrowingExceptionPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterThrowingExceptionPrototype>(vm.heap)) JSTestNamedAndIndexedSetterThrowingExceptionPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedAndIndexedSetterThrowingExceptionPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedAndIndexedSetterThrowingExceptionConstructor = JSDOMConstructorNotConstructable<JSTestNamedAndIndexedSetterThrowingException>;
+
+template<> JSValue JSTestNamedAndIndexedSetterThrowingExceptionConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedAndIndexedSetterThrowingExceptionConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedAndIndexedSetterThrowingException::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedAndIndexedSetterThrowingException"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedAndIndexedSetterThrowingExceptionConstructor::s_info = { "TestNamedAndIndexedSetterThrowingException", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterThrowingExceptionConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedAndIndexedSetterThrowingExceptionPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedAndIndexedSetterThrowingExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedAndIndexedSetterThrowingExceptionConstructor) } },
+};
+
+const ClassInfo JSTestNamedAndIndexedSetterThrowingExceptionPrototype::s_info = { "TestNamedAndIndexedSetterThrowingExceptionPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterThrowingExceptionPrototype) };
+
+void JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedAndIndexedSetterThrowingExceptionPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedAndIndexedSetterThrowingException::s_info = { "TestNamedAndIndexedSetterThrowingException", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterThrowingException) };
+
+JSTestNamedAndIndexedSetterThrowingException::JSTestNamedAndIndexedSetterThrowingException(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedAndIndexedSetterThrowingException>&& impl)
+    : JSDOMWrapper<TestNamedAndIndexedSetterThrowingException>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedAndIndexedSetterThrowingException::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedAndIndexedSetterThrowingException::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedAndIndexedSetterThrowingExceptionPrototype::create(vm, &globalObject, JSTestNamedAndIndexedSetterThrowingExceptionPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedAndIndexedSetterThrowingException::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedAndIndexedSetterThrowingException>(vm, globalObject);
+}
+
+JSValue JSTestNamedAndIndexedSetterThrowingException::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedAndIndexedSetterThrowingExceptionConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedAndIndexedSetterThrowingException::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedAndIndexedSetterThrowingException* thisObject = static_cast<JSTestNamedAndIndexedSetterThrowingException*>(cell);
+    thisObject->JSTestNamedAndIndexedSetterThrowingException::~JSTestNamedAndIndexedSetterThrowingException();
+}
+
+bool JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    auto optionalIndex = parseIndex(propertyName);
+    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
+        auto index = optionalIndex.value();
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (LIKELY(index < thisObject->wrapped().length())) {
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedAndIndexedSetterThrowingException::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
+        propertyNames.add(Identifier::from(state, i));
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedAndIndexedSetterThrowingException::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
+        return true;
+    }
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            propagateException(*state, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedAndIndexedSetterThrowingException::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (LIKELY(index <= MAX_ARRAY_INDEX)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setItem(index, WTFMove(nativeValue)));
+        return true;
+    }
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedAndIndexedSetterThrowingException::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
+        return true;
+    }
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            propagateException(*state, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
+            return true;
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestNamedAndIndexedSetterThrowingExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedAndIndexedSetterThrowingExceptionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedAndIndexedSetterThrowingException::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedAndIndexedSetterThrowingExceptionConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedAndIndexedSetterThrowingExceptionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedAndIndexedSetterThrowingExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedAndIndexedSetterThrowingException = static_cast<JSTestNamedAndIndexedSetterThrowingException*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedAndIndexedSetterThrowingException->wrapped(), jsTestNamedAndIndexedSetterThrowingException);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedAndIndexedSetterThrowingException@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore42TestNamedAndIndexedSetterThrowingExceptionE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterThrowingException>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedAndIndexedSetterThrowingException@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore42TestNamedAndIndexedSetterThrowingExceptionE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedAndIndexedSetterThrowingException does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedAndIndexedSetterThrowingException), "TestNamedAndIndexedSetterThrowingException is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedAndIndexedSetterThrowingException has subclasses. If TestNamedAndIndexedSetterThrowingException has subclasses that get passed
+    // to toJS() we currently require TestNamedAndIndexedSetterThrowingException you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedAndIndexedSetterThrowingException>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterThrowingException& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedAndIndexedSetterThrowingException* JSTestNamedAndIndexedSetterThrowingException::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedAndIndexedSetterThrowingException*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h
new file mode 100644 (file)
index 0000000..3cdb6dc
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedAndIndexedSetterThrowingException.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedAndIndexedSetterThrowingException : public JSDOMWrapper<TestNamedAndIndexedSetterThrowingException> {
+public:
+    using Base = JSDOMWrapper<TestNamedAndIndexedSetterThrowingException>;
+    static JSTestNamedAndIndexedSetterThrowingException* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterThrowingException>&& impl)
+    {
+        JSTestNamedAndIndexedSetterThrowingException* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterThrowingException>(globalObject->vm().heap)) JSTestNamedAndIndexedSetterThrowingException(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedAndIndexedSetterThrowingException* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedAndIndexedSetterThrowingException(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedAndIndexedSetterThrowingException>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedAndIndexedSetterThrowingExceptionOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedAndIndexedSetterThrowingException*)
+{
+    static NeverDestroyed<JSTestNamedAndIndexedSetterThrowingExceptionOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedAndIndexedSetterThrowingException* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedAndIndexedSetterThrowingException&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterThrowingException* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedAndIndexedSetterThrowingException>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedAndIndexedSetterThrowingException>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedAndIndexedSetterThrowingException> {
+    using WrapperClass = JSTestNamedAndIndexedSetterThrowingException;
+    using ToWrappedReturnType = TestNamedAndIndexedSetterThrowingException*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp
new file mode 100644 (file)
index 0000000..8712e14
--- /dev/null
@@ -0,0 +1,406 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedAndIndexedSetterWithIdentifier.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMOperation.h"
+#include "JSDOMWrapperCache.h"
+#include "URL.h"
+#include <runtime/FunctionPrototype.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedAndIndexedSetterWithIdentifierPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedAndIndexedSetterWithIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedAndIndexedSetterWithIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterWithIdentifierPrototype>(vm.heap)) JSTestNamedAndIndexedSetterWithIdentifierPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedAndIndexedSetterWithIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedAndIndexedSetterWithIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestNamedAndIndexedSetterWithIdentifier>;
+
+template<> JSValue JSTestNamedAndIndexedSetterWithIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedAndIndexedSetterWithIdentifier::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedAndIndexedSetterWithIdentifier"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedAndIndexedSetterWithIdentifierConstructor::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifierConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedAndIndexedSetterWithIdentifierPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedAndIndexedSetterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedAndIndexedSetterWithIdentifierConstructor) } },
+    { "namedSetter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter), (intptr_t) (2) } },
+    { "indexedSetter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter), (intptr_t) (2) } },
+};
+
+const ClassInfo JSTestNamedAndIndexedSetterWithIdentifierPrototype::s_info = { "TestNamedAndIndexedSetterWithIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifierPrototype) };
+
+void JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedAndIndexedSetterWithIdentifierPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedAndIndexedSetterWithIdentifier::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifier) };
+
+JSTestNamedAndIndexedSetterWithIdentifier::JSTestNamedAndIndexedSetterWithIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedAndIndexedSetterWithIdentifier>&& impl)
+    : JSDOMWrapper<TestNamedAndIndexedSetterWithIdentifier>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedAndIndexedSetterWithIdentifier::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedAndIndexedSetterWithIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedAndIndexedSetterWithIdentifierPrototype::create(vm, &globalObject, JSTestNamedAndIndexedSetterWithIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedAndIndexedSetterWithIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedAndIndexedSetterWithIdentifier>(vm, globalObject);
+}
+
+JSValue JSTestNamedAndIndexedSetterWithIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedAndIndexedSetterWithIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedAndIndexedSetterWithIdentifier::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedAndIndexedSetterWithIdentifier* thisObject = static_cast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
+    thisObject->JSTestNamedAndIndexedSetterWithIdentifier::~JSTestNamedAndIndexedSetterWithIdentifier();
+}
+
+bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    auto optionalIndex = parseIndex(propertyName);
+    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
+        auto index = optionalIndex.value();
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (LIKELY(index < thisObject->wrapped().length())) {
+        slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, thisObject->wrapped().item(index)));
+        return true;
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
+        propertyNames.add(Identifier::from(state, i));
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedAndIndexedSetterWithIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedAndIndexedSetterWithIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (LIKELY(index <= MAX_ARRAY_INDEX)) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue));
+        return true;
+    }
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedAndIndexedSetterWithIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (auto index = parseIndex(propertyName)) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
+        return true;
+    }
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+template<> inline JSTestNamedAndIndexedSetterWithIdentifier* IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast(ExecState& state)
+{
+    return jsDynamicDowncast<JSTestNamedAndIndexedSetterWithIdentifier*>(state.vm(), state.thisValue());
+}
+
+EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedAndIndexedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedAndIndexedSetterWithIdentifier::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedAndIndexedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedAndIndexedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+static inline JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    if (UNLIKELY(state->argumentCount() < 2))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto name = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    impl.namedSetter(WTFMove(name), WTFMove(value));
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter(ExecState* state)
+{
+    return IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::call<jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody>(*state, "namedSetter");
+}
+
+static inline JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    if (UNLIKELY(state->argumentCount() < 2))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    impl.indexedSetter(WTFMove(index), WTFMove(value));
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(ExecState* state)
+{
+    return IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::call<jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody>(*state, "indexedSetter");
+}
+
+bool JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedAndIndexedSetterWithIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedAndIndexedSetterWithIdentifier = static_cast<JSTestNamedAndIndexedSetterWithIdentifier*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedAndIndexedSetterWithIdentifier->wrapped(), jsTestNamedAndIndexedSetterWithIdentifier);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedAndIndexedSetterWithIdentifier@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore39TestNamedAndIndexedSetterWithIdentifierE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterWithIdentifier>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedAndIndexedSetterWithIdentifier@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore39TestNamedAndIndexedSetterWithIdentifierE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedAndIndexedSetterWithIdentifier does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedAndIndexedSetterWithIdentifier), "TestNamedAndIndexedSetterWithIdentifier is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedAndIndexedSetterWithIdentifier has subclasses. If TestNamedAndIndexedSetterWithIdentifier has subclasses that get passed
+    // to toJS() we currently require TestNamedAndIndexedSetterWithIdentifier you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedAndIndexedSetterWithIdentifier>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterWithIdentifier& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedAndIndexedSetterWithIdentifier* JSTestNamedAndIndexedSetterWithIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedAndIndexedSetterWithIdentifier*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h
new file mode 100644 (file)
index 0000000..ddcb655
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedAndIndexedSetterWithIdentifier.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedAndIndexedSetterWithIdentifier : public JSDOMWrapper<TestNamedAndIndexedSetterWithIdentifier> {
+public:
+    using Base = JSDOMWrapper<TestNamedAndIndexedSetterWithIdentifier>;
+    static JSTestNamedAndIndexedSetterWithIdentifier* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterWithIdentifier>&& impl)
+    {
+        JSTestNamedAndIndexedSetterWithIdentifier* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterWithIdentifier>(globalObject->vm().heap)) JSTestNamedAndIndexedSetterWithIdentifier(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedAndIndexedSetterWithIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedAndIndexedSetterWithIdentifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedAndIndexedSetterWithIdentifier>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedAndIndexedSetterWithIdentifierOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedAndIndexedSetterWithIdentifier*)
+{
+    static NeverDestroyed<JSTestNamedAndIndexedSetterWithIdentifierOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedAndIndexedSetterWithIdentifier* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedAndIndexedSetterWithIdentifier&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterWithIdentifier* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedAndIndexedSetterWithIdentifier>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedAndIndexedSetterWithIdentifier>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedAndIndexedSetterWithIdentifier> {
+    using WrapperClass = JSTestNamedAndIndexedSetterWithIdentifier;
+    using ToWrappedReturnType = TestNamedAndIndexedSetterWithIdentifier*;
+};
+
+} // namespace WebCore
index 122fdf4..fc93e80 100644 (file)
@@ -41,6 +41,7 @@ public:
     static TestNamedDeleterNoIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);
     static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);
     static void destroy(JSC::JSCell*);
@@ -52,7 +53,6 @@ public:
         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 
-    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
 public:
     static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
index 57985d0..cde11c6 100644 (file)
@@ -41,6 +41,7 @@ public:
     static TestNamedDeleterThrowingException* toWrapped(JSC::VM&, JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);
     static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);
     static void destroy(JSC::JSCell*);
@@ -52,7 +53,6 @@ public:
         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 
-    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
 public:
     static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
index 761743b..7d9c3be 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 // Functions
 
-JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedDeleterWithIdentifierPrototypeFunctionRemove(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleter(JSC::ExecState*);
 
 // Attributes
 
@@ -91,7 +91,7 @@ template<> const ClassInfo JSTestNamedDeleterWithIdentifierConstructor::s_info =
 static const HashTableValue JSTestNamedDeleterWithIdentifierPrototypeTableValues[] =
 {
     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedDeleterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedDeleterWithIdentifierConstructor) } },
-    { "remove", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedDeleterWithIdentifierPrototypeFunctionRemove), (intptr_t) (1) } },
+    { "namedDeleter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleter), (intptr_t) (1) } },
 };
 
 const ClassInfo JSTestNamedDeleterWithIdentifierPrototype::s_info = { "TestNamedDeleterWithIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedDeleterWithIdentifierPrototype) };
@@ -186,7 +186,7 @@ bool JSTestNamedDeleterWithIdentifier::deleteProperty(JSCell* cell, ExecState* s
     auto& thisObject = *jsCast<JSTestNamedDeleterWithIdentifier*>(cell);
     auto& impl = thisObject.wrapped();
     if (isVisibleNamedProperty<false>(*state, thisObject, propertyName)) {
-        impl.remove(propertyNameToString(propertyName));
+        impl.namedDeleter(propertyNameToString(propertyName));
         return true;
     }
     return Base::deleteProperty(cell, state, propertyName);
@@ -198,7 +198,7 @@ bool JSTestNamedDeleterWithIdentifier::deletePropertyByIndex(JSCell* cell, ExecS
     auto& impl = thisObject.wrapped();
     auto propertyName = Identifier::from(state, index);
     if (isVisibleNamedProperty<false>(*state, thisObject, propertyName)) {
-        impl.remove(propertyNameToString(propertyName));
+        impl.namedDeleter(propertyNameToString(propertyName));
         return true;
     }
     return Base::deletePropertyByIndex(cell, state, index);
@@ -232,7 +232,7 @@ bool setJSTestNamedDeleterWithIdentifierConstructor(ExecState* state, EncodedJSV
     return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
 }
 
-static inline JSC::EncodedJSValue jsTestNamedDeleterWithIdentifierPrototypeFunctionRemoveBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedDeleterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+static inline JSC::EncodedJSValue jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedDeleterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
 {
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
@@ -241,13 +241,13 @@ static inline JSC::EncodedJSValue jsTestNamedDeleterWithIdentifierPrototypeFunct
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto name = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    impl.remove(WTFMove(name));
+    impl.namedDeleter(WTFMove(name));
     return JSValue::encode(jsUndefined());
 }
 
-EncodedJSValue JSC_HOST_CALL jsTestNamedDeleterWithIdentifierPrototypeFunctionRemove(ExecState* state)
+EncodedJSValue JSC_HOST_CALL jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleter(ExecState* state)
 {
-    return IDLOperation<JSTestNamedDeleterWithIdentifier>::call<jsTestNamedDeleterWithIdentifierPrototypeFunctionRemoveBody>(*state, "remove");
+    return IDLOperation<JSTestNamedDeleterWithIdentifier>::call<jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleterBody>(*state, "namedDeleter");
 }
 
 bool JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
index 853d683..0141708 100644 (file)
@@ -41,6 +41,7 @@ public:
     static TestNamedDeleterWithIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);
     static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);
     static void destroy(JSC::JSCell*);
@@ -52,7 +53,6 @@ public:
         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 
-    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
 public:
     static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
index cd84d7b..153db7e 100644 (file)
@@ -41,6 +41,7 @@ public:
     static TestNamedDeleterWithIndexedGetter* toWrapped(JSC::VM&, JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);
     static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);
     static void destroy(JSC::JSCell*);
@@ -52,7 +53,6 @@ public:
         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 
-    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
 public:
     static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp
new file mode 100644 (file)
index 0000000..5769869
--- /dev/null
@@ -0,0 +1,321 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedSetterNoIdentifier.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedSetterNoIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedSetterNoIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedSetterNoIdentifierPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedSetterNoIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedSetterNoIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterNoIdentifierPrototype>(vm.heap)) JSTestNamedSetterNoIdentifierPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedSetterNoIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedSetterNoIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterNoIdentifier>;
+
+template<> JSValue JSTestNamedSetterNoIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedSetterNoIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterNoIdentifier::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterNoIdentifier"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedSetterNoIdentifierConstructor::s_info = { "TestNamedSetterNoIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterNoIdentifierConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedSetterNoIdentifierPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterNoIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterNoIdentifierConstructor) } },
+};
+
+const ClassInfo JSTestNamedSetterNoIdentifierPrototype::s_info = { "TestNamedSetterNoIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterNoIdentifierPrototype) };
+
+void JSTestNamedSetterNoIdentifierPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedSetterNoIdentifierPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedSetterNoIdentifier::s_info = { "TestNamedSetterNoIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterNoIdentifier) };
+
+JSTestNamedSetterNoIdentifier::JSTestNamedSetterNoIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterNoIdentifier>&& impl)
+    : JSDOMWrapper<TestNamedSetterNoIdentifier>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedSetterNoIdentifier::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedSetterNoIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedSetterNoIdentifierPrototype::create(vm, &globalObject, JSTestNamedSetterNoIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedSetterNoIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedSetterNoIdentifier>(vm, globalObject);
+}
+
+JSValue JSTestNamedSetterNoIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedSetterNoIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedSetterNoIdentifier::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedSetterNoIdentifier* thisObject = static_cast<JSTestNamedSetterNoIdentifier*>(cell);
+    thisObject->JSTestNamedSetterNoIdentifier::~JSTestNamedSetterNoIdentifier();
+}
+
+bool JSTestNamedSetterNoIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedSetterNoIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Identifier propertyName = Identifier::from(state, index);
+    if (thisObject->classInfo() == info()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedSetterNoIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedSetterNoIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedSetterNoIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedSetterNoIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestNamedSetterNoIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterNoIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedSetterNoIdentifier::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedSetterNoIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterNoIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedSetterNoIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedSetterNoIdentifier = static_cast<JSTestNamedSetterNoIdentifier*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedSetterNoIdentifier->wrapped(), jsTestNamedSetterNoIdentifier);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedSetterNoIdentifier@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore27TestNamedSetterNoIdentifierE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterNoIdentifier>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedSetterNoIdentifier@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore27TestNamedSetterNoIdentifierE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedSetterNoIdentifier does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedSetterNoIdentifier), "TestNamedSetterNoIdentifier is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedSetterNoIdentifier has subclasses. If TestNamedSetterNoIdentifier has subclasses that get passed
+    // to toJS() we currently require TestNamedSetterNoIdentifier you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedSetterNoIdentifier>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterNoIdentifier& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedSetterNoIdentifier* JSTestNamedSetterNoIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedSetterNoIdentifier*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h
new file mode 100644 (file)
index 0000000..4544c51
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedSetterNoIdentifier.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedSetterNoIdentifier : public JSDOMWrapper<TestNamedSetterNoIdentifier> {
+public:
+    using Base = JSDOMWrapper<TestNamedSetterNoIdentifier>;
+    static JSTestNamedSetterNoIdentifier* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterNoIdentifier>&& impl)
+    {
+        JSTestNamedSetterNoIdentifier* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterNoIdentifier>(globalObject->vm().heap)) JSTestNamedSetterNoIdentifier(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedSetterNoIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedSetterNoIdentifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedSetterNoIdentifier>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedSetterNoIdentifierOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedSetterNoIdentifier*)
+{
+    static NeverDestroyed<JSTestNamedSetterNoIdentifierOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedSetterNoIdentifier* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedSetterNoIdentifier&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterNoIdentifier* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedSetterNoIdentifier>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedSetterNoIdentifier>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedSetterNoIdentifier> {
+    using WrapperClass = JSTestNamedSetterNoIdentifier;
+    using ToWrappedReturnType = TestNamedSetterNoIdentifier*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp
new file mode 100644 (file)
index 0000000..2609634
--- /dev/null
@@ -0,0 +1,321 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedSetterThrowingException.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedSetterThrowingExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedSetterThrowingExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedSetterThrowingExceptionPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedSetterThrowingExceptionPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedSetterThrowingExceptionPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterThrowingExceptionPrototype>(vm.heap)) JSTestNamedSetterThrowingExceptionPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedSetterThrowingExceptionPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedSetterThrowingExceptionConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterThrowingException>;
+
+template<> JSValue JSTestNamedSetterThrowingExceptionConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedSetterThrowingExceptionConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterThrowingException::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterThrowingException"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedSetterThrowingExceptionConstructor::s_info = { "TestNamedSetterThrowingException", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterThrowingExceptionConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedSetterThrowingExceptionPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterThrowingExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterThrowingExceptionConstructor) } },
+};
+
+const ClassInfo JSTestNamedSetterThrowingExceptionPrototype::s_info = { "TestNamedSetterThrowingExceptionPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterThrowingExceptionPrototype) };
+
+void JSTestNamedSetterThrowingExceptionPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedSetterThrowingExceptionPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedSetterThrowingException::s_info = { "TestNamedSetterThrowingException", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterThrowingException) };
+
+JSTestNamedSetterThrowingException::JSTestNamedSetterThrowingException(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterThrowingException>&& impl)
+    : JSDOMWrapper<TestNamedSetterThrowingException>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedSetterThrowingException::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedSetterThrowingException::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedSetterThrowingExceptionPrototype::create(vm, &globalObject, JSTestNamedSetterThrowingExceptionPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedSetterThrowingException::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedSetterThrowingException>(vm, globalObject);
+}
+
+JSValue JSTestNamedSetterThrowingException::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedSetterThrowingExceptionConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedSetterThrowingException::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedSetterThrowingException* thisObject = static_cast<JSTestNamedSetterThrowingException*>(cell);
+    thisObject->JSTestNamedSetterThrowingException::~JSTestNamedSetterThrowingException();
+}
+
+bool JSTestNamedSetterThrowingException::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedSetterThrowingException::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Identifier propertyName = Identifier::from(state, index);
+    if (thisObject->classInfo() == info()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedSetterThrowingException::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedSetterThrowingException::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            propagateException(*state, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedSetterThrowingException::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        propagateException(*state, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedSetterThrowingException::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            propagateException(*state, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
+            return true;
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestNamedSetterThrowingExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterThrowingExceptionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedSetterThrowingException::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedSetterThrowingExceptionConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterThrowingExceptionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedSetterThrowingExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedSetterThrowingException = static_cast<JSTestNamedSetterThrowingException*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedSetterThrowingException->wrapped(), jsTestNamedSetterThrowingException);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedSetterThrowingException@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore32TestNamedSetterThrowingExceptionE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterThrowingException>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedSetterThrowingException@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore32TestNamedSetterThrowingExceptionE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedSetterThrowingException does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedSetterThrowingException), "TestNamedSetterThrowingException is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedSetterThrowingException has subclasses. If TestNamedSetterThrowingException has subclasses that get passed
+    // to toJS() we currently require TestNamedSetterThrowingException you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedSetterThrowingException>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterThrowingException& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedSetterThrowingException* JSTestNamedSetterThrowingException::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedSetterThrowingException*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h
new file mode 100644 (file)
index 0000000..ef4a26d
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedSetterThrowingException.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedSetterThrowingException : public JSDOMWrapper<TestNamedSetterThrowingException> {
+public:
+    using Base = JSDOMWrapper<TestNamedSetterThrowingException>;
+    static JSTestNamedSetterThrowingException* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterThrowingException>&& impl)
+    {
+        JSTestNamedSetterThrowingException* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterThrowingException>(globalObject->vm().heap)) JSTestNamedSetterThrowingException(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedSetterThrowingException* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedSetterThrowingException(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedSetterThrowingException>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedSetterThrowingExceptionOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedSetterThrowingException*)
+{
+    static NeverDestroyed<JSTestNamedSetterThrowingExceptionOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedSetterThrowingException* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedSetterThrowingException&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterThrowingException* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedSetterThrowingException>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedSetterThrowingException>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedSetterThrowingException> {
+    using WrapperClass = JSTestNamedSetterThrowingException;
+    using ToWrappedReturnType = TestNamedSetterThrowingException*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp
new file mode 100644 (file)
index 0000000..e81bf37
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedSetterWithIdentifier.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMOperation.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetter(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedSetterWithIdentifierPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedSetterWithIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedSetterWithIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithIdentifierPrototype>(vm.heap)) JSTestNamedSetterWithIdentifierPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedSetterWithIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedSetterWithIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterWithIdentifier>;
+
+template<> JSValue JSTestNamedSetterWithIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedSetterWithIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterWithIdentifier::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterWithIdentifier"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedSetterWithIdentifierConstructor::s_info = { "TestNamedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithIdentifierConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedSetterWithIdentifierPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterWithIdentifierConstructor) } },
+    { "namedSetter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetter), (intptr_t) (2) } },
+};
+
+const ClassInfo JSTestNamedSetterWithIdentifierPrototype::s_info = { "TestNamedSetterWithIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithIdentifierPrototype) };
+
+void JSTestNamedSetterWithIdentifierPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedSetterWithIdentifierPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedSetterWithIdentifier::s_info = { "TestNamedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithIdentifier) };
+
+JSTestNamedSetterWithIdentifier::JSTestNamedSetterWithIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterWithIdentifier>&& impl)
+    : JSDOMWrapper<TestNamedSetterWithIdentifier>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedSetterWithIdentifier::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedSetterWithIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedSetterWithIdentifierPrototype::create(vm, &globalObject, JSTestNamedSetterWithIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedSetterWithIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedSetterWithIdentifier>(vm, globalObject);
+}
+
+JSValue JSTestNamedSetterWithIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedSetterWithIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedSetterWithIdentifier::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedSetterWithIdentifier* thisObject = static_cast<JSTestNamedSetterWithIdentifier*>(cell);
+    thisObject->JSTestNamedSetterWithIdentifier::~JSTestNamedSetterWithIdentifier();
+}
+
+bool JSTestNamedSetterWithIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Identifier propertyName = Identifier::from(state, index);
+    if (thisObject->classInfo() == info()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedSetterWithIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedSetterWithIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedSetterWithIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedSetterWithIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+template<> inline JSTestNamedSetterWithIdentifier* IDLOperation<JSTestNamedSetterWithIdentifier>::cast(ExecState& state)
+{
+    return jsDynamicDowncast<JSTestNamedSetterWithIdentifier*>(state.vm(), state.thisValue());
+}
+
+EncodedJSValue jsTestNamedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedSetterWithIdentifier::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+static inline JSC::EncodedJSValue jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedSetterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    if (UNLIKELY(state->argumentCount() < 2))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto name = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    impl.namedSetter(WTFMove(name), WTFMove(value));
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetter(ExecState* state)
+{
+    return IDLOperation<JSTestNamedSetterWithIdentifier>::call<jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetterBody>(*state, "namedSetter");
+}
+
+bool JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedSetterWithIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedSetterWithIdentifier = static_cast<JSTestNamedSetterWithIdentifier*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedSetterWithIdentifier->wrapped(), jsTestNamedSetterWithIdentifier);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedSetterWithIdentifier@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore29TestNamedSetterWithIdentifierE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithIdentifier>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedSetterWithIdentifier@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore29TestNamedSetterWithIdentifierE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedSetterWithIdentifier does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedSetterWithIdentifier), "TestNamedSetterWithIdentifier is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedSetterWithIdentifier has subclasses. If TestNamedSetterWithIdentifier has subclasses that get passed
+    // to toJS() we currently require TestNamedSetterWithIdentifier you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedSetterWithIdentifier>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithIdentifier& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedSetterWithIdentifier* JSTestNamedSetterWithIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedSetterWithIdentifier*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h
new file mode 100644 (file)
index 0000000..bc885b3
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedSetterWithIdentifier.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedSetterWithIdentifier : public JSDOMWrapper<TestNamedSetterWithIdentifier> {
+public:
+    using Base = JSDOMWrapper<TestNamedSetterWithIdentifier>;
+    static JSTestNamedSetterWithIdentifier* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithIdentifier>&& impl)
+    {
+        JSTestNamedSetterWithIdentifier* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithIdentifier>(globalObject->vm().heap)) JSTestNamedSetterWithIdentifier(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedSetterWithIdentifier* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedSetterWithIdentifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedSetterWithIdentifier>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedSetterWithIdentifierOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedSetterWithIdentifier*)
+{
+    static NeverDestroyed<JSTestNamedSetterWithIdentifierOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedSetterWithIdentifier* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedSetterWithIdentifier&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithIdentifier* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedSetterWithIdentifier>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedSetterWithIdentifier>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedSetterWithIdentifier> {
+    using WrapperClass = JSTestNamedSetterWithIdentifier;
+    using ToWrappedReturnType = TestNamedSetterWithIdentifier*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp
new file mode 100644 (file)
index 0000000..53833e0
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedSetterWithOverrideBuiltins.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedSetterWithOverrideBuiltinsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedSetterWithOverrideBuiltinsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestNamedSetterWithOverrideBuiltinsPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedSetterWithOverrideBuiltinsPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedSetterWithOverrideBuiltinsPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithOverrideBuiltinsPrototype>(vm.heap)) JSTestNamedSetterWithOverrideBuiltinsPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedSetterWithOverrideBuiltinsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedSetterWithOverrideBuiltinsConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterWithOverrideBuiltins>;
+
+template<> JSValue JSTestNamedSetterWithOverrideBuiltinsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedSetterWithOverrideBuiltinsConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterWithOverrideBuiltins::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterWithOverrideBuiltins"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedSetterWithOverrideBuiltinsConstructor::s_info = { "TestNamedSetterWithOverrideBuiltins", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithOverrideBuiltinsConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedSetterWithOverrideBuiltinsPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithOverrideBuiltinsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterWithOverrideBuiltinsConstructor) } },
+};
+
+const ClassInfo JSTestNamedSetterWithOverrideBuiltinsPrototype::s_info = { "TestNamedSetterWithOverrideBuiltinsPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithOverrideBuiltinsPrototype) };
+
+void JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedSetterWithOverrideBuiltinsPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedSetterWithOverrideBuiltins::s_info = { "TestNamedSetterWithOverrideBuiltins", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithOverrideBuiltins) };
+
+JSTestNamedSetterWithOverrideBuiltins::JSTestNamedSetterWithOverrideBuiltins(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterWithOverrideBuiltins>&& impl)
+    : JSDOMWrapper<TestNamedSetterWithOverrideBuiltins>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedSetterWithOverrideBuiltins::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedSetterWithOverrideBuiltins::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedSetterWithOverrideBuiltinsPrototype::create(vm, &globalObject, JSTestNamedSetterWithOverrideBuiltinsPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedSetterWithOverrideBuiltins::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedSetterWithOverrideBuiltins>(vm, globalObject);
+}
+
+JSValue JSTestNamedSetterWithOverrideBuiltins::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedSetterWithOverrideBuiltinsConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedSetterWithOverrideBuiltins::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedSetterWithOverrideBuiltins* thisObject = static_cast<JSTestNamedSetterWithOverrideBuiltins*>(cell);
+    thisObject->JSTestNamedSetterWithOverrideBuiltins::~JSTestNamedSetterWithOverrideBuiltins();
+}
+
+bool JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    return false;
+}
+
+bool JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Identifier propertyName = Identifier::from(state, index);
+    if (thisObject->classInfo() == info()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedSetterWithOverrideBuiltins::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedSetterWithOverrideBuiltins::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedSetterWithOverrideBuiltins::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Identifier propertyName = Identifier::from(state, index);
+    auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+    auto nativeValue = convert<IDLDOMString>(*state, value);
+    RETURN_IF_EXCEPTION(throwScope, true);
+    thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+    return true;
+}
+
+bool JSTestNamedSetterWithOverrideBuiltins::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        if (!propertyDescriptor.isDataDescriptor())
+            return false;
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+EncodedJSValue jsTestNamedSetterWithOverrideBuiltinsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithOverrideBuiltinsPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedSetterWithOverrideBuiltins::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedSetterWithOverrideBuiltinsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithOverrideBuiltinsPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+bool JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedSetterWithOverrideBuiltinsOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedSetterWithOverrideBuiltins = static_cast<JSTestNamedSetterWithOverrideBuiltins*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedSetterWithOverrideBuiltins->wrapped(), jsTestNamedSetterWithOverrideBuiltins);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedSetterWithOverrideBuiltins@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore35TestNamedSetterWithOverrideBuiltinsE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithOverrideBuiltins>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedSetterWithOverrideBuiltins@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore35TestNamedSetterWithOverrideBuiltinsE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedSetterWithOverrideBuiltins does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedSetterWithOverrideBuiltins), "TestNamedSetterWithOverrideBuiltins is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedSetterWithOverrideBuiltins has subclasses. If TestNamedSetterWithOverrideBuiltins has subclasses that get passed
+    // to toJS() we currently require TestNamedSetterWithOverrideBuiltins you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedSetterWithOverrideBuiltins>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithOverrideBuiltins& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedSetterWithOverrideBuiltins* JSTestNamedSetterWithOverrideBuiltins::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedSetterWithOverrideBuiltins*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h
new file mode 100644 (file)
index 0000000..d084ca5
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedSetterWithOverrideBuiltins.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedSetterWithOverrideBuiltins : public JSDOMWrapper<TestNamedSetterWithOverrideBuiltins> {
+public:
+    using Base = JSDOMWrapper<TestNamedSetterWithOverrideBuiltins>;
+    static JSTestNamedSetterWithOverrideBuiltins* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithOverrideBuiltins>&& impl)
+    {
+        JSTestNamedSetterWithOverrideBuiltins* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithOverrideBuiltins>(globalObject->vm().heap)) JSTestNamedSetterWithOverrideBuiltins(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedSetterWithOverrideBuiltins* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpure | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedSetterWithOverrideBuiltins(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedSetterWithOverrideBuiltins>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedSetterWithOverrideBuiltinsOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedSetterWithOverrideBuiltins*)
+{
+    static NeverDestroyed<JSTestNamedSetterWithOverrideBuiltinsOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedSetterWithOverrideBuiltins* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedSetterWithOverrideBuiltins&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithOverrideBuiltins* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedSetterWithOverrideBuiltins>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedSetterWithOverrideBuiltins>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedSetterWithOverrideBuiltins> {
+    using WrapperClass = JSTestNamedSetterWithOverrideBuiltins;
+    using ToWrappedReturnType = TestNamedSetterWithOverrideBuiltins*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp
new file mode 100644 (file)
index 0000000..4cf030c
--- /dev/null
@@ -0,0 +1,390 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedSetterWithUnforgableProperties.h"
+
+#include "JSDOMAttribute.h"
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMOperation.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperation(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedSetterWithUnforgablePropertiesConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+
+class JSTestNamedSetterWithUnforgablePropertiesPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedSetterWithUnforgablePropertiesPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedSetterWithUnforgablePropertiesPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithUnforgablePropertiesPrototype>(vm.heap)) JSTestNamedSetterWithUnforgablePropertiesPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedSetterWithUnforgablePropertiesPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedSetterWithUnforgablePropertiesConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterWithUnforgableProperties>;
+
+/* Hash table */
+
+static const struct CompactHashIndex JSTestNamedSetterWithUnforgablePropertiesTableIndex[4] = {
+    { -1, -1 },
+    { 1, -1 },
+    { -1, -1 },
+    { 0, -1 },
+};
+
+
+static const HashTableValue JSTestNamedSetterWithUnforgablePropertiesTableValues[] =
+{
+    { "unforgeableAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+    { "unforgeableOperation", DontDelete | ReadOnly | JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperation), (intptr_t) (0) } },
+};
+
+static const HashTable JSTestNamedSetterWithUnforgablePropertiesTable = { 2, 3, true, JSTestNamedSetterWithUnforgablePropertiesTableValues, JSTestNamedSetterWithUnforgablePropertiesTableIndex };
+template<> JSValue JSTestNamedSetterWithUnforgablePropertiesConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedSetterWithUnforgablePropertiesConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterWithUnforgableProperties::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterWithUnforgableProperties"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedSetterWithUnforgablePropertiesConstructor::s_info = { "TestNamedSetterWithUnforgableProperties", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedSetterWithUnforgablePropertiesPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithUnforgablePropertiesConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterWithUnforgablePropertiesConstructor) } },
+};
+
+const ClassInfo JSTestNamedSetterWithUnforgablePropertiesPrototype::s_info = { "TestNamedSetterWithUnforgablePropertiesPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesPrototype) };
+
+void JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedSetterWithUnforgablePropertiesPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedSetterWithUnforgableProperties::s_info = { "TestNamedSetterWithUnforgableProperties", &Base::s_info, &JSTestNamedSetterWithUnforgablePropertiesTable, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgableProperties) };
+
+JSTestNamedSetterWithUnforgableProperties::JSTestNamedSetterWithUnforgableProperties(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterWithUnforgableProperties>&& impl)
+    : JSDOMWrapper<TestNamedSetterWithUnforgableProperties>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedSetterWithUnforgableProperties::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedSetterWithUnforgableProperties::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedSetterWithUnforgablePropertiesPrototype::create(vm, &globalObject, JSTestNamedSetterWithUnforgablePropertiesPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedSetterWithUnforgableProperties::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedSetterWithUnforgableProperties>(vm, globalObject);
+}
+
+JSValue JSTestNamedSetterWithUnforgableProperties::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedSetterWithUnforgablePropertiesConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedSetterWithUnforgableProperties::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedSetterWithUnforgableProperties* thisObject = static_cast<JSTestNamedSetterWithUnforgableProperties*>(cell);
+    thisObject->JSTestNamedSetterWithUnforgableProperties::~JSTestNamedSetterWithUnforgableProperties();
+}
+
+bool JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    JSValue proto = thisObject->getPrototypeDirect();
+    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
+        return false;
+
+    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Identifier propertyName = Identifier::from(state, index);
+    if (thisObject->classInfo() == info()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedSetterWithUnforgableProperties::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedSetterWithUnforgableProperties::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+        JSValue prototype = thisObject->getPrototypeDirect();
+        if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, value);
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedSetterWithUnforgableProperties::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Identifier propertyName = Identifier::from(state, index);
+    PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+    JSValue prototype = thisObject->getPrototypeDirect();
+    if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::putByIndex(cell, state, index, value, shouldThrow);
+}
+
+bool JSTestNamedSetterWithUnforgableProperties::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+static bool isUnforgeablePropertyName(PropertyName propertyName)
+{
+    return propertyName == "unforgeableAttribute" || propertyName == "unforgeableOperation";
+}
+
+        if (!isUnforgeablePropertyName(propertyName)) {
+            PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
+            if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
+                if (!propertyDescriptor.isDataDescriptor())
+                    return false;
+                auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+                auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+                RETURN_IF_EXCEPTION(throwScope, true);
+                thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+                return true;
+            }
+        }
+    }
+
+    PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
+    newPropertyDescriptor.setConfigurable(true);
+    return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
+}
+
+template<> inline JSTestNamedSetterWithUnforgableProperties* IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast(ExecState& state, EncodedJSValue thisValue)
+{
+    return jsDynamicDowncast<JSTestNamedSetterWithUnforgableProperties*>(state.vm(), JSValue::decode(thisValue));
+}
+
+template<> inline JSTestNamedSetterWithUnforgableProperties* IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast(ExecState& state)
+{
+    return jsDynamicDowncast<JSTestNamedSetterWithUnforgableProperties*>(state.vm(), state.thisValue());
+}
+
+EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestNamedSetterWithUnforgableProperties::getConstructor(state->vm(), prototype->globalObject()));
+}
+
+bool setJSTestNamedSetterWithUnforgablePropertiesConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
+}
+
+static inline JSValue jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttributeGetter(ExecState& state, JSTestNamedSetterWithUnforgableProperties& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLDOMString>(state, impl.unforgeableAttribute());
+    return result;
+}
+
+EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::get<jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttributeGetter>(*state, thisValue, "unforgeableAttribute");
+}
+
+static inline JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperationBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedSetterWithUnforgableProperties>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    impl.unforgeableOperation();
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperation(ExecState* state)
+{
+    return IDLOperation<JSTestNamedSetterWithUnforgableProperties>::call<jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperationBody>(*state, "unforgeableOperation");
+}
+
+bool JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestNamedSetterWithUnforgablePropertiesOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestNamedSetterWithUnforgableProperties = static_cast<JSTestNamedSetterWithUnforgableProperties*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestNamedSetterWithUnforgableProperties->wrapped(), jsTestNamedSetterWithUnforgableProperties);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestNamedSetterWithUnforgableProperties@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore39TestNamedSetterWithUnforgablePropertiesE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithUnforgableProperties>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedSetterWithUnforgableProperties@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore39TestNamedSetterWithUnforgablePropertiesE[2];
+#if COMPILER(CLANG)
+    // If this fails TestNamedSetterWithUnforgableProperties does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestNamedSetterWithUnforgableProperties), "TestNamedSetterWithUnforgableProperties is not polymorphic");
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestNamedSetterWithUnforgableProperties has subclasses. If TestNamedSetterWithUnforgableProperties has subclasses that get passed
+    // to toJS() we currently require TestNamedSetterWithUnforgableProperties you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestNamedSetterWithUnforgableProperties>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithUnforgableProperties& impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestNamedSetterWithUnforgableProperties* JSTestNamedSetterWithUnforgableProperties::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicDowncast<JSTestNamedSetterWithUnforgableProperties*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h
new file mode 100644 (file)
index 0000000..964a17d
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+#include "TestNamedSetterWithUnforgableProperties.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestNamedSetterWithUnforgableProperties : public JSDOMWrapper<TestNamedSetterWithUnforgableProperties> {
+public:
+    using Base = JSDOMWrapper<TestNamedSetterWithUnforgableProperties>;
+    static JSTestNamedSetterWithUnforgableProperties* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithUnforgableProperties>&& impl)
+    {
+        JSTestNamedSetterWithUnforgableProperties* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithUnforgableProperties>(globalObject->vm().heap)) JSTestNamedSetterWithUnforgableProperties(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+    static TestNamedSetterWithUnforgableProperties* toWrapped(JSC::VM&, JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
+    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
+    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
+    static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::HasStaticPropertyTable | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+protected:
+    JSTestNamedSetterWithUnforgableProperties(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedSetterWithUnforgableProperties>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestNamedSetterWithUnforgablePropertiesOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedSetterWithUnforgableProperties*)
+{
+    static NeverDestroyed<JSTestNamedSetterWithUnforgablePropertiesOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestNamedSetterWithUnforgableProperties* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedSetterWithUnforgableProperties&);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithUnforgableProperties* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestNamedSetterWithUnforgableProperties>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestNamedSetterWithUnforgableProperties>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestNamedSetterWithUnforgableProperties> {
+    using WrapperClass = JSTestNamedSetterWithUnforgableProperties;
+    using ToWrappedReturnType = TestNamedSetterWithUnforgableProperties*;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp
new file mode 100644 (file)
index 0000000..8f45d28
--- /dev/null
@@ -0,0 +1,373 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h"
+
+#include "JSDOMAttribute.h"
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMOperation.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+
+class JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype>(vm.heap)) JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>;
+
+/* Hash table */
+
+static const struct CompactHashIndex JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableIndex[4] = {
+    { -1, -1 },
+    { 1, -1 },
+    { -1, -1 },
+    { 0, -1 },
+};
+
+
+static const HashTableValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableValues[] =
+{
+    { "unforgeableAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+    { "unforgeableOperation", DontDelete | ReadOnly | JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation), (intptr_t) (0) } },
+};
+
+static const HashTable JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTable = { 2, 3, true, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableValues, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableIndex };
+template<> JSValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::s_info = { "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor) } },
+};
+
+const ClassInfo JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::s_info = { "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype) };
+
+void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::s_info = { "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins", &Base::s_info, &JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTable, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins) };
+
+JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>&& impl)
+    : JSDOMWrapper<TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::create(vm, &globalObject, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>(vm, globalObject);
+}
+
+JSValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::destroy(JSC::JSCell* cell)
+{
+    JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins* thisObject = static_cast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell);
+    thisObject->JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::~JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins();
+}
+
+bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
+        return true;
+    return false;
+}
+
+bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Identifier propertyName = Identifier::from(state, index);
+    if (thisObject->classInfo() == info()) {
+        auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
+        if (!IDLDOMString::isNullValue(item)) {
+            slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
+            return true;
+        }
+    }
+    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
+}
+
+void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
+        propertyNames.add(Identifier::fromString(state, propertyName));
+    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
+}
+
+bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto nativeValue = convert<IDLDOMString>(*state, value);
+        RETURN_IF_EXCEPTION(throwScope, true);
+        thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+        return true;
+    }
+
+    return Base::put(thisObject, state, propertyName, value, putPropertySlot);
+}
+
+bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Identifier propertyName = Identifier::from(state, index);
+    auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+    auto nativeValue = convert<IDLDOMString>(*state, value);
+    RETURN_IF_EXCEPTION(throwScope, true);
+    thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+    return true;
+}
+
+bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
+{
+    auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (!propertyName.isSymbol()) {
+static bool isUnforgeablePropertyName(PropertyName propertyName)
+{
+    return propertyName == "unforgeableAttribute" || propertyName == "unforgeableOperation";
+}
+
+        if (!isUnforgeablePropertyName(propertyName)) {
+            if (!propertyDescriptor.isDataDescriptor())
+                return false;
+            auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+            auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
+            RETURN_IF_EXCEPTION(throwScope, true);
+            thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
+            return true;
+        }
+    }
+
+&n