Changeset 141541 in webkit


Ignore:
Timestamp:
Jan 31, 2013 11:07:33 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CPP,GObject,ObjC] Add 'enum' skip to CodeGenerator{CPP,GObject,ObjC}.pm
https://bugs.webkit.org/show_bug.cgi?id=108565

Patch by Nils Barth <nbarth@google.com> on 2013-01-31
Reviewed by Kentaro Hara.

Since legacy code generators (CodeGenerator{CPP,GObject,ObjC}.pm)
do not support enumerations, add test to skip attributes of enum type.
This lets us remove #if macro from enum in test file and not need
these in future.
Also minor associated code cleaning:

auxiliary variable: $type = $attribute->signature->type.

Test: bindings/scripts/test/TestObj.idl (run-bindings-test)

  • bindings/scripts/CodeGeneratorCPP.pm:

(SkipAttribute):

  • bindings/scripts/CodeGeneratorGObject.pm:

(SkipAttribute):

  • bindings/scripts/CodeGeneratorObjC.pm:

(SkipAttribute):

  • bindings/scripts/test/TestObj.idl: remove #if macro
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141533 r141541  
     12013-01-31  Nils Barth  <nbarth@google.com>
     2
     3        [CPP,GObject,ObjC] Add 'enum' skip to CodeGenerator{CPP,GObject,ObjC}.pm
     4        https://bugs.webkit.org/show_bug.cgi?id=108565
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Since legacy code generators (CodeGenerator{CPP,GObject,ObjC}.pm)
     9        do not support enumerations, add test to skip attributes of enum type.
     10        This lets us remove #if macro from enum in test file and not need
     11        these in future.
     12        Also minor associated code cleaning:
     13          auxiliary variable: $type = $attribute->signature->type.
     14
     15        Test: bindings/scripts/test/TestObj.idl (run-bindings-test)
     16
     17        * bindings/scripts/CodeGeneratorCPP.pm:
     18        (SkipAttribute):
     19        * bindings/scripts/CodeGeneratorGObject.pm:
     20        (SkipAttribute):
     21        * bindings/scripts/CodeGeneratorObjC.pm:
     22        (SkipAttribute):
     23        * bindings/scripts/test/TestObj.idl: remove #if macro
     24
    1252013-01-31  Kent Tamura  <tkent@chromium.org>
    226
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm

    r135426 r141541  
    200200{
    201201    my $attribute = shift;
     202    my $type = $attribute->signature->type;
    202203
    203204    return 1 if $attribute->signature->extendedAttributes->{"Custom"}
    204205                or $attribute->signature->extendedAttributes->{"CustomGetter"};
    205206
    206     return 1 if $attribute->signature->type =~ /Constructor$/;
    207 
    208     return 1 if $codeGenerator->IsTypedArrayType($attribute->signature->type);
    209 
    210     if ($codeGenerator->GetArrayType($attribute->signature->type)) {
     207    return 1 if $type =~ /Constructor$/;
     208
     209    return 1 if $codeGenerator->IsTypedArrayType($type);
     210
     211    if ($codeGenerator->GetArrayType($type)) {
    211212        return 1;
    212213    }
    213214
    214     if ($codeGenerator->GetSequenceType($attribute->signature->type)) {
     215    if ($codeGenerator->GetSequenceType($type)) {
    215216        return 1;
    216217    }
    217218
    218     $codeGenerator->AssertNotSequenceType($attribute->signature->type);
     219    if ($codeGenerator->IsEnumType($type)) {
     220        return 1;
     221    }
     222
     223    $codeGenerator->AssertNotSequenceType($type);
    219224
    220225    # FIXME: This is typically used to add script execution state arguments to the method.
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r138793 r141541  
    185185
    186186    if ($codeGenerator->GetArrayType($propType)) {
     187        return 1;
     188    }
     189
     190    if ($codeGenerator->IsEnumType($propType)) {
    187191        return 1;
    188192    }
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r140265 r141541  
    447447{
    448448    my $attribute = shift;
    449 
    450     $codeGenerator->AssertNotSequenceType($attribute->signature->type);
    451     return 1 if $codeGenerator->GetArrayType($attribute->signature->type);
    452     return 1 if $codeGenerator->IsTypedArrayType($attribute->signature->type);
     449    my $type = $attribute->signature->type;
     450
     451    $codeGenerator->AssertNotSequenceType($type);
     452    return 1 if $codeGenerator->GetArrayType($type);
     453    return 1 if $codeGenerator->IsTypedArrayType($type);
     454    return 1 if $codeGenerator->IsEnumType($type);
    453455
    454456    # This is for DynamicsCompressorNode.idl
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r141360 r141541  
    3131// changes in its ouput.
    3232
    33 #if defined(TESTING_JS) || defined(TESTING_V8)
    3433enum TestEnumType { "", "EnumValue1", "EnumValue2", "EnumValue3" };
    35 #endif
    3634
    3735[
     
    4745    static attribute DOMString         staticStringAttr;
    4846    static readonly attribute TestSubObjConstructor TestSubObj;
     47#endif
    4948    attribute TestEnumType             enumAttr;
    50 #endif
    5149    attribute short                    shortAttr;
    5250    attribute unsigned short           unsignedShortAttr;
Note: See TracChangeset for help on using the changeset viewer.