Changeset 156808 in webkit


Ignore:
Timestamp:
Oct 2, 2013, 4:32:47 PM (12 years ago)
Author:
eric.carlson@apple.com
Message:

IDL parser should remove a leading "_" from identifier names
https://bugs.webkit.org/show_bug.cgi?id=122239

Reviewed by Jer Noble.

No new tests, updated bindings tests and results.

  • bindings/scripts/IDLParser.pm:

(identifierRemoveNullablePrefix): Remove leading "_".
(parseInterface): Call identifierRemoveNullablePrefix.
(parseException): Ditto.
(parseEnum): Ditto.
(parseConst): Ditto.
(parseAttributeRest): Ditto.
(parseOperationRest): Ditto.
(parseOptionalOrRequiredArgument): Ditto.
(parseExceptionField): Ditto.
(parseNonAnyType): Ditto.

Update tests and results.

  • bindings/scripts/test/CPP/WebDOMTestObj.cpp:
  • bindings/scripts/test/CPP/WebDOMTestObj.h:
  • bindings/scripts/test/CPP/WebDOMattribute.cpp: Added.
  • bindings/scripts/test/CPP/WebDOMattribute.h: Added.
  • bindings/scripts/test/CPP/WebDOMreadonly.cpp: Added.
  • bindings/scripts/test/CPP/WebDOMreadonly.h: Added.
  • bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
  • bindings/scripts/test/GObject/WebKitDOMTestObj.h:
  • bindings/scripts/test/GObject/WebKitDOMTestObj.symbols:
  • bindings/scripts/test/GObject/WebKitDOMattribute.cpp: Added.
  • bindings/scripts/test/GObject/WebKitDOMattribute.h: Added.
  • bindings/scripts/test/GObject/WebKitDOMattribute.symbols: Added.
  • bindings/scripts/test/GObject/WebKitDOMattributePrivate.h: Added.
  • bindings/scripts/test/GObject/WebKitDOMreadonly.cpp: Added.
  • bindings/scripts/test/GObject/WebKitDOMreadonly.h: Added.
  • bindings/scripts/test/GObject/WebKitDOMreadonly.symbols: Added.
  • bindings/scripts/test/GObject/WebKitDOMreadonlyPrivate.h: Added.
  • bindings/scripts/test/JS/JSTestObj.cpp:
  • bindings/scripts/test/JS/JSTestObj.h:
  • bindings/scripts/test/JS/JSattribute.cpp: Added.
  • bindings/scripts/test/JS/JSattribute.h: Added.
  • bindings/scripts/test/JS/JSreadonly.cpp: Added.
  • bindings/scripts/test/JS/JSreadonly.h: Added.
  • bindings/scripts/test/ObjC/DOMTestObj.h:
  • bindings/scripts/test/ObjC/DOMTestObj.mm:
  • bindings/scripts/test/ObjC/DOMattribute.h: Added.
  • bindings/scripts/test/ObjC/DOMattribute.mm: Added.
  • bindings/scripts/test/ObjC/DOMattributeInternal.h: Added.
  • bindings/scripts/test/ObjC/DOMreadonly.h: Added.
  • bindings/scripts/test/ObjC/DOMreadonly.mm: Added.
  • bindings/scripts/test/ObjC/DOMreadonlyInternal.h: Added.
  • bindings/scripts/test/TestException.idl:
  • bindings/scripts/test/TestInterface.idl:
  • bindings/scripts/test/TestObj.idl:
Location:
trunk/Source/WebCore
Files:
22 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156806 r156808  
    1 2013-10-02  Bem Jones-Bey  <bjonesbe@adobe.com>
    2 
    3         [css-shapes] shape-outside does not properly handle the container and the float having different writing modes
    4         https://bugs.webkit.org/show_bug.cgi?id=122243
    5 
    6         Reviewed by Alexandru Chiculita.
    7 
    8         The margin box offset needs to be computed based on the writing mode
    9         of the container, not the writihg mode of the float itself. This
    10         patch makes that happen.
    11 
    12         Test: fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html
    13 
    14         * rendering/shapes/ShapeOutsideInfo.cpp:
    15         (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
     12013-10-02  Eric Carlson  <eric.carlson@apple.com>
     2
     3        IDL parser should remove a leading "_" from identifier names
     4        https://bugs.webkit.org/show_bug.cgi?id=122239
     5
     6        Reviewed by Jer Noble.
     7
     8        No new tests, updated bindings tests and results.
     9
     10        * bindings/scripts/IDLParser.pm:
     11        (identifierRemoveNullablePrefix): Remove leading "_".
     12        (parseInterface): Call identifierRemoveNullablePrefix.
     13        (parseException): Ditto.
     14        (parseEnum): Ditto.
     15        (parseConst): Ditto.
     16        (parseAttributeRest): Ditto.
     17        (parseOperationRest): Ditto.
     18        (parseOptionalOrRequiredArgument): Ditto.
     19        (parseExceptionField): Ditto.
     20        (parseNonAnyType): Ditto.
     21
     22        Update tests and results.
     23        * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
     24        * bindings/scripts/test/CPP/WebDOMTestObj.h:
     25        * bindings/scripts/test/CPP/WebDOMattribute.cpp: Added.
     26        * bindings/scripts/test/CPP/WebDOMattribute.h: Added.
     27        * bindings/scripts/test/CPP/WebDOMreadonly.cpp: Added.
     28        * bindings/scripts/test/CPP/WebDOMreadonly.h: Added.
     29        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
     30        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
     31        * bindings/scripts/test/GObject/WebKitDOMTestObj.symbols:
     32        * bindings/scripts/test/GObject/WebKitDOMattribute.cpp: Added.
     33        * bindings/scripts/test/GObject/WebKitDOMattribute.h: Added.
     34        * bindings/scripts/test/GObject/WebKitDOMattribute.symbols: Added.
     35        * bindings/scripts/test/GObject/WebKitDOMattributePrivate.h: Added.
     36        * bindings/scripts/test/GObject/WebKitDOMreadonly.cpp: Added.
     37        * bindings/scripts/test/GObject/WebKitDOMreadonly.h: Added.
     38        * bindings/scripts/test/GObject/WebKitDOMreadonly.symbols: Added.
     39        * bindings/scripts/test/GObject/WebKitDOMreadonlyPrivate.h: Added.
     40        * bindings/scripts/test/JS/JSTestObj.cpp:
     41        * bindings/scripts/test/JS/JSTestObj.h:
     42        * bindings/scripts/test/JS/JSattribute.cpp: Added.
     43        * bindings/scripts/test/JS/JSattribute.h: Added.
     44        * bindings/scripts/test/JS/JSreadonly.cpp: Added.
     45        * bindings/scripts/test/JS/JSreadonly.h: Added.
     46        * bindings/scripts/test/ObjC/DOMTestObj.h:
     47        * bindings/scripts/test/ObjC/DOMTestObj.mm:
     48        * bindings/scripts/test/ObjC/DOMattribute.h: Added.
     49        * bindings/scripts/test/ObjC/DOMattribute.mm: Added.
     50        * bindings/scripts/test/ObjC/DOMattributeInternal.h: Added.
     51        * bindings/scripts/test/ObjC/DOMreadonly.h: Added.
     52        * bindings/scripts/test/ObjC/DOMreadonly.mm: Added.
     53        * bindings/scripts/test/ObjC/DOMreadonlyInternal.h: Added.
     54        * bindings/scripts/test/TestException.idl:
     55        * bindings/scripts/test/TestInterface.idl:
     56        * bindings/scripts/test/TestObj.idl:
    1657
    17582013-10-02  Andreas Kling  <akling@apple.com>
  • trunk/Source/WebCore/bindings/scripts/IDLParser.pm

    r152725 r156808  
    307307    my $type = shift;
    308308    $type =~ s/\?//g;
     309    return $type;
     310}
     311
     312sub identifierRemoveNullablePrefix
     313{
     314    my $type = shift;
     315    $type =~ s/^_//;
    309316    return $type;
    310317}
     
    497504        my $interfaceNameToken = $self->getToken();
    498505        $self->assertTokenType($interfaceNameToken, IdentifierToken);
    499         $interface->name($interfaceNameToken->value());
     506        $interface->name(identifierRemoveNullablePrefix($interfaceNameToken->value()));
    500507        my $parents = $self->parseInheritance();
    501508        $interface->parents($parents);
     
    697704        my $exceptionNameToken = $self->getToken();
    698705        $self->assertTokenType($exceptionNameToken, IdentifierToken);
    699         $interface->name($exceptionNameToken->value());
     706        $interface->name(identifierRemoveNullablePrefix($exceptionNameToken->value()));
    700707        $interface->isException(1);
    701708        my $parents = $self->parseInheritance();
     
    761768        my $enumNameToken = $self->getToken();
    762769        $self->assertTokenType($enumNameToken, IdentifierToken);
    763         $enum->name($enumNameToken->value());
     770        $enum->name(identifierRemoveNullablePrefix($enumNameToken->value()));
    764771        $self->assertTokenValue($self->getToken(), "{", __LINE__);
    765772        push(@{$enum->values}, @{$self->parseEnumValueList()});
     
    875882        my $constNameToken = $self->getToken();
    876883        $self->assertTokenType($constNameToken, IdentifierToken);
    877         $newDataNode->name($constNameToken->value());
     884        $newDataNode->name(identifierRemoveNullablePrefix($constNameToken->value()));
    878885        $self->assertTokenValue($self->getToken(), "=", __LINE__);
    879886        $newDataNode->value($self->parseConstValue());
     
    11571164        my $token = $self->getToken();
    11581165        $self->assertTokenType($token, IdentifierToken);
    1159         $newDataNode->signature->name($token->value());
     1166        $newDataNode->signature->name(identifierRemoveNullablePrefix($token->value()));
    11601167        $self->assertTokenValue($self->getToken(), ";", __LINE__);
    11611168        # CustomConstructor may also be used on attributes.
     
    13431350        $newDataNode->signature(domSignature->new());
    13441351        my $name = $self->parseOptionalIdentifier();
    1345         $newDataNode->signature->name($name);
     1352        $newDataNode->signature->name(identifierRemoveNullablePrefix($name));
    13461353        $self->assertTokenValue($self->getToken(), "(", $name, __LINE__);
    13471354        push(@{$newDataNode->parameters}, @{$self->parseArgumentList()});
     
    14281435        }
    14291436        # Remove all "?" if exists, e.g. "object?[]?" -> "object[]".
    1430         $paramDataNode->type(typeRemoveNullableSuffix($type));
     1437        $paramDataNode->type(identifierRemoveNullablePrefix(typeRemoveNullableSuffix($type)));
    14311438        $paramDataNode->isOptional(1);
    14321439        $paramDataNode->name($self->parseArgumentName());
     
    15051512        my $token = $self->getToken();
    15061513        $self->assertTokenType($token, IdentifierToken);
    1507         $newDataNode->signature->name($token->value());
     1514        $newDataNode->signature->name(identifierRemoveNullablePrefix($token->value()));
    15081515        $self->assertTokenValue($self->getToken(), ";", __LINE__);
    15091516        $newDataNode->signature->extendedAttributes($extendedAttributeList);
     
    18771884    }
    18781885    if ($next->type() == IdentifierToken || $next->value() eq "::") {
    1879         my $name = $self->parseScopedName();
     1886        my $name = identifierRemoveNullablePrefix($self->parseScopedName());
    18801887        return $name . $self->parseTypeSuffix();
    18811888    }
  • trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp

    r156580 r156808  
    766766}
    767767
     768WebDOMString WebDOMTestObj::attribute() const
     769{
     770    if (!impl())
     771        return WebDOMString();
     772
     773    return static_cast<const WTF::String&>(impl()->attribute());
     774}
     775
    768776void WebDOMTestObj::voidMethod()
    769777{
     
    11221130}
    11231131
     1132void WebDOMTestObj::any(float a, int b)
     1133{
     1134    if (!impl())
     1135        return;
     1136
     1137    impl()->any(a, b);
     1138}
     1139
    11241140WebCore::TestObj* toWebCore(const WebDOMTestObj& wrapper)
    11251141{
  • trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h

    r152569 r156808  
    6666        WEBDOM_CONST_VALUE_13 = 0X20,
    6767        WEBDOM_CONST_VALUE_14 = 0x1abc,
    68         WEBDOM_CONST_JAVASCRIPT = 15
     68        WEBDOM_CONST_JAVASCRIPT = 15,
     69        WEBDOM_readonly = 0
    6970    };
    7071
     
    156157    int nullableStringValue() const;
    157158    void setNullableStringValue(int);
     159    WebDOMString attribute() const;
    158160
    159161    void voidMethod();
     
    208210    void variadicDoubleMethod(double head, double tail);
    209211    void variadicNodeMethod(const WebDOMNode& head, const WebDOMNode& tail);
     212    void any(float a, int b);
    210213
    211214    WebCore::TestObj* impl() const;
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp

    r156163 r156808  
    132132    PROP_NULLABLE_LONG_SETTABLE_ATTRIBUTE,
    133133    PROP_NULLABLE_STRING_VALUE,
     134    PROP_ATTRIBUTE,
    134135};
    135136
     
    562563        break;
    563564    }
     565    case PROP_ATTRIBUTE: {
     566        g_value_take_string(value, convertToUTF8String(coreSelf->attribute()));
     567        break;
     568    }
    564569    default:
    565570        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
     
    11271132            G_MINLONG, G_MAXLONG, 0,
    11281133            WEBKIT_PARAM_READWRITE));
     1134
     1135    g_object_class_install_property(
     1136        gobjectClass,
     1137        PROP_ATTRIBUTE,
     1138        g_param_spec_string(
     1139            "attribute",
     1140            "TestObj:attribute",
     1141            "read-only gchar* TestObj:attribute",
     1142            "",
     1143            WEBKIT_PARAM_READABLE));
    11291144
    11301145}
     
    16511666}
    16521667
     1668void webkit_dom_test_obj_any(WebKitDOMTestObj* self, gfloat a, glong b)
     1669{
     1670    WebCore::JSMainThreadNullState state;
     1671    g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
     1672    WebCore::TestObj* item = WebKit::core(self);
     1673    item->any(a, b);
     1674}
     1675
    16531676glong webkit_dom_test_obj_get_read_only_long_attr(WebKitDOMTestObj* self)
    16541677{
     
    25892612}
    25902613
     2614gchar* webkit_dom_test_obj_get_attribute(WebKitDOMTestObj* self)
     2615{
     2616    WebCore::JSMainThreadNullState state;
     2617    g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
     2618    WebCore::TestObj* item = WebKit::core(self);
     2619    gchar* result = convertToUTF8String(item->attribute());
     2620    return result;
     2621}
     2622
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h

    r156163 r156808  
    544544
    545545/**
     546 * webkit_dom_test_obj_any:
     547 * @self: A #WebKitDOMTestObj
     548 * @a: A #gfloat
     549 * @b: A #glong
     550 *
     551 *
     552**/
     553WEBKIT_API void
     554webkit_dom_test_obj_any(WebKitDOMTestObj* self, gfloat a, glong b);
     555
     556/**
    546557 * webkit_dom_test_obj_get_read_only_long_attr:
    547558 * @self: A #WebKitDOMTestObj
     
    15121523webkit_dom_test_obj_set_nullable_string_value(WebKitDOMTestObj* self, glong value);
    15131524
     1525/**
     1526 * webkit_dom_test_obj_get_attribute:
     1527 * @self: A #WebKitDOMTestObj
     1528 *
     1529 * Returns:
     1530 *
     1531**/
     1532WEBKIT_API gchar*
     1533webkit_dom_test_obj_get_attribute(WebKitDOMTestObj* self);
     1534
    15141535G_END_DECLS
    15151536
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.symbols

    r155893 r156808  
    4646void webkit_dom_test_obj_variadic_double_method(WebKitDOMTestObj*, gdouble, gdouble)
    4747void webkit_dom_test_obj_variadic_node_method(WebKitDOMTestObj*, WebKitDOMNode*, WebKitDOMNode*)
     48void webkit_dom_test_obj_any(WebKitDOMTestObj*, gfloat, glong)
    4849glong webkit_dom_test_obj_get_read_only_long_attr(WebKitDOMTestObj*)
    4950gchar* webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj*)
     
    141142glong webkit_dom_test_obj_get_nullable_string_value(WebKitDOMTestObj*, GError**)
    142143void webkit_dom_test_obj_set_nullable_string_value(WebKitDOMTestObj*, glong)
     144gchar* webkit_dom_test_obj_get_attribute(WebKitDOMTestObj*)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r156782 r156808  
    153153    { "nullableLongSettableAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongSettableAttribute), (intptr_t)setJSTestObjNullableLongSettableAttribute },
    154154    { "nullableStringValue", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringValue), (intptr_t)setJSTestObjNullableStringValue },
     155    { "attribute", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttribute), (intptr_t)0 },
     156    { "attributeWithReservedEnumType", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t)setJSTestObjAttributeWithReservedEnumType },
    155157    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0 },
    156158    { 0, 0, NoIntrinsic, 0, 0 }
    157159};
    158160
    159 static const HashTable JSTestObjTable = { 265, 255, JSTestObjTableValues, 0 };
     161static const HashTable JSTestObjTable = { 266, 255, JSTestObjTableValues, 0 };
    160162/* Hash table for constructor */
    161163
     
    177179    { "CONST_VALUE_14", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 },
    178180    { "CONST_JAVASCRIPT", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0 },
     181    { "readonly", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadonly), (intptr_t)0 },
    179182    { "staticReadOnlyLongAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t)0 },
    180183    { "staticStringAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t)setJSTestObjConstructorStaticStringAttr },
     
    191194};
    192195
    193 static const HashTable JSTestObjConstructorTable = { 38, 31, JSTestObjConstructorTableValues, 0 };
     196static const HashTable JSTestObjConstructorTable = { 39, 31, JSTestObjConstructorTableValues, 0 };
    194197
    195198#if ENABLE(Condition1)
     
    208211COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDoNotCheckConstants);
    209212COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
     213COMPILE_ASSERT(0 == TestObj::readonly, TestObjEnumreadonlyIsWrongUseDoNotCheckConstants);
    210214
    211215EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::constructJSTestObj(ExecState* exec)
     
    266270    { "CONST_VALUE_14", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 },
    267271    { "CONST_JAVASCRIPT", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0 },
     272    { "readonly", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadonly), (intptr_t)0 },
    268273    { "voidMethod", DontDelete | JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 },
    269274    { "voidMethodWithArgs", DontDelete | JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 },
     
    333338    { "variadicDoubleMethod", DontDelete | JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t)2 },
    334339    { "variadicNodeMethod", DontDelete | JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t)2 },
     340    { "any", DontDelete | JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAny), (intptr_t)2 },
    335341    { 0, 0, NoIntrinsic, 0, 0 }
    336342};
     
    10821088
    10831089
     1090JSValue jsTestObjAttribute(ExecState* exec, JSValue slotBase, PropertyName)
     1091{
     1092    JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     1093    UNUSED_PARAM(exec);
     1094    TestObj* impl = castedThis->impl();
     1095    JSValue result = jsStringWithCache(exec, impl->attribute());
     1096    return result;
     1097}
     1098
     1099
     1100JSValue jsTestObjAttributeWithReservedEnumType(ExecState* exec, JSValue slotBase, PropertyName)
     1101{
     1102    JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     1103    UNUSED_PARAM(exec);
     1104    TestObj* impl = castedThis->impl();
     1105    JSValue result = jsStringWithCache(exec, impl->attributeWithReservedEnumType());
     1106    return result;
     1107}
     1108
     1109
    10841110JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, PropertyName)
    10851111{
     
    17221748        return;
    17231749    impl->setNullableStringValue(nativeValue);
     1750}
     1751
     1752
     1753void setJSTestObjAttributeWithReservedEnumType(ExecState* exec, JSObject* thisObject, JSValue value)
     1754{
     1755    UNUSED_PARAM(exec);
     1756    JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     1757    TestObj* impl = castedThis->impl();
     1758    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
     1759    if (exec->hadException())
     1760        return;
     1761    if (nativeValue != "" && nativeValue != "OptionalValue1" && nativeValue != "OptionalValue2" && nativeValue != "OptionalValue3")
     1762        return;
     1763    impl->setAttributeWithReservedEnumType(nativeValue);
    17241764}
    17251765
     
    31433183}
    31443184
     3185EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(ExecState* exec)
     3186{
     3187    JSValue thisValue = exec->hostThisValue();
     3188    if (!thisValue.inherits(JSTestObj::info()))
     3189        return throwVMTypeError(exec);
     3190    JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
     3191    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     3192    TestObj* impl = castedThis->impl();
     3193    if (exec->argumentCount() < 2)
     3194        return throwVMError(exec, createNotEnoughArgumentsError(exec));
     3195    float a(exec->argument(0).toFloat(exec));
     3196    if (exec->hadException())
     3197        return JSValue::encode(jsUndefined());
     3198    int b(toInt32(exec, exec->argument(1), NormalConversion));
     3199    if (exec->hadException())
     3200        return JSValue::encode(jsUndefined());
     3201    impl->any(a, b);
     3202    return JSValue::encode(jsUndefined());
     3203}
     3204
    31453205void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
    31463206{
     
    32333293    UNUSED_PARAM(exec);
    32343294    return jsNumber(static_cast<int>(15));
     3295}
     3296
     3297JSValue jsTestObjReadonly(ExecState* exec, JSValue, PropertyName)
     3298{
     3299    UNUSED_PARAM(exec);
     3300    return jsNumber(static_cast<int>(0));
    32353301}
    32363302
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r156782 r156808  
    232232JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicDoubleMethod(JSC::ExecState*);
    233233JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicNodeMethod(JSC::ExecState*);
     234JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(JSC::ExecState*);
    234235// Attributes
    235236
     
    364365JSC::JSValue jsTestObjNullableStringValue(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
    365366void setJSTestObjNullableStringValue(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
     367JSC::JSValue jsTestObjAttribute(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
     368JSC::JSValue jsTestObjAttributeWithReservedEnumType(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
     369void setJSTestObjAttributeWithReservedEnumType(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
    366370JSC::JSValue jsTestObjConstructor(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
    367371// Constants
     
    382386JSC::JSValue jsTestObjCONST_VALUE_14(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
    383387JSC::JSValue jsTestObjCONST_JAVASCRIPT(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
     388JSC::JSValue jsTestObjReadonly(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
    384389
    385390} // namespace WebCore
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h

    r152569 r156808  
    6161    DOM_CONST_VALUE_13 = 0X20,
    6262    DOM_CONST_VALUE_14 = 0x1abc,
    63     DOM_CONST_JAVASCRIPT = 15
     63    DOM_CONST_JAVASCRIPT = 15,
     64    DOM_readonly = 0
    6465};
    6566
     
    124125@property int nullableLongSettableAttribute;
    125126@property int nullableStringValue;
     127@property(readonly, copy) NSString *attribute;
    126128
    127129- (void)voidMethod;
     
    189191- (void)variadicDoubleMethod:(double)head tail:(double)tail;
    190192- (void)variadicNodeMethod:(DOMNode *)head tail:(DOMNode *)tail;
     193- (void)any:(float)a b:(int)b;
    191194@end
    192195
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm

    r156580 r156808  
    800800}
    801801
     802- (NSString *)attribute
     803{
     804    WebCore::JSMainThreadNullState state;
     805    return IMPL->attribute();
     806}
     807
    802808- (void)voidMethod
    803809{
     
    11631169    WebCore::JSMainThreadNullState state;
    11641170    IMPL->variadicNodeMethod(core(head), core(tail));
     1171}
     1172
     1173- (void)any:(float)a b:(int)b
     1174{
     1175    WebCore::JSMainThreadNullState state;
     1176    IMPL->any(a, b);
    11651177}
    11661178
  • trunk/Source/WebCore/bindings/scripts/test/TestException.idl

    r131145 r156808  
    2929   readonly attribute DOMString name;
    3030};
     31
     32// Identifiers with a leading underscore, which should be removed.
     33exception _attribute {
     34   readonly attribute DOMString _readonly;
     35};
  • trunk/Source/WebCore/bindings/scripts/test/TestInterface.idl

    r151896 r156808  
    4343TestInterface implements TestImplements;
    4444
     45[
     46    ImplementationLacksVTable
     47] interface _readonly {
     48};
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r156175 r156808  
    3333enum TestEnumType { "", "EnumValue1", "EnumValue2", "EnumValue3" };
    3434
     35// Leading underscore on an enum should be removed.
     36enum _optional { "", "OptionalValue1", "OptionalValue2", "OptionalValue3" };
     37
    3538[
    3639    Constructor(TestCallback testCallback),
     
    265268
    266269    [GetterRaisesException] attribute long? nullableStringValue;
     270
     271    // Identifiers with a leading underscore, which should be removed.
     272    const unsigned short               _readonly = 0;
     273    readonly attribute DOMString       _attribute;
     274    attribute _optional                attributeWithReservedEnumType;
     275    void _any(float a, long b);
    267276};
    268277
Note: See TracChangeset for help on using the changeset viewer.