[WebIDL] Split up attribute generation to match operation generation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 03:25:06 +0000 (03:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 03:25:06 +0000 (03:25 +0000)
commit69a6b3ad0503941d2260ded197b0266b2587cf6b
treecdf1b934b1c9974ac6c2b39771b6c7330aa69894
parent46dfde6f16d8b59845e91603139356a0b7a6a3c7
[WebIDL] Split up attribute generation to match operation generation
https://bugs.webkit.org/show_bug.cgi?id=173072

Patch by Sam Weinig <sam@webkit.org> on 2017-06-07
Reviewed by Chris Dumez.

* bindings/js/JSDOMAttribute.h:
(WebCore::IDLAttribute::setStatic):
(WebCore::IDLAttribute::getStatic):
Add static variants of get/set matching the one in IDLOperation.

* bindings/scripts/CodeGeneratorJS.pm:
(GetFullyQualifiedImplementationCallName):
Factor out duplicate code to compute the qualified name for a function call.

(AddAdditionalArgumentsForImplementationCall):
Factor out duplicate code to compute the some standard arguments for a function
call. We may want to merge this with GenerateCallWith.

(GenerateHeader):
Update for new signature of HasCustom... subroutines.

(GenerateImplementation):
Pass @implContent to more helper generators to continue propagating the idiom.

(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeGetterTrampolineDefinition):
(GenerateAttributeGetterDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateAttributeSetterTrampolineDefinition):
(GenerateAttributeSetterDefinition):
Split attribute getter and setter generation up by having separate subroutines
to generate the trampoline and body. Also, make all attributes, even static ones
use a trampoline to simplify the code. Static attributes got through a no-op
trampoline, that gets compiled away. Also adopt GetFullyQualifiedImplementationCallName
and AddAdditionalArgumentsForImplementationCall to reduce duplication.

(GenerateOperationBodyDefinition):
(GenerateOperationDefinition):
Adopt $outputArray idiom and adopt GetFullyQualifiedImplementationCallName
and AddAdditionalArgumentsForImplementationCall to reduce duplication

(GenerateParametersCheck):
Adopt GetFullyQualifiedImplementationCallName and AddAdditionalArgumentsForImplementationCall
to reduce duplication.

(HasCustomGetter):
(HasCustomSetter):
(HasCustomMethod):
Convert HasCustom... subroutines to take an IDLAttribute rather than the extended
attributes, matching other predicates

* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMAttribute.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp