Title: [211409] trunk/Source/WebCore
Revision
211409
Author
joep...@webkit.org
Date
2017-01-30 23:17:34 -0800 (Mon, 30 Jan 2017)

Log Message

[WebIDL] Add support for inherit serializer attribute
https://bugs.webkit.org/show_bug.cgi?id=167274

Reviewed by Darin Adler.

Support for serializer { inherit }, which will be used by Resource Timing.
https://heycam.github.io/webidl/#idl-serializers

* bindings/scripts/CodeGenerator.pm:
(GetInterfaceForAttribute):
(IsSerializableAttribute):
Determine if an attribute is serializable at generation time so we can
verify types. This allows us to support typedefs. We don't yet support
serializing an attribute that is itself a serializable interface.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
(GenerateSerializerAttributesForInterface):
Generate inherited attributes first, then generate our own list.
Explicitly provided attribute names are expected to be serializable,
so produce an error if they are not.

* bindings/scripts/IDLParser.pm:
(parseSerializationAttributes):
Update parsing of serializer attributes to allow for multiple
special strings. The spec does not precisely define where the
special "attribute" keyword is allowed.

(applyMemberList):
(isSerializableAttribute): Deleted.
Move serializable attribute checking to generation.

* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp: Added.
* bindings/scripts/test/JS/JSTestSerializationInherit.h: Added.
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: Added.
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: Added.
The toJSON implementations are the most interesting.

* bindings/scripts/test/TestSerialization.idl:
Extend this test for typedefed attributes that are serializable.
Change TestNode (a serializable Interface) to TestException (an
unserializable Interface) for expected behavior of an
unserializable attribute.

* bindings/scripts/test/TestSerializationInherit.idl:
Test for { inherit, attribute }.

* bindings/scripts/test/TestSerializationInheritFinal.idl:
Test for { inherit, attribute_names... }, and multi-level inherit.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (211408 => 211409)


--- trunk/Source/WebCore/ChangeLog	2017-01-31 07:11:45 UTC (rev 211408)
+++ trunk/Source/WebCore/ChangeLog	2017-01-31 07:17:34 UTC (rev 211409)
@@ -1,5 +1,58 @@
 2017-01-30  Joseph Pecoraro  <pecor...@apple.com>
 
+        [WebIDL] Add support for inherit serializer attribute
+        https://bugs.webkit.org/show_bug.cgi?id=167274
+
+        Reviewed by Darin Adler.
+
+        Support for serializer { inherit }, which will be used by Resource Timing.
+        https://heycam.github.io/webidl/#idl-serializers
+
+        * bindings/scripts/CodeGenerator.pm:
+        (GetInterfaceForAttribute):
+        (IsSerializableAttribute):
+        Determine if an attribute is serializable at generation time so we can
+        verify types. This allows us to support typedefs. We don't yet support
+        serializing an attribute that is itself a serializable interface.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateSerializerFunction):
+        (GenerateSerializerAttributesForInterface):
+        Generate inherited attributes first, then generate our own list.
+        Explicitly provided attribute names are expected to be serializable,
+        so produce an error if they are not.
+
+        * bindings/scripts/IDLParser.pm:
+        (parseSerializationAttributes):
+        Update parsing of serializer attributes to allow for multiple
+        special strings. The spec does not precisely define where the
+        special "attribute" keyword is allowed.
+
+        (applyMemberList):
+        (isSerializableAttribute): Deleted.
+        Move serializable attribute checking to generation.
+
+        * bindings/scripts/test/JS/JSTestSerialization.cpp:
+        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: Added.
+        * bindings/scripts/test/JS/JSTestSerializationInherit.h: Added.
+        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: Added.
+        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: Added.
+        The toJSON implementations are the most interesting.
+
+        * bindings/scripts/test/TestSerialization.idl:
+        Extend this test for typedefed attributes that are serializable.
+        Change TestNode (a serializable Interface) to TestException (an
+        unserializable Interface) for expected behavior of an
+        unserializable attribute.
+
+        * bindings/scripts/test/TestSerializationInherit.idl:
+        Test for { inherit, attribute }.
+
+        * bindings/scripts/test/TestSerializationInheritFinal.idl:
+        Test for { inherit, attribute_names... }, and multi-level inherit.
+
+2017-01-30  Joseph Pecoraro  <pecor...@apple.com>
+
         Implement PerformanceObserver
         https://bugs.webkit.org/show_bug.cgi?id=167546
         <rdar://problem/30247959>

Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (211408 => 211409)


--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2017-01-31 07:11:45 UTC (rev 211408)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2017-01-31 07:17:34 UTC (rev 211409)
@@ -314,6 +314,15 @@
     return $idlFiles->{$interfaceName};
 }
 
+sub GetInterfaceForAttribute
+{
+    my ($object, $currentInterface, $attribute) = @_;
+
+    return undef unless $object->IsInterfaceType($attribute->type);
+
+    return $object->ParseInterface($currentInterface, $attribute->type->name);
+}
+
 sub GetAttributeFromInterface
 {
     my ($object, $outerInterface, $interfaceName, $attributeName) = @_;
@@ -913,6 +922,31 @@
     return 0;
 }
 
+sub IsSerializableAttribute
+{
+    my ($object, $currentInterface, $attribute) = @_;
+
+    # https://heycam.github.io/webidl/#dfn-serializable-type
+
+    my $type = $attribute->type;
+    return 1 if $type->name eq "boolean";
+    return 1 if $object->IsNumericType($type);
+    return 1 if $object->IsEnumType($type);
+    return 1 if $object->IsStringType($type);
+    return 0 if $type->name eq "EventHandler";
+
+    if ($type->isUnion || $object->IsSequenceType($type) || $object->IsDictionaryType($type)) {
+        die "Serializer for non-primitive types is not currently supported\n";
+    }
+
+    my $interface = GetInterfaceForAttribute($object, $currentInterface, $attribute);
+    if ($interface && $interface->serializable) {
+        die "Serializer for non-primitive types is not currently supported\n";
+    }
+
+    return 0;
+}
+
 sub GetInterfaceExtendedAttributesFromName
 {
     # FIXME: It's bad to have a function like this that opens another IDL file to answer a question.

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (211408 => 211409)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2017-01-31 07:11:45 UTC (rev 211408)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2017-01-31 07:17:34 UTC (rev 211409)
@@ -4400,18 +4400,55 @@
     push(@implContent, "    auto* result = constructEmptyObject(state);\n");
     push(@implContent, "\n");
 
+    GenerateSerializerAttributesForInterface($interface, $className);
+
+    push(@implContent, "    return JSValue::encode(result);\n");
+    push(@implContent, "}\n");
+    push(@implContent, "\n");
+    push(@implContent, "EncodedJSValue JSC_HOST_CALL ${serializerNativeFunctionName}(ExecState* state)\n");
+    push(@implContent, "{\n");
+    push(@implContent, "    return BindingCaller<JS$interfaceName>::callOperation<${serializerNativeFunctionName}Caller>(state, \"$serializerFunctionName\");\n");
+    push(@implContent, "}\n");
+    push(@implContent, "\n");
+}
+
+sub GenerateSerializerAttributesForInterface
+{
+    my ($interface, $className) = @_;
+
+    my $interfaceName = $interface->type->name;
+
+    if ($interface->serializable->hasInherit) {
+        my $parentSerializerInterface = 0;
+        $codeGenerator->ForAllParents($interface, sub {
+            my $parentInterface = shift;
+            if ($parentInterface->serializable && !$parentSerializerInterface) {
+                $parentSerializerInterface = $parentInterface;
+            }
+        }, 0);
+
+        die "Failed to find parent interface with \"serializer\" for \"inherit\" serializer in $interfaceName\n" if !$parentSerializerInterface;
+
+        GenerateSerializerAttributesForInterface($parentSerializerInterface, $className);
+    }
+
     my @serializedAttributes = ();
+
     foreach my $attributeName (@{$interface->serializable->attributes}) {
         my $foundAttribute = 0;
         foreach my $attribute (@{$interface->attributes}) {
             if ($attributeName eq $attribute->name) {
-                push @serializedAttributes, $attribute;
                 $foundAttribute = 1;
+                if ($codeGenerator->IsSerializableAttribute($interface, $attribute)) {
+                    push(@serializedAttributes, $attribute);                
+                    last;
+                }                    
+                die "Explicit \"serializer\" attribute \"$attributeName\" is not serializable\n" if !$interface->serializable->hasAttribute;
                 last;
             }
         }
         
-        die "Failed to find \"serializer\" attribute \"$attributeName\" in $interfaceName" if !$foundAttribute;
+        die "Failed to find \"serializer\" attribute \"$attributeName\" in $interfaceName\n" if !$foundAttribute;
     }
 
     foreach my $attribute (@serializedAttributes) {
@@ -4423,15 +4460,6 @@
         push(@implContent, "    result->putDirect(vm, Identifier::fromString(&vm, \"${name}\"), ${name}Value);\n");
         push(@implContent, "\n");
     }
-
-    push(@implContent, "    return JSValue::encode(result);\n");
-    push(@implContent, "}\n");
-    push(@implContent, "\n");
-    push(@implContent, "EncodedJSValue JSC_HOST_CALL ${serializerNativeFunctionName}(ExecState* state)\n");
-    push(@implContent, "{\n");
-    push(@implContent, "    return BindingCaller<JS$interfaceName>::callOperation<${serializerNativeFunctionName}Caller>(state, \"$serializerFunctionName\");\n");
-    push(@implContent, "}\n");
-    push(@implContent, "\n");
 }
 
 sub GenerateCallWithUsingReferences

Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (211408 => 211409)


--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2017-01-31 07:11:45 UTC (rev 211408)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2017-01-31 07:17:34 UTC (rev 211409)
@@ -1236,28 +1236,30 @@
 {
     my $self = shift;
     my $serializable = shift;
-    my $token = $self->getToken();
 
-    if ($token->value() eq "getter") {
-        $serializable->hasGetter(1);
-        die "Serializer getter keyword is not currently supported.";
+    my @attributes = ();
+    my @identifiers = $self->parseIdentifierList();
 
-    }
-    if ($token->value() eq "inherit") {
-        $serializable->hasInherit(1);
-        die "Serializer inherit keyword is not currently supported.";
-    }
+    for my $identifier (@identifiers) {
+        if ($identifier eq "getter") {
+            $serializable->hasGetter(1);
+            die "Serializer getter keyword is not currently supported.";
+        }
 
-    if ($token->value() eq "attribute") {
-        $serializable->hasAttribute(1);
-        # Attributes will be filled in via applyMemberList()
-        return;
+        if ($identifier eq "inherit") {
+            $serializable->hasInherit(1);
+            next;
+        }
+
+        if ($identifier eq "attribute") {
+            $serializable->hasAttribute(1);
+            # Attributes will be filled in via applyMemberList()
+            next;
+        }
+
+        push(@attributes, $identifier);
     }
 
-    my @attributes = ();
-    $self->assertTokenType($token, IdentifierToken);
-    push(@attributes, $token->value());
-    push(@attributes, @{$self->parseIdentifiers()});
     $serializable->attributes(\@attributes);
 }
 
@@ -2377,17 +2379,6 @@
     $self->assertUnexpectedToken($next->value());
 }
 
-sub isSerializableAttribute
-{
-    my $attribute = shift;
-
-    # FIXME: Need to support more than primitive serializable types.
-    # This check may have to move to the code generator, if we don't have enough information
-    # here to determine serializability: https://heycam.github.io/webidl/#idl-serializers
-    my $serializable_types = '^(\(byte|octet|short|unsigned short|long|unsigned long|long long|unsigned long long|float|unrestricted float|double|unrestricted double|boolean|DOMString|ByteString|USVString)$';
-    return $attribute->type->name =~ /$serializable_types/;
-}
-
 sub applyMemberList
 {
     my $interface = shift;
@@ -2424,9 +2415,7 @@
         my $numSerializerAttributes = @{$interface->serializable->attributes};
         if ($interface->serializable->hasAttribute) {
             foreach my $attribute (@{$interface->attributes}) {
-                if (isSerializableAttribute($attribute)) {
-                    push(@{$interface->serializable->attributes}, $attribute->name);
-                }
+                push(@{$interface->serializable->attributes}, $attribute->name);
             }
         } elsif ($numSerializerAttributes == 0) {
             foreach my $attribute (@{$interface->attributes}) {

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp (211408 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp	2017-01-31 07:11:45 UTC (rev 211408)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp	2017-01-31 07:17:34 UTC (rev 211409)
@@ -27,7 +27,7 @@
 #include "JSDOMConvert.h"
 #include "JSDOMExceptionHandling.h"
 #include "JSDOMWrapperCache.h"
-#include "JSTestNode.h"
+#include "JSTestException.h"
 #include <runtime/FunctionPrototype.h>
 #include <runtime/ObjectConstructor.h>
 #include <wtf/GetPtr.h>
@@ -52,6 +52,8 @@
 bool setJSTestSerializationFourthUnrestrictedDoubleAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestSerializationFifthLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestSerializationFifthLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationSixthTypedefAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationSixthTypedefAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestSerializationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestSerializationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 
@@ -107,6 +109,7 @@
     { "thirdUnserializableAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationThirdUnserializableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationThirdUnserializableAttribute) } },
     { "fourthUnrestrictedDoubleAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFourthUnrestrictedDoubleAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFourthUnrestrictedDoubleAttribute) } },
     { "fifthLongAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFifthLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFifthLongAttribute) } },
+    { "sixthTypedefAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationSixthTypedefAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationSixthTypedefAttribute) } },
     { "toJSON", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestSerializationPrototypeFunctionToJSON), (intptr_t) (0) } },
 };
 
@@ -202,7 +205,7 @@
     UNUSED_PARAM(throwScope);
     UNUSED_PARAM(state);
     auto& impl = thisObject.wrapped();
-    JSValue result = toJS<IDLInterface<TestNode>>(state, *thisObject.globalObject(), impl.thirdUnserializableAttribute());
+    JSValue result = toJS<IDLInterface<TestException>>(state, *thisObject.globalObject(), impl.thirdUnserializableAttribute());
     return result;
 }
 
@@ -238,6 +241,22 @@
     return result;
 }
 
+static inline JSValue jsTestSerializationSixthTypedefAttributeGetter(ExecState&, JSTestSerialization&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationSixthTypedefAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return BindingCaller<JSTestSerialization>::attribute<jsTestSerializationSixthTypedefAttributeGetter>(state, thisValue, "sixthTypedefAttribute");
+}
+
+static inline JSValue jsTestSerializationSixthTypedefAttributeGetter(ExecState& state, JSTestSerialization& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLDouble>(impl.sixthTypedefAttribute());
+    return result;
+}
+
 EncodedJSValue jsTestSerializationConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
@@ -312,7 +331,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = thisObject.wrapped();
-    auto nativeValue = convert<IDLInterface<TestNode>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestSerialization", "thirdUnserializableAttribute", "TestNode"); });
+    auto nativeValue = convert<IDLInterface<TestException>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestSerialization", "thirdUnserializableAttribute", "TestException"); });
     RETURN_IF_EXCEPTION(throwScope, false);
     impl.setThirdUnserializableAttribute(*nativeValue);
     return true;
@@ -357,6 +376,25 @@
 }
 
 
+static inline bool setJSTestSerializationSixthTypedefAttributeFunction(ExecState&, JSTestSerialization&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationSixthTypedefAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return BindingCaller<JSTestSerialization>::setAttribute<setJSTestSerializationSixthTypedefAttributeFunction>(state, thisValue, encodedValue, "sixthTypedefAttribute");
+}
+
+static inline bool setJSTestSerializationSixthTypedefAttributeFunction(ExecState& state, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = thisObject.wrapped();
+    auto nativeValue = convert<IDLDouble>(state, value);
+    RETURN_IF_EXCEPTION(throwScope, false);
+    impl.setSixthTypedefAttribute(WTFMove(nativeValue));
+    return true;
+}
+
+
 JSValue JSTestSerialization::getConstructor(VM& vm, const JSGlobalObject* globalObject)
 {
     return getDOMConstructor<JSTestSerializationConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
@@ -383,6 +421,10 @@
     ASSERT(!throwScope.exception());
     result->putDirect(vm, Identifier::fromString(&vm, "fifthLongAttribute"), fifthLongAttributeValue);
 
+    auto sixthTypedefAttributeValue = jsTestSerializationSixthTypedefAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "sixthTypedefAttribute"), sixthTypedefAttributeValue);
+
     return JSValue::encode(result);
 }
 

Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp.rej (0 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp.rej	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp.rej	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,10 @@
+diff a/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp	(rejected hunks)
+@@ -24,7 +24,7 @@
+ #include "JSDOMBinding.h"
+ #include "JSDOMConstructor.h"
+ #include "JSDOMConvert.h"
+-#include "JSTestNode.h"
++#include "JSTestException.h"
+ #include <runtime/FunctionPrototype.h>
+ #include <runtime/ObjectConstructor.h>
+ #include <wtf/GetPtr.h>

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


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,242 @@
+/*
+    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 "JSTestSerializationInherit.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMBindingCaller.h"
+#include "JSDOMConstructor.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/ObjectConstructor.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializationInheritPrototypeFunctionToJSON(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestSerializationInheritInheritLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationInheritInheritLongAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationInheritConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationInheritConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestSerializationInheritPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestSerializationInheritPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestSerializationInheritPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestSerializationInheritPrototype>(vm.heap)) JSTestSerializationInheritPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestSerializationInheritPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestSerializationInheritConstructor = JSDOMConstructorNotConstructable<JSTestSerializationInherit>;
+
+template<> JSValue JSTestSerializationInheritConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    return JSTestSerialization::getConstructor(vm, &globalObject);
+}
+
+template<> void JSTestSerializationInheritConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestSerializationInherit::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestSerializationInherit"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestSerializationInheritConstructor::s_info = { "TestSerializationInherit", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationInheritConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestSerializationInheritPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationInheritConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationInheritConstructor) } },
+    { "inheritLongAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationInheritInheritLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationInheritInheritLongAttribute) } },
+    { "toJSON", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestSerializationInheritPrototypeFunctionToJSON), (intptr_t) (0) } },
+};
+
+const ClassInfo JSTestSerializationInheritPrototype::s_info = { "TestSerializationInheritPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationInheritPrototype) };
+
+void JSTestSerializationInheritPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestSerializationInheritPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestSerializationInherit::s_info = { "TestSerializationInherit", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationInherit) };
+
+JSTestSerializationInherit::JSTestSerializationInherit(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestSerializationInherit>&& impl)
+    : JSTestSerialization(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestSerializationInherit::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestSerializationInherit::createPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return JSTestSerializationInheritPrototype::create(vm, globalObject, JSTestSerializationInheritPrototype::createStructure(vm, globalObject, JSTestSerialization::prototype(vm, globalObject)));
+}
+
+JSObject* JSTestSerializationInherit::prototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return getDOMPrototype<JSTestSerializationInherit>(vm, globalObject);
+}
+
+template<> inline JSTestSerializationInherit* BindingCaller<JSTestSerializationInherit>::castForAttribute(ExecState& state, EncodedJSValue thisValue)
+{
+    return jsDynamicDowncast<JSTestSerializationInherit*>(state.vm(), JSValue::decode(thisValue));
+}
+
+template<> inline JSTestSerializationInherit* BindingCaller<JSTestSerializationInherit>::castForOperation(ExecState& state)
+{
+    return jsDynamicDowncast<JSTestSerializationInherit*>(state.vm(), state.thisValue());
+}
+
+static inline JSValue jsTestSerializationInheritInheritLongAttributeGetter(ExecState&, JSTestSerializationInherit&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationInheritInheritLongAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return BindingCaller<JSTestSerializationInherit>::attribute<jsTestSerializationInheritInheritLongAttributeGetter>(state, thisValue, "inheritLongAttribute");
+}
+
+static inline JSValue jsTestSerializationInheritInheritLongAttributeGetter(ExecState& state, JSTestSerializationInherit& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLLong>(impl.inheritLongAttribute());
+    return result;
+}
+
+EncodedJSValue jsTestSerializationInheritConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    JSTestSerializationInheritPrototype* domObject = jsDynamicDowncast<JSTestSerializationInheritPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!domObject))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestSerializationInherit::getConstructor(state->vm(), domObject->globalObject()));
+}
+
+bool setJSTestSerializationInheritConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    JSValue value = JSValue::decode(encodedValue);
+    JSTestSerializationInheritPrototype* domObject = jsDynamicDowncast<JSTestSerializationInheritPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!domObject)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
+}
+
+static inline bool setJSTestSerializationInheritInheritLongAttributeFunction(ExecState&, JSTestSerializationInherit&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationInheritInheritLongAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return BindingCaller<JSTestSerializationInherit>::setAttribute<setJSTestSerializationInheritInheritLongAttributeFunction>(state, thisValue, encodedValue, "inheritLongAttribute");
+}
+
+static inline bool setJSTestSerializationInheritInheritLongAttributeFunction(ExecState& state, JSTestSerializationInherit& thisObject, JSValue value, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = thisObject.wrapped();
+    auto nativeValue = convert<IDLLong>(state, value, IntegerConversionConfiguration::Normal);
+    RETURN_IF_EXCEPTION(throwScope, false);
+    impl.setInheritLongAttribute(WTFMove(nativeValue));
+    return true;
+}
+
+
+JSValue JSTestSerializationInherit::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestSerializationInheritConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+static inline EncodedJSValue jsTestSerializationInheritPrototypeFunctionToJSONCaller(ExecState* state, JSTestSerializationInherit* thisObject, JSC::ThrowScope& throwScope)
+{
+    auto& vm = state->vm();
+    auto* result = constructEmptyObject(state);
+
+    auto firstStringAttributeValue = jsTestSerializationFirstStringAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "firstStringAttribute"), firstStringAttributeValue);
+
+    auto secondLongAttributeValue = jsTestSerializationSecondLongAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "secondLongAttribute"), secondLongAttributeValue);
+
+    auto fourthUnrestrictedDoubleAttributeValue = jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "fourthUnrestrictedDoubleAttribute"), fourthUnrestrictedDoubleAttributeValue);
+
+    auto fifthLongAttributeValue = jsTestSerializationFifthLongAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "fifthLongAttribute"), fifthLongAttributeValue);
+
+    auto sixthTypedefAttributeValue = jsTestSerializationSixthTypedefAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "sixthTypedefAttribute"), sixthTypedefAttributeValue);
+
+    auto inheritLongAttributeValue = jsTestSerializationInheritInheritLongAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "inheritLongAttribute"), inheritLongAttributeValue);
+
+    return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestSerializationInheritPrototypeFunctionToJSON(ExecState* state)
+{
+    return BindingCaller<JSTestSerializationInherit>::callOperation<jsTestSerializationInheritPrototypeFunctionToJSONCaller>(state, "toJSON");
+}
+
+
+}

Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h (0 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,66 @@
+/*
+    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 "JSTestSerialization.h"
+#include "TestSerializationInherit.h"
+
+namespace WebCore {
+
+class JSTestSerializationInherit : public JSTestSerialization {
+public:
+    using Base = JSTestSerialization;
+    using DOMWrapped = TestSerializationInherit;
+    static JSTestSerializationInherit* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestSerializationInherit>&& impl)
+    {
+        JSTestSerializationInherit* ptr = new (NotNull, JSC::allocateCell<JSTestSerializationInherit>(globalObject->vm().heap)) JSTestSerializationInherit(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
+    static JSC::JSObject* prototype(JSC::VM&, JSC::JSGlobalObject*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    TestSerializationInherit& wrapped() const
+    {
+        return static_cast<TestSerializationInherit&>(Base::wrapped());
+    }
+protected:
+    JSTestSerializationInherit(JSC::Structure*, JSDOMGlobalObject&, Ref<TestSerializationInherit>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+
+template<> struct JSDOMWrapperConverterTraits<TestSerializationInherit> {
+    using WrapperClass = JSTestSerializationInherit;
+    using ToWrappedReturnType = TestSerializationInherit*;
+};
+
+} // namespace WebCore

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


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,284 @@
+/*
+    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 "JSTestSerializationInheritFinal.h"
+
+#include "JSDOMBinding.h"
+#include "JSDOMBindingCaller.h"
+#include "JSDOMConstructor.h"
+#include "JSDOMConvert.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+#include <runtime/ObjectConstructor.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializationInheritFinalPrototypeFunctionToJSON(JSC::ExecState*);
+
+// Attributes
+
+JSC::EncodedJSValue jsTestSerializationInheritFinalFinalLongAttributeFoo(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationInheritFinalFinalLongAttributeFoo(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationInheritFinalFinalLongAttributeBar(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationInheritFinalFinalLongAttributeBar(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestSerializationInheritFinalConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestSerializationInheritFinalConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestSerializationInheritFinalPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    static JSTestSerializationInheritFinalPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestSerializationInheritFinalPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestSerializationInheritFinalPrototype>(vm.heap)) JSTestSerializationInheritFinalPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestSerializationInheritFinalPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+using JSTestSerializationInheritFinalConstructor = JSDOMConstructorNotConstructable<JSTestSerializationInheritFinal>;
+
+template<> JSValue JSTestSerializationInheritFinalConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+    return JSTestSerializationInherit::getConstructor(vm, &globalObject);
+}
+
+template<> void JSTestSerializationInheritFinalConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    putDirect(vm, vm.propertyNames->prototype, JSTestSerializationInheritFinal::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestSerializationInheritFinal"))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestSerializationInheritFinalConstructor::s_info = { "TestSerializationInheritFinal", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationInheritFinalConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestSerializationInheritFinalPrototypeTableValues[] =
+{
+    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationInheritFinalConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationInheritFinalConstructor) } },
+    { "finalLongAttributeFoo", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationInheritFinalFinalLongAttributeFoo), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationInheritFinalFinalLongAttributeFoo) } },
+    { "finalLongAttributeBar", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationInheritFinalFinalLongAttributeBar), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationInheritFinalFinalLongAttributeBar) } },
+    { "toJSON", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestSerializationInheritFinalPrototypeFunctionToJSON), (intptr_t) (0) } },
+};
+
+const ClassInfo JSTestSerializationInheritFinalPrototype::s_info = { "TestSerializationInheritFinalPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationInheritFinalPrototype) };
+
+void JSTestSerializationInheritFinalPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestSerializationInheritFinalPrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestSerializationInheritFinal::s_info = { "TestSerializationInheritFinal", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializationInheritFinal) };
+
+JSTestSerializationInheritFinal::JSTestSerializationInheritFinal(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestSerializationInheritFinal>&& impl)
+    : JSTestSerializationInherit(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestSerializationInheritFinal::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+
+}
+
+JSObject* JSTestSerializationInheritFinal::createPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return JSTestSerializationInheritFinalPrototype::create(vm, globalObject, JSTestSerializationInheritFinalPrototype::createStructure(vm, globalObject, JSTestSerializationInherit::prototype(vm, globalObject)));
+}
+
+JSObject* JSTestSerializationInheritFinal::prototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return getDOMPrototype<JSTestSerializationInheritFinal>(vm, globalObject);
+}
+
+template<> inline JSTestSerializationInheritFinal* BindingCaller<JSTestSerializationInheritFinal>::castForAttribute(ExecState& state, EncodedJSValue thisValue)
+{
+    return jsDynamicDowncast<JSTestSerializationInheritFinal*>(state.vm(), JSValue::decode(thisValue));
+}
+
+template<> inline JSTestSerializationInheritFinal* BindingCaller<JSTestSerializationInheritFinal>::castForOperation(ExecState& state)
+{
+    return jsDynamicDowncast<JSTestSerializationInheritFinal*>(state.vm(), state.thisValue());
+}
+
+static inline JSValue jsTestSerializationInheritFinalFinalLongAttributeFooGetter(ExecState&, JSTestSerializationInheritFinal&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationInheritFinalFinalLongAttributeFoo(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return BindingCaller<JSTestSerializationInheritFinal>::attribute<jsTestSerializationInheritFinalFinalLongAttributeFooGetter>(state, thisValue, "finalLongAttributeFoo");
+}
+
+static inline JSValue jsTestSerializationInheritFinalFinalLongAttributeFooGetter(ExecState& state, JSTestSerializationInheritFinal& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLLong>(impl.finalLongAttributeFoo());
+    return result;
+}
+
+static inline JSValue jsTestSerializationInheritFinalFinalLongAttributeBarGetter(ExecState&, JSTestSerializationInheritFinal&, ThrowScope& throwScope);
+
+EncodedJSValue jsTestSerializationInheritFinalFinalLongAttributeBar(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return BindingCaller<JSTestSerializationInheritFinal>::attribute<jsTestSerializationInheritFinalFinalLongAttributeBarGetter>(state, thisValue, "finalLongAttributeBar");
+}
+
+static inline JSValue jsTestSerializationInheritFinalFinalLongAttributeBarGetter(ExecState& state, JSTestSerializationInheritFinal& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLLong>(impl.finalLongAttributeBar());
+    return result;
+}
+
+EncodedJSValue jsTestSerializationInheritFinalConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    JSTestSerializationInheritFinalPrototype* domObject = jsDynamicDowncast<JSTestSerializationInheritFinalPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!domObject))
+        return throwVMTypeError(state, throwScope);
+    return JSValue::encode(JSTestSerializationInheritFinal::getConstructor(state->vm(), domObject->globalObject()));
+}
+
+bool setJSTestSerializationInheritFinalConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    JSValue value = JSValue::decode(encodedValue);
+    JSTestSerializationInheritFinalPrototype* domObject = jsDynamicDowncast<JSTestSerializationInheritFinalPrototype*>(vm, JSValue::decode(thisValue));
+    if (UNLIKELY(!domObject)) {
+        throwVMTypeError(state, throwScope);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
+}
+
+static inline bool setJSTestSerializationInheritFinalFinalLongAttributeFooFunction(ExecState&, JSTestSerializationInheritFinal&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationInheritFinalFinalLongAttributeFoo(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return BindingCaller<JSTestSerializationInheritFinal>::setAttribute<setJSTestSerializationInheritFinalFinalLongAttributeFooFunction>(state, thisValue, encodedValue, "finalLongAttributeFoo");
+}
+
+static inline bool setJSTestSerializationInheritFinalFinalLongAttributeFooFunction(ExecState& state, JSTestSerializationInheritFinal& thisObject, JSValue value, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = thisObject.wrapped();
+    auto nativeValue = convert<IDLLong>(state, value, IntegerConversionConfiguration::Normal);
+    RETURN_IF_EXCEPTION(throwScope, false);
+    impl.setFinalLongAttributeFoo(WTFMove(nativeValue));
+    return true;
+}
+
+
+static inline bool setJSTestSerializationInheritFinalFinalLongAttributeBarFunction(ExecState&, JSTestSerializationInheritFinal&, JSValue, ThrowScope&);
+
+bool setJSTestSerializationInheritFinalFinalLongAttributeBar(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return BindingCaller<JSTestSerializationInheritFinal>::setAttribute<setJSTestSerializationInheritFinalFinalLongAttributeBarFunction>(state, thisValue, encodedValue, "finalLongAttributeBar");
+}
+
+static inline bool setJSTestSerializationInheritFinalFinalLongAttributeBarFunction(ExecState& state, JSTestSerializationInheritFinal& thisObject, JSValue value, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = thisObject.wrapped();
+    auto nativeValue = convert<IDLLong>(state, value, IntegerConversionConfiguration::Normal);
+    RETURN_IF_EXCEPTION(throwScope, false);
+    impl.setFinalLongAttributeBar(WTFMove(nativeValue));
+    return true;
+}
+
+
+JSValue JSTestSerializationInheritFinal::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor<JSTestSerializationInheritFinalConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+static inline EncodedJSValue jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller(ExecState* state, JSTestSerializationInheritFinal* thisObject, JSC::ThrowScope& throwScope)
+{
+    auto& vm = state->vm();
+    auto* result = constructEmptyObject(state);
+
+    auto firstStringAttributeValue = jsTestSerializationFirstStringAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "firstStringAttribute"), firstStringAttributeValue);
+
+    auto secondLongAttributeValue = jsTestSerializationSecondLongAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "secondLongAttribute"), secondLongAttributeValue);
+
+    auto fourthUnrestrictedDoubleAttributeValue = jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "fourthUnrestrictedDoubleAttribute"), fourthUnrestrictedDoubleAttributeValue);
+
+    auto fifthLongAttributeValue = jsTestSerializationFifthLongAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "fifthLongAttribute"), fifthLongAttributeValue);
+
+    auto sixthTypedefAttributeValue = jsTestSerializationSixthTypedefAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "sixthTypedefAttribute"), sixthTypedefAttributeValue);
+
+    auto inheritLongAttributeValue = jsTestSerializationInheritInheritLongAttributeGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "inheritLongAttribute"), inheritLongAttributeValue);
+
+    auto finalLongAttributeBarValue = jsTestSerializationInheritFinalFinalLongAttributeBarGetter(*state, *thisObject, throwScope);
+    ASSERT(!throwScope.exception());
+    result->putDirect(vm, Identifier::fromString(&vm, "finalLongAttributeBar"), finalLongAttributeBarValue);
+
+    return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestSerializationInheritFinalPrototypeFunctionToJSON(ExecState* state)
+{
+    return BindingCaller<JSTestSerializationInheritFinal>::callOperation<jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller>(state, "toJSON");
+}
+
+
+}

Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h (0 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,66 @@
+/*
+    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 "JSTestSerializationInherit.h"
+#include "TestSerializationInheritFinal.h"
+
+namespace WebCore {
+
+class JSTestSerializationInheritFinal : public JSTestSerializationInherit {
+public:
+    using Base = JSTestSerializationInherit;
+    using DOMWrapped = TestSerializationInheritFinal;
+    static JSTestSerializationInheritFinal* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestSerializationInheritFinal>&& impl)
+    {
+        JSTestSerializationInheritFinal* ptr = new (NotNull, JSC::allocateCell<JSTestSerializationInheritFinal>(globalObject->vm().heap)) JSTestSerializationInheritFinal(structure, *globalObject, WTFMove(impl));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
+    static JSC::JSObject* prototype(JSC::VM&, JSC::JSGlobalObject*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    TestSerializationInheritFinal& wrapped() const
+    {
+        return static_cast<TestSerializationInheritFinal&>(Base::wrapped());
+    }
+protected:
+    JSTestSerializationInheritFinal(JSC::Structure*, JSDOMGlobalObject&, Ref<TestSerializationInheritFinal>&&);
+
+    void finishCreation(JSC::VM&);
+};
+
+
+template<> struct JSDOMWrapperConverterTraits<TestSerializationInheritFinal> {
+    using WrapperClass = JSTestSerializationInheritFinal;
+    using ToWrappedReturnType = TestSerializationInheritFinal*;
+};
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl (211408 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl	2017-01-31 07:11:45 UTC (rev 211408)
+++ trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl	2017-01-31 07:17:34 UTC (rev 211409)
@@ -23,12 +23,15 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+typedef double TestTimeStamp;
+
 interface TestSerialization {
     attribute DOMString             firstStringAttribute;
     attribute long                  secondLongAttribute;
-    attribute TestNode              thirdUnserializableAttribute;
+    attribute TestException         thirdUnserializableAttribute;
     attribute unrestricted double   fourthUnrestrictedDoubleAttribute;
     attribute long                  fifthLongAttribute;
+    attribute TestTimeStamp         sixthTypedefAttribute;
 
     serializer = { attribute };
 };

Copied: trunk/Source/WebCore/bindings/scripts/test/TestSerializationInherit.idl (from rev 211408, trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl) (0 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/TestSerializationInherit.idl	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestSerializationInherit.idl	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * 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. 
+ */
+
+interface TestSerializationInherit : TestSerialization {
+    attribute long                  inheritLongAttribute;
+
+    serializer = { inherit, attribute };
+};

Copied: trunk/Source/WebCore/bindings/scripts/test/TestSerializationInheritFinal.idl (from rev 211408, trunk/Source/WebCore/bindings/scripts/test/TestSerialization.idl) (0 => 211409)


--- trunk/Source/WebCore/bindings/scripts/test/TestSerializationInheritFinal.idl	                        (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestSerializationInheritFinal.idl	2017-01-31 07:17:34 UTC (rev 211409)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * 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. 
+ */
+
+interface TestSerializationInheritFinal : TestSerializationInherit {
+    attribute long                  finalLongAttributeFoo;
+    attribute long                  finalLongAttributeBar;
+
+    serializer = { inherit, finalLongAttributeBar };
+};
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to