Title: [266649] trunk/Source/WebCore
Revision
266649
Author
[email protected]
Date
2020-09-04 17:19:43 -0700 (Fri, 04 Sep 2020)

Log Message

[WebIDL] Adopt LegacyFactoryFunction extended attribute in lieu of NamedConstructor
https://bugs.webkit.org/show_bug.cgi?id=213316

Reviewed by Darin Adler.

Rename the following the extended attributes to more closely align with WebIDL:
    NamedConstructor -> LegacyFactoryFunction
    ConstructorCallWith -> LegacyFactoryFunctionCallWith
    ConstructorEnabledBySetting -> LegacyFactoryFunctionEnabledBySetting
    ConstructorMayThrowException -> LegacyFactoryFunctionMayThrowException

Note, ConstructorCallWith, ConstructorEnabledBySetting and ConstructorMayThrowException
were only used with NamedConstructors previously as normal constructors don't require
interface level extended attributes for these as the extended attribute can be directly
on the constructor itself. Ideally, we would do the same with LegacyFactoryFunction by
allowing extended attributes on the operator itself like:

[
    ...
    LegacyFactoryFunction=[CallWith=Document] Audio(optional [AtomString] DOMString src)
]

but this requires changes to the IDLParser (which are straightforward) and creates a lot of
additional complexity inside the very hacky preprocess-idls.pl reproducing those parser changes.
I will leave that additional cleanup for a subsequent change.

* html/HTMLAudioElement.idl:
* html/HTMLImageElement.idl:
* html/HTMLOptionElement.idl:
* html/track/TextTrackCue.idl:
Update to use new names.

* bindings/js/JSDOMLegacyFactoryFunction.h: Copied from bindings/js/JSDOMNamedConstructor.h.
* bindings/js/JSDOMNamedConstructor.h: Removed.
* WebCore.xcodeproj/project.pbxproj:
Update for rename of JSDOMNamedConstructor.h to JSDOMLegacyFactoryFunction.h

* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/IDLParser.pm:
(applyExtendedAttributeList):
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
Update IDL processing to handle new names.

* bindings/scripts/IDLAttributes.json:
Update extended attribute definitions for new names. Removed unused Constructor extended attribute.

* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: Copied from bindings/scripts/test/JS/JSTestNamedConstructor.cpp.
* bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h: Copied from bindings/scripts/test/JS/JSTestNamedConstructor.h.
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Removed.
* bindings/scripts/test/JS/JSTestNamedConstructor.h: Removed.
* bindings/scripts/test/SupplementalDependencies.dep:
* bindings/scripts/test/TestLegacyFactoryFunction.idl: Copied from bindings/scripts/test/TestNamedConstructor.idl.
* bindings/scripts/test/TestNamedConstructor.idl: Removed.
Update tests for new names.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (266648 => 266649)


--- trunk/Source/WebCore/ChangeLog	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/ChangeLog	2020-09-05 00:19:43 UTC (rev 266649)
@@ -1,3 +1,62 @@
+2020-09-04  Sam Weinig  <[email protected]>
+
+        [WebIDL] Adopt LegacyFactoryFunction extended attribute in lieu of NamedConstructor
+        https://bugs.webkit.org/show_bug.cgi?id=213316
+
+        Reviewed by Darin Adler.
+
+        Rename the following the extended attributes to more closely align with WebIDL:
+            NamedConstructor -> LegacyFactoryFunction
+            ConstructorCallWith -> LegacyFactoryFunctionCallWith
+            ConstructorEnabledBySetting -> LegacyFactoryFunctionEnabledBySetting
+            ConstructorMayThrowException -> LegacyFactoryFunctionMayThrowException
+
+        Note, ConstructorCallWith, ConstructorEnabledBySetting and ConstructorMayThrowException
+        were only used with NamedConstructors previously as normal constructors don't require
+        interface level extended attributes for these as the extended attribute can be directly
+        on the constructor itself. Ideally, we would do the same with LegacyFactoryFunction by
+        allowing extended attributes on the operator itself like:
+        
+        [
+            ...
+            LegacyFactoryFunction=[CallWith=Document] Audio(optional [AtomString] DOMString src)
+        ]
+
+        but this requires changes to the IDLParser (which are straightforward) and creates a lot of
+        additional complexity inside the very hacky preprocess-idls.pl reproducing those parser changes.
+        I will leave that additional cleanup for a subsequent change. 
+
+        * html/HTMLAudioElement.idl:
+        * html/HTMLImageElement.idl:
+        * html/HTMLOptionElement.idl:
+        * html/track/TextTrackCue.idl:
+        Update to use new names.
+
+        * bindings/js/JSDOMLegacyFactoryFunction.h: Copied from bindings/js/JSDOMNamedConstructor.h.
+        * bindings/js/JSDOMNamedConstructor.h: Removed.
+        * WebCore.xcodeproj/project.pbxproj:
+        Update for rename of JSDOMNamedConstructor.h to JSDOMLegacyFactoryFunction.h
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/IDLParser.pm:
+        (applyExtendedAttributeList):
+        * bindings/scripts/preprocess-idls.pl:
+        (GenerateConstructorAttributes):
+        Update IDL processing to handle new names.
+        
+        * bindings/scripts/IDLAttributes.json:
+        Update extended attribute definitions for new names. Removed unused Constructor extended attribute.
+
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: Copied from bindings/scripts/test/JS/JSTestNamedConstructor.cpp.
+        * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h: Copied from bindings/scripts/test/JS/JSTestNamedConstructor.h.
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Removed.
+        * bindings/scripts/test/JS/JSTestNamedConstructor.h: Removed.
+        * bindings/scripts/test/SupplementalDependencies.dep:
+        * bindings/scripts/test/TestLegacyFactoryFunction.idl: Copied from bindings/scripts/test/TestNamedConstructor.idl.
+        * bindings/scripts/test/TestNamedConstructor.idl: Removed.
+        Update tests for new names.
+
 2020-09-04  Chris Dumez  <[email protected]>
 
         Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (266648 => 266649)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-09-05 00:19:43 UTC (rev 266649)
@@ -10043,7 +10043,7 @@
 		7C0CEF291E4A54D3008DEB80 /* JSDOMConstructorWithDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMConstructorWithDocument.h; sourceTree = "<group>"; };
 		7C0CEF2A1E4A556C008DEB80 /* JSDOMBuiltinConstructorBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMBuiltinConstructorBase.h; sourceTree = "<group>"; };
 		7C0CEF2B1E4A55C3008DEB80 /* JSDOMConstructorNotConstructable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMConstructorNotConstructable.h; sourceTree = "<group>"; };
-		7C0CEF2C1E4A564D008DEB80 /* JSDOMNamedConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMNamedConstructor.h; sourceTree = "<group>"; };
+		7C0CEF2C1E4A564D008DEB80 /* JSDOMLegacyFactoryFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMLegacyFactoryFunction.h; sourceTree = "<group>"; };
 		7C0CEF2D1E4A56C5008DEB80 /* JSDOMBuiltinConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMBuiltinConstructor.h; sourceTree = "<group>"; };
 		7C0CEF2E1E4A5832008DEB80 /* JSDOMBuiltinConstructorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMBuiltinConstructorBase.cpp; sourceTree = "<group>"; };
 		7C0CEF2F1E4A58AD008DEB80 /* JSDOMConstructorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMConstructorBase.cpp; sourceTree = "<group>"; };
@@ -26744,7 +26744,7 @@
 				7C0CEF2B1E4A55C3008DEB80 /* JSDOMConstructorNotConstructable.h */,
 				7C0CEF301E4A58F1008DEB80 /* JSDOMConstructorWithDocument.cpp */,
 				7C0CEF291E4A54D3008DEB80 /* JSDOMConstructorWithDocument.h */,
-				7C0CEF2C1E4A564D008DEB80 /* JSDOMNamedConstructor.h */,
+				7C0CEF2C1E4A564D008DEB80 /* JSDOMLegacyFactoryFunction.h */,
 			);
 			name = Constructors;
 			sourceTree = "<group>";

Copied: trunk/Source/WebCore/bindings/js/JSDOMLegacyFactoryFunction.h (from rev 266648, trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h) (0 => 266649)


--- trunk/Source/WebCore/bindings/js/JSDOMLegacyFactoryFunction.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMLegacyFactoryFunction.h	2020-09-05 00:19:43 UTC (rev 266649)
@@ -0,0 +1,81 @@
+/*
+ *  Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ *  Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include "JSDOMConstructorWithDocument.h"
+
+namespace WebCore {
+
+// FIMXE: Why can't LegacyFactoryFunctions be used with workers?
+template<typename JSClass> class JSDOMLegacyFactoryFunction final : public JSDOMConstructorWithDocument {
+public:
+    using Base = JSDOMConstructorWithDocument;
+
+    static JSDOMLegacyFactoryFunction* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
+    static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
+
+    DECLARE_INFO;
+
+    // Must be defined for each specialization class.
+    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
+
+private:
+    JSDOMLegacyFactoryFunction(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+        : Base(structure, globalObject)
+    { 
+    }
+
+    void finishCreation(JSC::VM&, JSDOMGlobalObject&);
+    static JSC::CallData getConstructData(JSC::JSCell*);
+
+    // Usually defined for each specialization class.
+    void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
+    // Must be defined for each specialization class.
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::JSGlobalObject*, JSC::CallFrame*);
+};
+
+template<typename JSClass> inline JSDOMLegacyFactoryFunction<JSClass>* JSDOMLegacyFactoryFunction<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+{
+    JSDOMLegacyFactoryFunction* constructor = new (NotNull, JSC::allocateCell<JSDOMLegacyFactoryFunction>(vm.heap)) JSDOMLegacyFactoryFunction(structure, globalObject);
+    constructor->finishCreation(vm, globalObject);
+    return constructor;
+}
+
+template<typename JSClass> inline JSC::Structure* JSDOMLegacyFactoryFunction<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
+{
+    return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+}
+
+template<typename JSClass> inline void JSDOMLegacyFactoryFunction<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
+{
+    Base::finishCreation(globalObject);
+    ASSERT(inherits(vm, info()));
+    initializeProperties(vm, globalObject);
+}
+
+template<typename JSClass> inline JSC::CallData JSDOMLegacyFactoryFunction<JSClass>::getConstructData(JSC::JSCell*)
+{
+    JSC::CallData constructData;
+    constructData.type = JSC::CallData::Type::Native;
+    constructData.native.function = construct;
+    return constructData;
+}
+
+} // namespace WebCore

Deleted: trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h (266648 => 266649)


--- trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h	2020-09-05 00:19:43 UTC (rev 266649)
@@ -1,81 +0,0 @@
-/*
- *  Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
- *  Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#pragma once
-
-#include "JSDOMConstructorWithDocument.h"
-
-namespace WebCore {
-
-// FIMXE: Why can't named constructors be used with workers?
-template<typename JSClass> class JSDOMNamedConstructor final : public JSDOMConstructorWithDocument {
-public:
-    using Base = JSDOMConstructorWithDocument;
-
-    static JSDOMNamedConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
-    static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
-
-    DECLARE_INFO;
-
-    // Must be defined for each specialization class.
-    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
-
-private:
-    JSDOMNamedConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
-        : Base(structure, globalObject)
-    { 
-    }
-
-    void finishCreation(JSC::VM&, JSDOMGlobalObject&);
-    static JSC::CallData getConstructData(JSC::JSCell*);
-
-    // Usually defined for each specialization class.
-    void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
-    // Must be defined for each specialization class.
-    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::JSGlobalObject*, JSC::CallFrame*);
-};
-
-template<typename JSClass> inline JSDOMNamedConstructor<JSClass>* JSDOMNamedConstructor<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
-{
-    JSDOMNamedConstructor* constructor = new (NotNull, JSC::allocateCell<JSDOMNamedConstructor>(vm.heap)) JSDOMNamedConstructor(structure, globalObject);
-    constructor->finishCreation(vm, globalObject);
-    return constructor;
-}
-
-template<typename JSClass> inline JSC::Structure* JSDOMNamedConstructor<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
-{
-    return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-}
-
-template<typename JSClass> inline void JSDOMNamedConstructor<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
-{
-    Base::finishCreation(globalObject);
-    ASSERT(inherits(vm, info()));
-    initializeProperties(vm, globalObject);
-}
-
-template<typename JSClass> inline JSC::CallData JSDOMNamedConstructor<JSClass>::getConstructData(JSC::JSCell*)
-{
-    JSC::CallData constructData;
-    constructData.type = JSC::CallData::Type::Native;
-    constructData.native.function = construct;
-    return constructData;
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2020-09-05 00:19:43 UTC (rev 266649)
@@ -2777,7 +2777,7 @@
     # Constructor object getter
     unless ($interface->extendedAttributes->{NoInterfaceObject}) {
         push(@headerContent, "    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n");
-        push(@headerContent, "    static JSC::JSValue getNamedConstructor(JSC::VM&, JSC::JSGlobalObject*);\n") if $interface->extendedAttributes->{NamedConstructor};
+        push(@headerContent, "    static JSC::JSValue getLegacyFactoryFunction(JSC::VM&, JSC::JSGlobalObject*);\n") if $interface->extendedAttributes->{LegacyFactoryFunction};
     }
 
     # Serializer function.
@@ -3862,10 +3862,10 @@
         push(@conjuncts,  "${name}::enabledForContext(" . $contextRef . ")");
     }
 
-    if ($context->extendedAttributes->{ConstructorEnabledBySetting}) {
-        assert("Must specify value for ConstructorEnabledBySetting.") if $context->extendedAttributes->{ConstructorEnabledBySetting} eq "VALUE_IS_MISSING";
+    if ($context->extendedAttributes->{LegacyFactoryFunctionEnabledBySetting}) {
+        assert("Must specify value for LegacyFactoryFunctionEnabledBySetting.") if $context->extendedAttributes->{LegacyFactoryFunctionEnabledBySetting} eq "VALUE_IS_MISSING";
 
-        my @settings = split(/&/, $context->extendedAttributes->{ConstructorEnabledBySetting});
+        my @settings = split(/&/, $context->extendedAttributes->{LegacyFactoryFunctionEnabledBySetting});
         foreach my $setting (@settings) {
             push(@conjuncts, "downcast<Document>(jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext())->settings()." . ToMethodName($setting) . "Enabled()");
         }
@@ -4256,8 +4256,8 @@
         my $protoClassName = "${className}Prototype";
         GenerateConstructorDefinitions(\@implContent, $className, $protoClassName, $visibleInterfaceName, $interface);
 
-        my $namedConstructor = $interface->extendedAttributes->{NamedConstructor};
-        GenerateConstructorDefinitions(\@implContent, $className, $protoClassName, $namedConstructor, $interface, "GeneratingNamedConstructor") if $namedConstructor;
+        my $legacyFactoryFunction = $interface->extendedAttributes->{LegacyFactoryFunction};
+        GenerateConstructorDefinitions(\@implContent, $className, $protoClassName, $legacyFactoryFunction, $interface, "GeneratingLegacyFactoryFunction") if $legacyFactoryFunction;
     }
 
     # - Add functions and constants to a hashtable definition
@@ -4549,10 +4549,10 @@
         push(@implContent, "    return getDOMConstructor<${className}Constructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));\n");
         push(@implContent, "}\n\n");
 
-        if ($interface->extendedAttributes->{NamedConstructor}) {
-            push(@implContent, "JSValue ${className}::getNamedConstructor(VM& vm, JSGlobalObject* globalObject)\n");
+        if ($interface->extendedAttributes->{LegacyFactoryFunction}) {
+            push(@implContent, "JSValue ${className}::getLegacyFactoryFunction(VM& vm, JSGlobalObject* globalObject)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    return getDOMConstructor<${className}NamedConstructor>(vm, *jsCast<JSDOMGlobalObject*>(globalObject));\n");
+            push(@implContent, "    return getDOMConstructor<${className}LegacyFactoryFunction>(vm, *jsCast<JSDOMGlobalObject*>(globalObject));\n");
             push(@implContent, "}\n\n");
         }
     }
@@ -5022,17 +5022,21 @@
         my $eventName = EventHandlerAttributeEventName($attribute);
         push(@$outputArray, "    return $getter(thisObject.wrapped(), $eventName, worldForDOMObject(thisObject));\n");
     } elsif ($isConstructor) {
+        # FIXME: This should be switched to using an extended attribute rather than infering this information from name.
         my $constructorType = $attribute->type->name;
+        my $constructorGetter = ($constructorType =~ /LegacyFactoryFunctionConstructor$/) ? "getLegacyFactoryFunction" : "getConstructor";
+
+        # Strip off any trailing "Constructor" or "LegacyFactoryFunctionConstructor" to get the real type.
         $constructorType =~ s/Constructor$//;
+        $constructorType =~ s/LegacyFactoryFunction$//;
+
         # When Constructor attribute is used by DOMWindow.idl, it's correct to pass thisObject as the global object
         # When JSDOMWrappers have a back-pointer to the globalObject we can pass thisObject->globalObject()
         if ($interface->type->name eq "DOMWindow") {
-            my $named = ($constructorType =~ /Named$/) ? "Named" : "";
-            $constructorType =~ s/Named$//;
-            push(@$outputArray, "    return JS" . $constructorType . "::get${named}Constructor(JSC::getVM(&lexicalGlobalObject), &thisObject);\n");
+            push(@$outputArray, "    return JS" . $constructorType . "::${constructorGetter}(JSC::getVM(&lexicalGlobalObject), &thisObject);\n");
         } else {
             AddToImplIncludes("JS" . $constructorType . ".h", $conditional);
-            push(@$outputArray, "    return JS" . $constructorType . "::getConstructor(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());\n");
+            push(@$outputArray, "    return JS" . $constructorType . "::${constructorGetter}(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());\n");
         }
     } else {
         if ($attribute->extendedAttributes->{CachedAttribute}) {
@@ -5181,10 +5185,10 @@
     } elsif ($isConstructor) {
         my $constructorType = $attribute->type->name;
         $constructorType =~ s/Constructor$//;
-        # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
-        # We do not generate the header file for NamedConstructor of class XXXX,
-        # since we generate the NamedConstructor declaration into the header file of class XXXX.
-        if ($constructorType ne "any" and $constructorType !~ /Named$/) {
+        # $constructorType ~= /LegacyFactoryFunction$/ indicates that it is LegacyFactoryFunction.
+        # We do not generate the header file for LegacyFactoryFunction of class XXXX,
+        # since we generate the LegacyFactoryFunction declaration into the header file of class XXXX.
+        if ($constructorType ne "any" and $constructorType !~ /LegacyFactoryFunction$/) {
             AddToImplIncludes("JS" . $constructorType . ".h", $conditional);
         }
         my $id = $attribute->name;
@@ -5932,7 +5936,7 @@
     } else {
         $quotedFunctionName = "nullptr";
         unless ($callWith) {
-            $callWith = $operation->extendedAttributes->{ConstructorCallWith};
+            $callWith = $operation->extendedAttributes->{LegacyFactoryFunctionCallWith};
         }
         push(@arguments, GenerateConstructorCallWithUsingPointers($callWith, \@$outputArray, $visibleInterfaceName, "*castedThis"));
     }
@@ -7413,7 +7417,7 @@
 {
     my $interface = shift;
     return "JSDOMBuiltinConstructor" if HasJSBuiltinConstructor($interface);
-    return "JSDOMConstructorNotConstructable" if $interface->extendedAttributes->{NamedConstructor};
+    return "JSDOMConstructorNotConstructable" if $interface->extendedAttributes->{LegacyFactoryFunction};
     return "JSDOMConstructorNotConstructable" unless IsConstructable($interface);
     return "JSDOMConstructor";
 }
@@ -7427,22 +7431,22 @@
     my $templateClassName = GetConstructorTemplateClassName($interface);
 
     AddToImplIncludes("${templateClassName}.h");
-    AddToImplIncludes("JSDOMNamedConstructor.h") if $interface->extendedAttributes->{NamedConstructor};
+    AddToImplIncludes("JSDOMLegacyFactoryFunction.h") if $interface->extendedAttributes->{LegacyFactoryFunction};
 
     push(@$outputArray, "using $constructorClassName = $templateClassName<$className>;\n");
-    push(@$outputArray, "using JS${interfaceName}NamedConstructor = JSDOMNamedConstructor<$className>;\n") if $interface->extendedAttributes->{NamedConstructor};
+    push(@$outputArray, "using JS${interfaceName}LegacyFactoryFunction = JSDOMLegacyFactoryFunction<$className>;\n") if $interface->extendedAttributes->{LegacyFactoryFunction};
     push(@$outputArray, "\n");
 }
 
 sub GenerateConstructorDefinitions
 {
-    my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor) = @_;
+    my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction) = @_;
 
     if (IsConstructable($interface)) {
         my @constructors = @{$interface->constructors};
         if (@constructors > 1) {
             foreach my $constructor (@constructors) {
-                GenerateConstructorDefinition($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor, $constructor);
+                GenerateConstructorDefinition($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction, $constructor);
             }
 
             my $overloadFunctionPrefix = "construct${className}";
@@ -7457,23 +7461,23 @@
 
             push(@implContent, "}\n\n");
         } elsif (@constructors == 1) {
-            GenerateConstructorDefinition($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor, $constructors[0]);
+            GenerateConstructorDefinition($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction, $constructors[0]);
         } else {
-            GenerateConstructorDefinition($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor);
+            GenerateConstructorDefinition($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction);
         }
     }
 
-    GenerateConstructorHelperMethods($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor);
+    GenerateConstructorHelperMethods($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction);
 }
 
 sub GenerateConstructorDefinition
 {
-    my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor, $operation) = @_;
+    my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction, $operation) = @_;
 
     return if HasJSBuiltinConstructor($interface);
 
     my $interfaceName = $interface->type->name;
-    my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
+    my $constructorClassName = $generatingLegacyFactoryFunction ? "${className}LegacyFactoryFunction" : "${className}Constructor";
 
     if (IsConstructable($interface)) {
         if (HasCustomConstructor($interface)) {
@@ -7482,7 +7486,7 @@
             push(@$outputArray, "    ASSERT(callFrame);\n");
             push(@$outputArray, "    return construct${className}(lexicalGlobalObject, *callFrame);\n");
             push(@$outputArray, "}\n\n");
-         } elsif (!HasCustomConstructor($interface) && (!$interface->extendedAttributes->{NamedConstructor} || $generatingNamedConstructor)) {
+         } elsif (!HasCustomConstructor($interface) && (!$interface->extendedAttributes->{LegacyFactoryFunction} || $generatingLegacyFactoryFunction)) {
             my $isOverloaded = $operation->{overloads} && @{$operation->{overloads}} > 1;
             if ($isOverloaded) {
                 push(@$outputArray, "static inline EncodedJSValue construct${className}$operation->{overloadIndex}(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)\n");
@@ -7506,12 +7510,12 @@
 
             GenerateArgumentsCountCheck($outputArray, $operation, $interface, "    ");
 
-            my $functionImplementationName = $generatingNamedConstructor ? "createForJSConstructor" : "create";
+            my $functionImplementationName = $generatingLegacyFactoryFunction ? "createForJSConstructor" : "create";
             my $functionString = GenerateParametersCheck($outputArray, $operation, $interface, $functionImplementationName, "    ");
 
             push(@$outputArray, "    auto object = ${functionString};\n");
             push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{CallWith}, "ExecState");
-            if ($interface->extendedAttributes->{ConstructorMayThrowException} || $operation->extendedAttributes->{MayThrowException}) {
+            if ($interface->extendedAttributes->{LegacyFactoryFunctionMayThrowException} || $operation->extendedAttributes->{MayThrowException}) {
                 push(@$outputArray, "    static_assert(IsExceptionOr<decltype(object)>::value);\n");
                 push(@$outputArray, "    static_assert(decltype(object)::ReturnType::isRef);\n");
             } else {
@@ -7526,12 +7530,12 @@
             my @constructionConversionArguments = ();
             push(@constructionConversionArguments, "*lexicalGlobalObject");
             push(@constructionConversionArguments, "*castedThis->globalObject()");
-            push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{ConstructorMayThrowException} || $operation->extendedAttributes->{MayThrowException};
+            push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{LegacyFactoryFunctionMayThrowException} || $operation->extendedAttributes->{MayThrowException};
             push(@constructionConversionArguments, "WTFMove(object)");
 
             # FIXME: toJSNewlyCreated should return JSObject* instead of JSValue.
             push(@$outputArray, "    auto jsValue = toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . ");\n");
-            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n") if $interface->extendedAttributes->{ConstructorMayThrowException} || $operation->extendedAttributes->{MayThrowException};
+            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n") if $interface->extendedAttributes->{LegacyFactoryFunctionMayThrowException} || $operation->extendedAttributes->{MayThrowException};
             push(@$outputArray, "    setSubclassStructureIfNeeded<${implType}>(lexicalGlobalObject, callFrame, asObject(jsValue));\n");
             push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n");
             push(@$outputArray, "    return JSValue::encode(jsValue);\n");
@@ -7602,9 +7606,9 @@
 
 sub GenerateConstructorHelperMethods
 {
-    my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor) = @_;
+    my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingLegacyFactoryFunction) = @_;
 
-    my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
+    my $constructorClassName = $generatingLegacyFactoryFunction ? "${className}LegacyFactoryFunction" : "${className}Constructor";
     my $leastConstructorLength = 0;
     if (@{$interface->constructors} > 0) {
         $leastConstructorLength = 255;
@@ -7623,7 +7627,7 @@
 
     assert("An interface cannot inherit from another interface that is marked as [NoInterfaceObject]") if $interface->parentType && $codeGenerator->GetInterfaceExtendedAttributesFromName($interface->parentType->name)->{NoInterfaceObject};
 
-    if (!$generatingNamedConstructor and $interface->parentType) {
+    if (!$generatingLegacyFactoryFunction and $interface->parentType) {
         my $parentClassName = "JS" . $interface->parentType->name;
         push(@$outputArray, "    return ${parentClassName}::getConstructor(vm, &globalObject);\n");
     } else {
@@ -7651,7 +7655,7 @@
     assert("jsNontrivialString() requires strings two or more characters long") if length($visibleInterfaceName) < 2;
     push(@$outputArray, "    putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, \"$visibleInterfaceName\"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);\n");
 
-    if ($interface->extendedAttributes->{ConstructorEnabledBySetting}) {
+    if ($interface->extendedAttributes->{LegacyFactoryFunctionEnabledBySetting}) {
         my $runtimeEnableConditionalString = GenerateRuntimeEnableConditionalString($interface, $interface, "&globalObject");
         push(@$outputArray, "    int constructorLength = ${leastConstructorLength};\n");
         push(@$outputArray, "    if (!${runtimeEnableConditionalString})\n");

Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.json (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.json	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.json	2020-09-05 00:19:43 UTC (rev 266649)
@@ -72,25 +72,6 @@
             "contextsAllowed": ["interface"],
             "values": ["*"]
         },
-        "Constructor": {
-            "contextsAllowed": ["interface"],
-            "standard": {
-                "url": "https://heycam.github.io/webidl/#Constructor"
-            }
-        },
-        "ConstructorCallWith": {
-            "contextsAllowed": ["interface"],
-            "values": ["Document", "ExecState", "RuntimeFlags", "ScriptExecutionContext"],
-            "supportsConjunction": true
-        },
-        "ConstructorEnabledBySetting": {
-            "contextsAllowed": ["attribute", "interface"],
-            "values": ["*"],
-            "supportsConjunction": true
-        },
-        "ConstructorMayThrowException": {
-            "contextsAllowed": ["interface"]
-        },
         "ContextAllowsMediaDevices": {
             "contextsAllowed": ["attribute"]
         },
@@ -296,6 +277,26 @@
         "LegacyCaller": {
             "contextsAllowed": ["operation"]
         },
+        "LegacyFactoryFunction": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#LegacyFactoryFunction"
+            }
+        },
+        "LegacyFactoryFunctionCallWith": {
+            "contextsAllowed": ["interface"],
+            "values": ["Document", "ExecState", "RuntimeFlags", "ScriptExecutionContext"],
+            "supportsConjunction": true
+        },
+        "LegacyFactoryFunctionEnabledBySetting": {
+            "contextsAllowed": ["attribute", "interface"],
+            "values": ["*"],
+            "supportsConjunction": true
+        },
+        "LegacyFactoryFunctionMayThrowException": {
+            "contextsAllowed": ["interface"]
+        },
         "LegacyUnenumerableNamedProperties": {
             "contextsAllowed": ["interface"],
             "standard": {
@@ -328,13 +329,6 @@
         "MayThrowException": {
             "contextsAllowed": ["attribute", "operation"]
         },
-        "NamedConstructor": {
-            "contextsAllowed": ["interface"],
-            "values": ["*"],
-            "standard": {
-                "url": "https://heycam.github.io/webidl/#NamedConstructor"
-            }
-        },
         "NewImpurePropertyFiresWatchpoints": {
             "contextsAllowed": ["interface"]
         },

Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2020-09-05 00:19:43 UTC (rev 266649)
@@ -3278,16 +3278,16 @@
     my $interface = shift;
     my $extendedAttributeList = shift;
 
-    if (defined $extendedAttributeList->{"NamedConstructor"}) {
+    if (defined $extendedAttributeList->{"LegacyFactoryFunction"}) {
         my $newDataNode = IDLOperation->new();
         $newDataNode->isConstructor(1);
-        $newDataNode->name("NamedConstructor");
+        $newDataNode->name("LegacyFactoryFunction");
         $newDataNode->extendedAttributes($extendedAttributeList);
-        my %attributes = %{$extendedAttributeList->{"NamedConstructor"}};
+        my %attributes = %{$extendedAttributeList->{"LegacyFactoryFunction"}};
         my @attributeKeys = keys (%attributes);
         my $constructorName = $attributeKeys[0];
         push(@{$newDataNode->arguments}, @{$attributes{$constructorName}});
-        $extendedAttributeList->{"NamedConstructor"} = $constructorName;
+        $extendedAttributeList->{"LegacyFactoryFunction"} = $constructorName;
         push(@{$interface->constructors}, $newDataNode);
     }
     

Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -312,7 +312,7 @@
       next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledForWorld"
         || $attributeName eq "EnabledBySetting" || $attributeName eq "SecureContext" || $attributeName eq "PrivateIdentifier"
         || $attributeName eq "PublicIdentifier" || $attributeName eq "DisabledByQuirk" || $attributeName eq "EnabledByQuirk"
-        || $attributeName eq "EnabledForContext" || $attributeName eq "CustomEnabled") || $attributeName eq "ConstructorEnabledBySetting";
+        || $attributeName eq "EnabledForContext" || $attributeName eq "CustomEnabled") || $attributeName eq "LegacyFactoryFunctionEnabledBySetting";
       my $extendedAttribute = $attributeName;
       $extendedAttribute .= "=" . $extendedAttributes->{$attributeName} unless $extendedAttributes->{$attributeName} eq "VALUE_IS_MISSING";
       push(@extendedAttributesList, $extendedAttribute);
@@ -323,14 +323,14 @@
     $interfaceName = $extendedAttributes->{"InterfaceName"} if $extendedAttributes->{"InterfaceName"};
     $code .= "attribute " . $originalInterfaceName . "Constructor $interfaceName;\n";
 
-    # In addition to the regular property, for every [NamedConstructor] extended attribute on an interface,
+    # In addition to the regular property, for every [LegacyFactoryFunction] extended attribute on an interface,
     # a corresponding property MUST exist on the ECMAScript global object.
-    if ($extendedAttributes->{"NamedConstructor"}) {
-        my $constructorName = $extendedAttributes->{"NamedConstructor"};
+    if ($extendedAttributes->{"LegacyFactoryFunction"}) {
+        my $constructorName = $extendedAttributes->{"LegacyFactoryFunction"};
         $constructorName =~ s/\(.*//g; # Extract function name.
         $code .= "    ";
         $code .= "[" . join(', ', @extendedAttributesList) . "] " if @extendedAttributesList;
-        $code .= "attribute " . $originalInterfaceName . "NamedConstructor $constructorName;\n";
+        $code .= "attribute " . $originalInterfaceName . "LegacyFactoryFunctionConstructor $constructorName;\n";
     }
     
     my $windowAliasesCode;

Modified: trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -24,12 +24,12 @@
     attribute TestInterfaceLeadingUnderscoreConstructor TestInterfaceLeadingUnderscore;
     attribute TestIterableConstructor TestIterable;
     attribute TestJSBuiltinConstructorConstructor TestJSBuiltinConstructor;
+    attribute TestLegacyFactoryFunctionConstructor TestLegacyFactoryFunction;
+    attribute TestLegacyFactoryFunctionLegacyFactoryFunctionConstructor Audio;
     attribute TestMapLikeConstructor TestMapLike;
     attribute TestNamedAndIndexedSetterNoIdentifierConstructor TestNamedAndIndexedSetterNoIdentifier;
     attribute TestNamedAndIndexedSetterThrowingExceptionConstructor TestNamedAndIndexedSetterThrowingException;
     attribute TestNamedAndIndexedSetterWithIdentifierConstructor TestNamedAndIndexedSetterWithIdentifier;
-    attribute TestNamedConstructorConstructor TestNamedConstructor;
-    attribute TestNamedConstructorNamedConstructor Audio;
     attribute TestNamedDeleterNoIdentifierConstructor TestNamedDeleterNoIdentifier;
     attribute TestNamedDeleterThrowingExceptionConstructor TestNamedDeleterThrowingException;
     attribute TestNamedDeleterWithIdentifierConstructor TestNamedDeleterWithIdentifier;

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp	2020-09-05 00:19:43 UTC (rev 266649)
@@ -38,6 +38,7 @@
 #include "JSDedicatedWorkerGlobalScope.h"
 #include "JSPaintWorkletGlobalScope.h"
 #include "JSServiceWorkerGlobalScope.h"
+#include "JSTest.h"
 #include "JSTestCEReactions.h"
 #include "JSTestCEReactionsStringifier.h"
 #include "JSTestCallTracer.h"
@@ -57,12 +58,11 @@
 #include "JSTestInterfaceLeadingUnderscore.h"
 #include "JSTestIterable.h"
 #include "JSTestJSBuiltinConstructor.h"
+#include "JSTestLegacyFactoryFunction.h"
 #include "JSTestMapLike.h"
 #include "JSTestNamedAndIndexedSetterNoIdentifier.h"
 #include "JSTestNamedAndIndexedSetterThrowingException.h"
 #include "JSTestNamedAndIndexedSetterWithIdentifier.h"
-#include "JSTestNamedConstructor.h"
-#include "JSTestNamedConstructorNamed.h"
 #include "JSTestNamedDeleterNoIdentifier.h"
 #include "JSTestNamedDeleterThrowingException.h"
 #include "JSTestNamedDeleterWithIdentifier.h"
@@ -223,6 +223,10 @@
 bool setJSTestGlobalObjectTestIterableConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestGlobalObjectTestJSBuiltinConstructorConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestGlobalObjectTestJSBuiltinConstructorConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestGlobalObjectTestLegacyFactoryFunctionConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestGlobalObjectTestLegacyFactoryFunctionConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestGlobalObjectAudioConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestGlobalObjectAudioConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestGlobalObjectTestMapLikeConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestGlobalObjectTestMapLikeConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
@@ -231,10 +235,6 @@
 bool setJSTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
-JSC::EncodedJSValue jsTestGlobalObjectTestNamedConstructorConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestGlobalObjectTestNamedConstructorConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
-JSC::EncodedJSValue jsTestGlobalObjectAudioConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestGlobalObjectAudioConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestGlobalObjectTestNamedDeleterNoIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestGlobalObjectTestNamedDeleterNoIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestGlobalObjectTestNamedDeleterThrowingExceptionConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
@@ -320,12 +320,12 @@
 
 /* Hash table */
 
-static const struct CompactHashIndex JSTestGlobalObjectTableIndex[268] = {
+static const struct CompactHashIndex JSTestGlobalObjectTableIndex[269] = {
     { -1, -1 },
     { 40, -1 },
     { -1, -1 },
     { 0, -1 },
-    { 8, 263 },
+    { 8, 264 },
     { 44, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -363,7 +363,7 @@
     { -1, -1 },
     { -1, -1 },
     { 71, -1 },
-    { 13, 258 },
+    { 13, 259 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -372,7 +372,7 @@
     { -1, -1 },
     { -1, -1 },
     { 38, -1 },
-    { 20, 264 },
+    { 20, 256 },
     { 10, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -391,7 +391,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 22, 265 },
+    { 22, 266 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -413,7 +413,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 24, 256 },
+    { 24, 257 },
     { -1, -1 },
     { 61, -1 },
     { 19, -1 },
@@ -435,7 +435,7 @@
     { 50, -1 },
     { 25, -1 },
     { -1, -1 },
-    { 2, 267 },
+    { 2, 268 },
     { 37, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -452,9 +452,9 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 31, -1 },
     { -1, -1 },
     { -1, -1 },
+    { -1, -1 },
     { 42, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -483,8 +483,8 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 32, -1 },
-    { 29, 262 },
+    { 28, -1 },
+    { 31, 263 },
     { -1, -1 },
     { 5, -1 },
     { -1, -1 },
@@ -494,7 +494,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 16, 257 },
+    { 16, 258 },
     { -1, -1 },
     { 62, -1 },
     { -1, -1 },
@@ -505,7 +505,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 33, 266 },
+    { 33, 267 },
     { -1, -1 },
     { 17, -1 },
     { -1, -1 },
@@ -550,8 +550,8 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 48, 261 },
-    { 11, 260 },
+    { 48, 262 },
+    { 11, 261 },
     { -1, -1 },
     { 63, -1 },
     { -1, -1 },
@@ -565,7 +565,7 @@
     { 26, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 28, -1 },
+    { 30, -1 },
     { -1, -1 },
     { -1, -1 },
     { 45, -1 },
@@ -577,8 +577,9 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 27, 259 },
-    { 30, -1 },
+    { 27, 265 },
+    { 29, 260 },
+    { 32, -1 },
     { 39, -1 },
     { 41, -1 },
     { 43, -1 },
@@ -633,12 +634,12 @@
     { "TestInterfaceLeadingUnderscore", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestInterfaceLeadingUnderscoreConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestInterfaceLeadingUnderscoreConstructor) } },
     { "TestIterable", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestIterableConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestIterableConstructor) } },
     { "TestJSBuiltinConstructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestJSBuiltinConstructorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestJSBuiltinConstructorConstructor) } },
+    { "TestLegacyFactoryFunction", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestLegacyFactoryFunctionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestLegacyFactoryFunctionConstructor) } },
+    { "Audio", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectAudioConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectAudioConstructor) } },
     { "TestMapLike", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestMapLikeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestMapLikeConstructor) } },
     { "TestNamedAndIndexedSetterNoIdentifier", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructor) } },
     { "TestNamedAndIndexedSetterThrowingException", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructor) } },
     { "TestNamedAndIndexedSetterWithIdentifier", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructor) } },
-    { "TestNamedConstructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedConstructorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedConstructorConstructor) } },
-    { "Audio", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectAudioConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectAudioConstructor) } },
     { "TestNamedDeleterNoIdentifier", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedDeleterNoIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedDeleterNoIdentifierConstructor) } },
     { "TestNamedDeleterThrowingException", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedDeleterThrowingExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedDeleterThrowingExceptionConstructor) } },
     { "TestNamedDeleterWithIdentifier", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectTestNamedDeleterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectTestNamedDeleterWithIdentifierConstructor) } },
@@ -1561,6 +1562,52 @@
     return IDLAttribute<JSTestGlobalObject>::set<setJSTestGlobalObjectTestJSBuiltinConstructorConstructorSetter>(*lexicalGlobalObject, thisValue, encodedValue, "TestJSBuiltinConstructor");
 }
 
+static inline JSValue jsTestGlobalObjectTestLegacyFactoryFunctionConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
+{
+    UNUSED_PARAM(lexicalGlobalObject);
+    return JSTest::getLegacyFactoryFunction(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());
+}
+
+EncodedJSValue jsTestGlobalObjectTestLegacyFactoryFunctionConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
+{
+    return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObjectTestLegacyFactoryFunctionConstructorGetter>(*lexicalGlobalObject, thisValue, "TestLegacyFactoryFunction");
+}
+
+static inline bool setJSTestGlobalObjectTestLegacyFactoryFunctionConstructorSetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject, JSValue value)
+{
+    auto& vm = JSC::getVM(&lexicalGlobalObject);
+    // Shadowing a built-in constructor.
+    return thisObject.putDirect(vm, Identifier::fromString(vm, reinterpret_cast<const LChar*>("TestLegacyFactoryFunction"), strlen("TestLegacyFactoryFunction")), value);
+}
+
+bool setJSTestGlobalObjectTestLegacyFactoryFunctionConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return IDLAttribute<JSTestGlobalObject>::set<setJSTestGlobalObjectTestLegacyFactoryFunctionConstructorSetter>(*lexicalGlobalObject, thisValue, encodedValue, "TestLegacyFactoryFunction");
+}
+
+static inline JSValue jsTestGlobalObjectAudioConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
+{
+    UNUSED_PARAM(lexicalGlobalObject);
+    return JSTestLegacyFactoryFunction::getLegacyFactoryFunction(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());
+}
+
+EncodedJSValue jsTestGlobalObjectAudioConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
+{
+    return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObjectAudioConstructorGetter>(*lexicalGlobalObject, thisValue, "Audio");
+}
+
+static inline bool setJSTestGlobalObjectAudioConstructorSetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject, JSValue value)
+{
+    auto& vm = JSC::getVM(&lexicalGlobalObject);
+    // Shadowing a built-in constructor.
+    return thisObject.putDirect(vm, Identifier::fromString(vm, reinterpret_cast<const LChar*>("Audio"), strlen("Audio")), value);
+}
+
+bool setJSTestGlobalObjectAudioConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return IDLAttribute<JSTestGlobalObject>::set<setJSTestGlobalObjectAudioConstructorSetter>(*lexicalGlobalObject, thisValue, encodedValue, "Audio");
+}
+
 static inline JSValue jsTestGlobalObjectTestMapLikeConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
 {
     UNUSED_PARAM(lexicalGlobalObject);
@@ -1653,52 +1700,6 @@
     return IDLAttribute<JSTestGlobalObject>::set<setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructorSetter>(*lexicalGlobalObject, thisValue, encodedValue, "TestNamedAndIndexedSetterWithIdentifier");
 }
 
-static inline JSValue jsTestGlobalObjectTestNamedConstructorConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
-{
-    UNUSED_PARAM(lexicalGlobalObject);
-    return JSTestNamedConstructor::getConstructor(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());
-}
-
-EncodedJSValue jsTestGlobalObjectTestNamedConstructorConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
-{
-    return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObjectTestNamedConstructorConstructorGetter>(*lexicalGlobalObject, thisValue, "TestNamedConstructor");
-}
-
-static inline bool setJSTestGlobalObjectTestNamedConstructorConstructorSetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject, JSValue value)
-{
-    auto& vm = JSC::getVM(&lexicalGlobalObject);
-    // Shadowing a built-in constructor.
-    return thisObject.putDirect(vm, Identifier::fromString(vm, reinterpret_cast<const LChar*>("TestNamedConstructor"), strlen("TestNamedConstructor")), value);
-}
-
-bool setJSTestGlobalObjectTestNamedConstructorConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
-{
-    return IDLAttribute<JSTestGlobalObject>::set<setJSTestGlobalObjectTestNamedConstructorConstructorSetter>(*lexicalGlobalObject, thisValue, encodedValue, "TestNamedConstructor");
-}
-
-static inline JSValue jsTestGlobalObjectAudioConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
-{
-    UNUSED_PARAM(lexicalGlobalObject);
-    return JSTestNamedConstructorNamed::getConstructor(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());
-}
-
-EncodedJSValue jsTestGlobalObjectAudioConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
-{
-    return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObjectAudioConstructorGetter>(*lexicalGlobalObject, thisValue, "Audio");
-}
-
-static inline bool setJSTestGlobalObjectAudioConstructorSetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject, JSValue value)
-{
-    auto& vm = JSC::getVM(&lexicalGlobalObject);
-    // Shadowing a built-in constructor.
-    return thisObject.putDirect(vm, Identifier::fromString(vm, reinterpret_cast<const LChar*>("Audio"), strlen("Audio")), value);
-}
-
-bool setJSTestGlobalObjectAudioConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
-{
-    return IDLAttribute<JSTestGlobalObject>::set<setJSTestGlobalObjectAudioConstructorSetter>(*lexicalGlobalObject, thisValue, encodedValue, "Audio");
-}
-
 static inline JSValue jsTestGlobalObjectTestNamedDeleterNoIdentifierConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
 {
     UNUSED_PARAM(lexicalGlobalObject);

Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp (0 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp	2020-09-05 00:19:43 UTC (rev 266649)
@@ -0,0 +1,328 @@
+/*
+    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 "JSTestLegacyFactoryFunction.h"
+
+#include "ActiveDOMObject.h"
+#include "DOMIsoSubspaces.h"
+#include "Document.h"
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvertInterface.h"
+#include "JSDOMConvertStrings.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMLegacyFactoryFunction.h"
+#include "JSDOMWrapperCache.h"
+#include "ScriptExecutionContext.h"
+#include "WebCoreJSClientData.h"
+#include <_javascript_Core/FunctionPrototype.h>
+#include <_javascript_Core/HeapAnalyzer.h>
+#include <_javascript_Core/JSCInlines.h>
+#include <_javascript_Core/JSDestructibleObjectHeapCellType.h>
+#include <_javascript_Core/SubspaceInlines.h>
+#include <wtf/GetPtr.h>
+#include <wtf/PointerPreparations.h>
+#include <wtf/URL.h>
+
+
+namespace WebCore {
+using namespace JSC;
+
+// Attributes
+
+JSC::EncodedJSValue jsTestLegacyFactoryFunctionConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestLegacyFactoryFunctionConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestLegacyFactoryFunctionPrototype final : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestLegacyFactoryFunctionPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestLegacyFactoryFunctionPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestLegacyFactoryFunctionPrototype>(vm.heap)) JSTestLegacyFactoryFunctionPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    template<typename CellType, JSC::SubspaceAccess>
+    static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
+    {
+        STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestLegacyFactoryFunctionPrototype, Base);
+        return &vm.plainObjectSpace;
+    }
+    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:
+    JSTestLegacyFactoryFunctionPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestLegacyFactoryFunctionPrototype, JSTestLegacyFactoryFunctionPrototype::Base);
+
+using JSTestLegacyFactoryFunctionConstructor = JSDOMConstructorNotConstructable<JSTestLegacyFactoryFunction>;
+using JSTestLegacyFactoryFunctionLegacyFactoryFunction = JSDOMLegacyFactoryFunction<JSTestLegacyFactoryFunction>;
+
+template<> JSValue JSTestLegacyFactoryFunctionConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestLegacyFactoryFunctionConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestLegacyFactoryFunction::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestLegacyFactoryFunction"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+}
+
+template<> const ClassInfo JSTestLegacyFactoryFunctionConstructor::s_info = { "TestLegacyFactoryFunction", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestLegacyFactoryFunctionConstructor) };
+
+template<> EncodedJSValue JSC_HOST_CALL JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
+{
+    VM& vm = lexicalGlobalObject->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* castedThis = jsCast<JSTestLegacyFactoryFunctionLegacyFactoryFunction*>(callFrame->jsCallee());
+    ASSERT(castedThis);
+    if (UNLIKELY(callFrame->argumentCount() < 1))
+        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
+    auto* context = castedThis->scriptExecutionContext();
+    if (UNLIKELY(!context))
+        return throwConstructorScriptExecutionContextUnavailableError(*lexicalGlobalObject, throwScope, "TestLegacyFactoryFunction");
+    ASSERT(context->isDocument());
+    auto& document = downcast<Document>(*context);
+    EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0);
+    auto str1 = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value());
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    EnsureStillAliveScope argument1 = callFrame->argument(1);
+    auto str2 = argument1.value().isUndefined() ? "defaultString"_s : convert<IDLDOMString>(*lexicalGlobalObject, argument1.value());
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    EnsureStillAliveScope argument2 = callFrame->argument(2);
+    auto str3 = argument2.value().isUndefined() ? String() : convert<IDLDOMString>(*lexicalGlobalObject, argument2.value());
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    auto object = TestLegacyFactoryFunction::createForJSConstructor(document, WTFMove(str1), WTFMove(str2), WTFMove(str3));
+    static_assert(IsExceptionOr<decltype(object)>::value);
+    static_assert(decltype(object)::ReturnType::isRef);
+    auto jsValue = toJSNewlyCreated<IDLInterface<TestLegacyFactoryFunction>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
+    RETURN_IF_EXCEPTION(throwScope, { });
+    setSubclassStructureIfNeeded<TestLegacyFactoryFunction>(lexicalGlobalObject, callFrame, asObject(jsValue));
+    RETURN_IF_EXCEPTION(throwScope, { });
+    return JSValue::encode(jsValue);
+}
+
+template<> JSValue JSTestLegacyFactoryFunctionLegacyFactoryFunction::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template<> void JSTestLegacyFactoryFunctionLegacyFactoryFunction::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestLegacyFactoryFunction::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "Audio"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+}
+
+template<> const ClassInfo JSTestLegacyFactoryFunctionLegacyFactoryFunction::s_info = { "Audio", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestLegacyFactoryFunctionLegacyFactoryFunction) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestLegacyFactoryFunctionPrototypeTableValues[] =
+{
+    { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestLegacyFactoryFunctionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestLegacyFactoryFunctionConstructor) } },
+};
+
+const ClassInfo JSTestLegacyFactoryFunctionPrototype::s_info = { "TestLegacyFactoryFunction", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestLegacyFactoryFunctionPrototype) };
+
+void JSTestLegacyFactoryFunctionPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestLegacyFactoryFunction::info(), JSTestLegacyFactoryFunctionPrototypeTableValues, *this);
+    JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
+}
+
+const ClassInfo JSTestLegacyFactoryFunction::s_info = { "TestLegacyFactoryFunction", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestLegacyFactoryFunction) };
+
+JSTestLegacyFactoryFunction::JSTestLegacyFactoryFunction(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestLegacyFactoryFunction>&& impl)
+    : JSDOMWrapper<TestLegacyFactoryFunction>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestLegacyFactoryFunction::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+    static_assert(std::is_base_of<ActiveDOMObject, TestLegacyFactoryFunction>::value, "Interface is marked as [ActiveDOMObject] but implementation class does not subclass ActiveDOMObject.");
+
+}
+
+JSObject* JSTestLegacyFactoryFunction::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSTestLegacyFactoryFunctionPrototype::create(vm, &globalObject, JSTestLegacyFactoryFunctionPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
+}
+
+JSObject* JSTestLegacyFactoryFunction::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return getDOMPrototype<JSTestLegacyFactoryFunction>(vm, globalObject);
+}
+
+JSValue JSTestLegacyFactoryFunction::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestLegacyFactoryFunctionConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+JSValue JSTestLegacyFactoryFunction::getLegacyFactoryFunction(VM& vm, JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestLegacyFactoryFunctionLegacyFactoryFunction>(vm, *jsCast<JSDOMGlobalObject*>(globalObject));
+}
+
+void JSTestLegacyFactoryFunction::destroy(JSC::JSCell* cell)
+{
+    JSTestLegacyFactoryFunction* thisObject = static_cast<JSTestLegacyFactoryFunction*>(cell);
+    thisObject->JSTestLegacyFactoryFunction::~JSTestLegacyFactoryFunction();
+}
+
+EncodedJSValue jsTestLegacyFactoryFunctionConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = JSC::getVM(lexicalGlobalObject);
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicCast<JSTestLegacyFactoryFunctionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype))
+        return throwVMTypeError(lexicalGlobalObject, throwScope);
+    return JSValue::encode(JSTestLegacyFactoryFunction::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject()));
+}
+
+bool setJSTestLegacyFactoryFunctionConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = JSC::getVM(lexicalGlobalObject);
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto* prototype = jsDynamicCast<JSTestLegacyFactoryFunctionPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!prototype)) {
+        throwVMTypeError(lexicalGlobalObject, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
+}
+
+JSC::IsoSubspace* JSTestLegacyFactoryFunction::subspaceForImpl(JSC::VM& vm)
+{
+    auto& clientData = *static_cast<JSVMClientData*>(vm.clientData);
+    auto& spaces = clientData.subspaces();
+    if (auto* space = spaces.m_subspaceForTestLegacyFactoryFunction.get())
+        return space;
+    static_assert(std::is_base_of_v<JSC::JSDestructibleObject, JSTestLegacyFactoryFunction> || !JSTestLegacyFactoryFunction::needsDestruction);
+    if constexpr (std::is_base_of_v<JSC::JSDestructibleObject, JSTestLegacyFactoryFunction>)
+        spaces.m_subspaceForTestLegacyFactoryFunction = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSTestLegacyFactoryFunction);
+    else
+        spaces.m_subspaceForTestLegacyFactoryFunction = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSTestLegacyFactoryFunction);
+    auto* space = spaces.m_subspaceForTestLegacyFactoryFunction.get();
+IGNORE_WARNINGS_BEGIN("unreachable-code")
+IGNORE_WARNINGS_BEGIN("tautological-compare")
+    if (&JSTestLegacyFactoryFunction::visitOutputConstraints != &JSC::JSCell::visitOutputConstraints)
+        clientData.outputConstraintSpaces().append(space);
+IGNORE_WARNINGS_END
+IGNORE_WARNINGS_END
+    return space;
+}
+
+void JSTestLegacyFactoryFunction::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
+{
+    auto* thisObject = jsCast<JSTestLegacyFactoryFunction*>(cell);
+    analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped());
+    if (thisObject->scriptExecutionContext())
+        analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
+    Base::analyzeHeap(cell, analyzer);
+}
+
+bool JSTestLegacyFactoryFunctionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
+{
+    auto* jsTestLegacyFactoryFunction = jsCast<JSTestLegacyFactoryFunction*>(handle.slot()->asCell());
+    auto& wrapped = jsTestLegacyFactoryFunction->wrapped();
+    if (!wrapped.isContextStopped() && wrapped.hasPendingActivity()) {
+        if (UNLIKELY(reason))
+            *reason = "ActiveDOMObject with pending activity";
+        return true;
+     }
+    UNUSED_PARAM(visitor);
+    UNUSED_PARAM(reason);
+    return false;
+}
+
+void JSTestLegacyFactoryFunctionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestLegacyFactoryFunction = static_cast<JSTestLegacyFactoryFunction*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestLegacyFactoryFunction->wrapped(), jsTestLegacyFactoryFunction);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestLegacyFactoryFunction@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore25TestLegacyFactoryFunctionE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestLegacyFactoryFunction>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    const void* actualVTablePointer = getVTablePointer(impl.ptr());
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = __identifier("??_7TestLegacyFactoryFunction@WebCore@@6B@");
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore25TestLegacyFactoryFunctionE[2];
+#endif
+
+    // If this fails TestLegacyFactoryFunction does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(std::is_polymorphic<TestLegacyFactoryFunction>::value, "TestLegacyFactoryFunction is not polymorphic");
+
+    // If you hit this assertion you either have a use after free bug, or
+    // TestLegacyFactoryFunction has subclasses. If TestLegacyFactoryFunction has subclasses that get passed
+    // to toJS() we currently require TestLegacyFactoryFunction you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper<TestLegacyFactoryFunction>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestLegacyFactoryFunction& impl)
+{
+    return wrap(lexicalGlobalObject, globalObject, impl);
+}
+
+TestLegacyFactoryFunction* JSTestLegacyFactoryFunction::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicCast<JSTestLegacyFactoryFunction*>(vm, value))
+        return &wrapper->wrapped();
+    return nullptr;
+}
+
+}

Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h (from rev 266648, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h) (0 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h	2020-09-05 00:19:43 UTC (rev 266649)
@@ -0,0 +1,94 @@
+/*
+    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 "TestLegacyFactoryFunction.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestLegacyFactoryFunction : public JSDOMWrapper<TestLegacyFactoryFunction> {
+public:
+    using Base = JSDOMWrapper<TestLegacyFactoryFunction>;
+    static JSTestLegacyFactoryFunction* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestLegacyFactoryFunction>&& impl)
+    {
+        JSTestLegacyFactoryFunction* ptr = new (NotNull, JSC::allocateCell<JSTestLegacyFactoryFunction>(globalObject->vm().heap)) JSTestLegacyFactoryFunction(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 TestLegacyFactoryFunction* toWrapped(JSC::VM&, JSC::JSValue);
+    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(), JSC::NonArray);
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSC::JSValue getLegacyFactoryFunction(JSC::VM&, JSC::JSGlobalObject*);
+    template<typename, JSC::SubspaceAccess mode> static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
+    {
+        if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+            return nullptr;
+        return subspaceForImpl(vm);
+    }
+    static JSC::IsoSubspace* subspaceForImpl(JSC::VM& vm);
+    static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&);
+protected:
+    JSTestLegacyFactoryFunction(JSC::Structure*, JSDOMGlobalObject&, Ref<TestLegacyFactoryFunction>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestLegacyFactoryFunctionOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestLegacyFactoryFunction*)
+{
+    static NeverDestroyed<JSTestLegacyFactoryFunctionOwner> owner;
+    return &owner.get();
+}
+
+inline void* wrapperKey(TestLegacyFactoryFunction* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, TestLegacyFactoryFunction&);
+inline JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestLegacyFactoryFunction* impl) { return impl ? toJS(lexicalGlobalObject, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject*, Ref<TestLegacyFactoryFunction>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, RefPtr<TestLegacyFactoryFunction>&& impl) { return impl ? toJSNewlyCreated(lexicalGlobalObject, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<TestLegacyFactoryFunction> {
+    using WrapperClass = JSTestLegacyFactoryFunction;
+    using ToWrappedReturnType = TestLegacyFactoryFunction*;
+};
+
+} // namespace WebCore

Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp	2020-09-05 00:19:43 UTC (rev 266649)
@@ -1,328 +0,0 @@
-/*
-    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 "JSTestNamedConstructor.h"
-
-#include "ActiveDOMObject.h"
-#include "DOMIsoSubspaces.h"
-#include "Document.h"
-#include "JSDOMBinding.h"
-#include "JSDOMConstructorNotConstructable.h"
-#include "JSDOMConvertInterface.h"
-#include "JSDOMConvertStrings.h"
-#include "JSDOMExceptionHandling.h"
-#include "JSDOMNamedConstructor.h"
-#include "JSDOMWrapperCache.h"
-#include "ScriptExecutionContext.h"
-#include "WebCoreJSClientData.h"
-#include <_javascript_Core/FunctionPrototype.h>
-#include <_javascript_Core/HeapAnalyzer.h>
-#include <_javascript_Core/JSCInlines.h>
-#include <_javascript_Core/JSDestructibleObjectHeapCellType.h>
-#include <_javascript_Core/SubspaceInlines.h>
-#include <wtf/GetPtr.h>
-#include <wtf/PointerPreparations.h>
-#include <wtf/URL.h>
-
-
-namespace WebCore {
-using namespace JSC;
-
-// Attributes
-
-JSC::EncodedJSValue jsTestNamedConstructorConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestNamedConstructorConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
-
-class JSTestNamedConstructorPrototype final : public JSC::JSNonFinalObject {
-public:
-    using Base = JSC::JSNonFinalObject;
-    static JSTestNamedConstructorPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
-    {
-        JSTestNamedConstructorPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedConstructorPrototype>(vm.heap)) JSTestNamedConstructorPrototype(vm, globalObject, structure);
-        ptr->finishCreation(vm);
-        return ptr;
-    }
-
-    DECLARE_INFO;
-    template<typename CellType, JSC::SubspaceAccess>
-    static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
-    {
-        STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestNamedConstructorPrototype, Base);
-        return &vm.plainObjectSpace;
-    }
-    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:
-    JSTestNamedConstructorPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
-        : JSC::JSNonFinalObject(vm, structure)
-    {
-    }
-
-    void finishCreation(JSC::VM&);
-};
-STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestNamedConstructorPrototype, JSTestNamedConstructorPrototype::Base);
-
-using JSTestNamedConstructorConstructor = JSDOMConstructorNotConstructable<JSTestNamedConstructor>;
-using JSTestNamedConstructorNamedConstructor = JSDOMNamedConstructor<JSTestNamedConstructor>;
-
-template<> JSValue JSTestNamedConstructorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
-{
-    UNUSED_PARAM(vm);
-    return globalObject.functionPrototype();
-}
-
-template<> void JSTestNamedConstructorConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    putDirect(vm, vm.propertyNames->prototype, JSTestNamedConstructor::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-    putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestNamedConstructor"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-    putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-}
-
-template<> const ClassInfo JSTestNamedConstructorConstructor::s_info = { "TestNamedConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedConstructorConstructor) };
-
-template<> EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
-{
-    VM& vm = lexicalGlobalObject->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    auto* castedThis = jsCast<JSTestNamedConstructorNamedConstructor*>(callFrame->jsCallee());
-    ASSERT(castedThis);
-    if (UNLIKELY(callFrame->argumentCount() < 1))
-        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
-    auto* context = castedThis->scriptExecutionContext();
-    if (UNLIKELY(!context))
-        return throwConstructorScriptExecutionContextUnavailableError(*lexicalGlobalObject, throwScope, "TestNamedConstructor");
-    ASSERT(context->isDocument());
-    auto& document = downcast<Document>(*context);
-    EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0);
-    auto str1 = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value());
-    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    EnsureStillAliveScope argument1 = callFrame->argument(1);
-    auto str2 = argument1.value().isUndefined() ? "defaultString"_s : convert<IDLDOMString>(*lexicalGlobalObject, argument1.value());
-    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    EnsureStillAliveScope argument2 = callFrame->argument(2);
-    auto str3 = argument2.value().isUndefined() ? String() : convert<IDLDOMString>(*lexicalGlobalObject, argument2.value());
-    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto object = TestNamedConstructor::createForJSConstructor(document, WTFMove(str1), WTFMove(str2), WTFMove(str3));
-    static_assert(IsExceptionOr<decltype(object)>::value);
-    static_assert(decltype(object)::ReturnType::isRef);
-    auto jsValue = toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
-    RETURN_IF_EXCEPTION(throwScope, { });
-    setSubclassStructureIfNeeded<TestNamedConstructor>(lexicalGlobalObject, callFrame, asObject(jsValue));
-    RETURN_IF_EXCEPTION(throwScope, { });
-    return JSValue::encode(jsValue);
-}
-
-template<> JSValue JSTestNamedConstructorNamedConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
-{
-    UNUSED_PARAM(vm);
-    return globalObject.functionPrototype();
-}
-
-template<> void JSTestNamedConstructorNamedConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    putDirect(vm, vm.propertyNames->prototype, JSTestNamedConstructor::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-    putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "Audio"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-    putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-}
-
-template<> const ClassInfo JSTestNamedConstructorNamedConstructor::s_info = { "Audio", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedConstructorNamedConstructor) };
-
-/* Hash table for prototype */
-
-static const HashTableValue JSTestNamedConstructorPrototypeTableValues[] =
-{
-    { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedConstructorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedConstructorConstructor) } },
-};
-
-const ClassInfo JSTestNamedConstructorPrototype::s_info = { "TestNamedConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedConstructorPrototype) };
-
-void JSTestNamedConstructorPrototype::finishCreation(VM& vm)
-{
-    Base::finishCreation(vm);
-    reifyStaticProperties(vm, JSTestNamedConstructor::info(), JSTestNamedConstructorPrototypeTableValues, *this);
-    JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
-}
-
-const ClassInfo JSTestNamedConstructor::s_info = { "TestNamedConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedConstructor) };
-
-JSTestNamedConstructor::JSTestNamedConstructor(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedConstructor>&& impl)
-    : JSDOMWrapper<TestNamedConstructor>(structure, globalObject, WTFMove(impl))
-{
-}
-
-void JSTestNamedConstructor::finishCreation(VM& vm)
-{
-    Base::finishCreation(vm);
-    ASSERT(inherits(vm, info()));
-
-    static_assert(std::is_base_of<ActiveDOMObject, TestNamedConstructor>::value, "Interface is marked as [ActiveDOMObject] but implementation class does not subclass ActiveDOMObject.");
-
-}
-
-JSObject* JSTestNamedConstructor::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return JSTestNamedConstructorPrototype::create(vm, &globalObject, JSTestNamedConstructorPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
-}
-
-JSObject* JSTestNamedConstructor::prototype(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return getDOMPrototype<JSTestNamedConstructor>(vm, globalObject);
-}
-
-JSValue JSTestNamedConstructor::getConstructor(VM& vm, const JSGlobalObject* globalObject)
-{
-    return getDOMConstructor<JSTestNamedConstructorConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
-}
-
-JSValue JSTestNamedConstructor::getNamedConstructor(VM& vm, JSGlobalObject* globalObject)
-{
-    return getDOMConstructor<JSTestNamedConstructorNamedConstructor>(vm, *jsCast<JSDOMGlobalObject*>(globalObject));
-}
-
-void JSTestNamedConstructor::destroy(JSC::JSCell* cell)
-{
-    JSTestNamedConstructor* thisObject = static_cast<JSTestNamedConstructor*>(cell);
-    thisObject->JSTestNamedConstructor::~JSTestNamedConstructor();
-}
-
-EncodedJSValue jsTestNamedConstructorConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
-{
-    VM& vm = JSC::getVM(lexicalGlobalObject);
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    auto* prototype = jsDynamicCast<JSTestNamedConstructorPrototype*>(vm, JSValue::decode(thisValue));
-    if (UNLIKELY(!prototype))
-        return throwVMTypeError(lexicalGlobalObject, throwScope);
-    return JSValue::encode(JSTestNamedConstructor::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject()));
-}
-
-bool setJSTestNamedConstructorConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
-{
-    VM& vm = JSC::getVM(lexicalGlobalObject);
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    auto* prototype = jsDynamicCast<JSTestNamedConstructorPrototype*>(vm, JSValue::decode(thisValue));
-    if (UNLIKELY(!prototype)) {
-        throwVMTypeError(lexicalGlobalObject, throwScope);
-        return false;
-    }
-    // Shadowing a built-in constructor
-    return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
-}
-
-JSC::IsoSubspace* JSTestNamedConstructor::subspaceForImpl(JSC::VM& vm)
-{
-    auto& clientData = *static_cast<JSVMClientData*>(vm.clientData);
-    auto& spaces = clientData.subspaces();
-    if (auto* space = spaces.m_subspaceForTestNamedConstructor.get())
-        return space;
-    static_assert(std::is_base_of_v<JSC::JSDestructibleObject, JSTestNamedConstructor> || !JSTestNamedConstructor::needsDestruction);
-    if constexpr (std::is_base_of_v<JSC::JSDestructibleObject, JSTestNamedConstructor>)
-        spaces.m_subspaceForTestNamedConstructor = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSTestNamedConstructor);
-    else
-        spaces.m_subspaceForTestNamedConstructor = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSTestNamedConstructor);
-    auto* space = spaces.m_subspaceForTestNamedConstructor.get();
-IGNORE_WARNINGS_BEGIN("unreachable-code")
-IGNORE_WARNINGS_BEGIN("tautological-compare")
-    if (&JSTestNamedConstructor::visitOutputConstraints != &JSC::JSCell::visitOutputConstraints)
-        clientData.outputConstraintSpaces().append(space);
-IGNORE_WARNINGS_END
-IGNORE_WARNINGS_END
-    return space;
-}
-
-void JSTestNamedConstructor::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
-{
-    auto* thisObject = jsCast<JSTestNamedConstructor*>(cell);
-    analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped());
-    if (thisObject->scriptExecutionContext())
-        analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
-    Base::analyzeHeap(cell, analyzer);
-}
-
-bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
-{
-    auto* jsTestNamedConstructor = jsCast<JSTestNamedConstructor*>(handle.slot()->asCell());
-    auto& wrapped = jsTestNamedConstructor->wrapped();
-    if (!wrapped.isContextStopped() && wrapped.hasPendingActivity()) {
-        if (UNLIKELY(reason))
-            *reason = "ActiveDOMObject with pending activity";
-        return true;
-     }
-    UNUSED_PARAM(visitor);
-    UNUSED_PARAM(reason);
-    return false;
-}
-
-void JSTestNamedConstructorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
-{
-    auto* jsTestNamedConstructor = static_cast<JSTestNamedConstructor*>(handle.slot()->asCell());
-    auto& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, &jsTestNamedConstructor->wrapped(), jsTestNamedConstructor);
-}
-
-#if ENABLE(BINDING_INTEGRITY)
-#if PLATFORM(WIN)
-#pragma warning(disable: 4483)
-extern "C" { extern void (*const __identifier("??_7TestNamedConstructor@WebCore@@6B@")[])(); }
-#else
-extern "C" { extern void* _ZTVN7WebCore20TestNamedConstructorE[]; }
-#endif
-#endif
-
-JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestNamedConstructor>&& impl)
-{
-
-#if ENABLE(BINDING_INTEGRITY)
-    const void* actualVTablePointer = getVTablePointer(impl.ptr());
-#if PLATFORM(WIN)
-    void* expectedVTablePointer = __identifier("??_7TestNamedConstructor@WebCore@@6B@");
-#else
-    void* expectedVTablePointer = &_ZTVN7WebCore20TestNamedConstructorE[2];
-#endif
-
-    // If this fails TestNamedConstructor does not have a vtable, so you need to add the
-    // ImplementationLacksVTable attribute to the interface definition
-    static_assert(std::is_polymorphic<TestNamedConstructor>::value, "TestNamedConstructor is not polymorphic");
-
-    // If you hit this assertion you either have a use after free bug, or
-    // TestNamedConstructor has subclasses. If TestNamedConstructor has subclasses that get passed
-    // to toJS() we currently require TestNamedConstructor you to opt out of binding hardening
-    // by adding the SkipVTableValidation attribute to the interface IDL definition
-    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
-#endif
-    return createWrapper<TestNamedConstructor>(globalObject, WTFMove(impl));
-}
-
-JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestNamedConstructor& impl)
-{
-    return wrap(lexicalGlobalObject, globalObject, impl);
-}
-
-TestNamedConstructor* JSTestNamedConstructor::toWrapped(JSC::VM& vm, JSC::JSValue value)
-{
-    if (auto* wrapper = jsDynamicCast<JSTestNamedConstructor*>(vm, value))
-        return &wrapper->wrapped();
-    return nullptr;
-}
-
-}

Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h	2020-09-05 00:19:43 UTC (rev 266649)
@@ -1,94 +0,0 @@
-/*
-    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 "TestNamedConstructor.h"
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-class JSTestNamedConstructor : public JSDOMWrapper<TestNamedConstructor> {
-public:
-    using Base = JSDOMWrapper<TestNamedConstructor>;
-    static JSTestNamedConstructor* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedConstructor>&& impl)
-    {
-        JSTestNamedConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestNamedConstructor>(globalObject->vm().heap)) JSTestNamedConstructor(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 TestNamedConstructor* toWrapped(JSC::VM&, JSC::JSValue);
-    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(), JSC::NonArray);
-    }
-
-    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
-    static JSC::JSValue getNamedConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    template<typename, JSC::SubspaceAccess mode> static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
-    {
-        if constexpr (mode == JSC::SubspaceAccess::Concurrently)
-            return nullptr;
-        return subspaceForImpl(vm);
-    }
-    static JSC::IsoSubspace* subspaceForImpl(JSC::VM& vm);
-    static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&);
-protected:
-    JSTestNamedConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedConstructor>&&);
-
-    void finishCreation(JSC::VM&);
-};
-
-class JSTestNamedConstructorOwner : public JSC::WeakHandleOwner {
-public:
-    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**);
-    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
-};
-
-inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedConstructor*)
-{
-    static NeverDestroyed<JSTestNamedConstructorOwner> owner;
-    return &owner.get();
-}
-
-inline void* wrapperKey(TestNamedConstructor* wrappableObject)
-{
-    return wrappableObject;
-}
-
-JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, TestNamedConstructor&);
-inline JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestNamedConstructor* impl) { return impl ? toJS(lexicalGlobalObject, globalObject, *impl) : JSC::jsNull(); }
-JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject*, Ref<TestNamedConstructor>&&);
-inline JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, RefPtr<TestNamedConstructor>&& impl) { return impl ? toJSNewlyCreated(lexicalGlobalObject, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
-
-template<> struct JSDOMWrapperConverterTraits<TestNamedConstructor> {
-    using WrapperClass = JSTestNamedConstructor;
-    using ToWrappedReturnType = TestNamedConstructor*;
-};
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep	2020-09-05 00:19:43 UTC (rev 266649)
@@ -110,6 +110,9 @@
 JSTestJSBuiltinConstructor.h: 
 DOMTestJSBuiltinConstructor.h: 
 WebDOMTestJSBuiltinConstructor.h: 
+JSTestLegacyFactoryFunction.h: 
+DOMTestLegacyFactoryFunction.h: 
+WebDOMTestLegacyFactoryFunction.h: 
 JSTestMapLike.h: 
 DOMTestMapLike.h: 
 WebDOMTestMapLike.h: 
@@ -122,9 +125,6 @@
 JSTestNamedAndIndexedSetterWithIdentifier.h: 
 DOMTestNamedAndIndexedSetterWithIdentifier.h: 
 WebDOMTestNamedAndIndexedSetterWithIdentifier.h: 
-JSTestNamedConstructor.h: 
-DOMTestNamedConstructor.h: 
-WebDOMTestNamedConstructor.h: 
 JSTestNamedDeleterNoIdentifier.h: 
 DOMTestNamedDeleterNoIdentifier.h: 
 WebDOMTestNamedDeleterNoIdentifier.h: 

Copied: trunk/Source/WebCore/bindings/scripts/test/TestLegacyFactoryFunction.idl (from rev 266648, trunk/Source/WebCore/bindings/scripts/test/TestNamedConstructor.idl) (0 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/TestLegacyFactoryFunction.idl	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestLegacyFactoryFunction.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, 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 WARRANTIEstrArg, 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.
+ */
+
+// This IDL file is for testing the bindings code generator and for tracking
+// changes in its ouput.
+[
+    ActiveDOMObject,
+    LegacyFactoryFunction=Audio(DOMString str1, optional DOMString str2 = "defaultString", optional DOMString str3),
+    LegacyFactoryFunctionCallWith=Document,
+    LegacyFactoryFunctionMayThrowException
+] interface TestLegacyFactoryFunction {
+};

Deleted: trunk/Source/WebCore/bindings/scripts/test/TestNamedConstructor.idl (266648 => 266649)


--- trunk/Source/WebCore/bindings/scripts/test/TestNamedConstructor.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/bindings/scripts/test/TestNamedConstructor.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary formstrArg, 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 WARRANTIEstrArg, 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.
- */
-
-// This IDL file is for testing the bindings code generator and for tracking
-// changes in its ouput.
-[
-    ActiveDOMObject,
-    NamedConstructor=Audio(DOMString str1, optional DOMString str2 = "defaultString", optional DOMString str3),
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException
-] interface TestNamedConstructor {
-};

Modified: trunk/Source/WebCore/dom/TouchEvent.idl (266648 => 266649)


--- trunk/Source/WebCore/dom/TouchEvent.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/dom/TouchEvent.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -24,9 +24,10 @@
  */
 
 [
-    Conditional=TOUCH_EVENTS,
-    Constructor(DOMString type, optional TouchEventInit eventInitDict),
+    Conditional=TOUCH_EVENTS
 ] interface TouchEvent : UIEvent {
+    constructor(DOMString type, optional TouchEventInit eventInitDict);
+
     readonly attribute TouchList touches;
     readonly attribute TouchList targetTouches;
     readonly attribute TouchList changedTouches;

Modified: trunk/Source/WebCore/html/HTMLAudioElement.idl (266648 => 266649)


--- trunk/Source/WebCore/html/HTMLAudioElement.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/html/HTMLAudioElement.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -25,7 +25,7 @@
 
 [
     Conditional=VIDEO,
-    ConstructorCallWith=Document,
-    NamedConstructor=Audio(optional [AtomString] DOMString src)
+    LegacyFactoryFunctionCallWith=Document,
+    LegacyFactoryFunction=Audio(optional [AtomString] DOMString src)
 ] interface HTMLAudioElement : HTMLMediaElement {
 };

Modified: trunk/Source/WebCore/html/HTMLImageElement.idl (266648 => 266649)


--- trunk/Source/WebCore/html/HTMLImageElement.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/html/HTMLImageElement.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -21,8 +21,8 @@
 [
     ExportMacro=WEBCORE_EXPORT,
     JSGenerateToNativeObject,
-    ConstructorCallWith=Document,
-    NamedConstructor=Image(optional unsigned long width, optional unsigned long height)
+    LegacyFactoryFunctionCallWith=Document,
+    LegacyFactoryFunction=Image(optional unsigned long width, optional unsigned long height)
 ] interface HTMLImageElement : HTMLElement {
     [CEReactions=NotNeeded, Reflect] attribute DOMString name;
     [CEReactions=NotNeeded, Reflect] attribute DOMString align;

Modified: trunk/Source/WebCore/html/HTMLOptionElement.idl (266648 => 266649)


--- trunk/Source/WebCore/html/HTMLOptionElement.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/html/HTMLOptionElement.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -20,9 +20,9 @@
 
 [
     JSGenerateToNativeObject,
-    ConstructorMayThrowException,
-    ConstructorCallWith=Document,
-    NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false),
+    LegacyFactoryFunctionMayThrowException,
+    LegacyFactoryFunctionCallWith=Document,
+    LegacyFactoryFunction=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false),
 ] interface HTMLOptionElement : HTMLElement {
     [CEReactions=NotNeeded, Reflect] attribute boolean disabled;
     readonly attribute HTMLFormElement form;

Modified: trunk/Source/WebCore/html/track/TextTrackCue.idl (266648 => 266649)


--- trunk/Source/WebCore/html/track/TextTrackCue.idl	2020-09-04 23:38:09 UTC (rev 266648)
+++ trunk/Source/WebCore/html/track/TextTrackCue.idl	2020-09-05 00:19:43 UTC (rev 266649)
@@ -30,7 +30,7 @@
     CustomToJSObject,
     JSCustomMarkFunction,
     SkipVTableValidation,
-    ConstructorEnabledBySetting=GenericCueAPI
+    LegacyFactoryFunctionEnabledBySetting=GenericCueAPI
 ] interface TextTrackCue : EventTarget {
     [CallWith=Document, MayThrowException] constructor(double startTime, double endTime, DocumentFragment cueNode);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to