Changeset 202275 in webkit


Ignore:
Timestamp:
Jun 21, 2016 8:44:50 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Add bindings generator support to add a native JS function to both a 'name' and a private '@name' slot
https://bugs.webkit.org/show_bug.cgi?id=158777

Patch by Youenn Fablet <youennf@gmail.com> on 2016-06-21
Reviewed by Eric Carlson.

Adding a new PublicIdentifier keyword to cover the case of the same function exposed publicly and privately.
Renaming Private keyword to PrivateIdentifier.
Functions exposed both publicly and privately should set both keywords.
By default, functions are publically exposed.

Updated binding generator to generate public exposure except if PrivateIdentifer is set and PublicIdentifier is
not set.

Keeping skipping of ObjC/GObject binding for PrivateIdentifier-only functions.

Covered by rebased binding tests.

  • Modules/fetch/FetchHeaders.idl:
  • Modules/fetch/FetchResponse.idl:
  • Modules/mediastream/MediaDevices.idl:
  • Modules/mediastream/RTCPeerConnection.idl:
  • bindings/scripts/CodeGeneratorGObject.pm:

(SkipFunction):

  • bindings/scripts/CodeGeneratorJS.pm:

(GeneratePropertiesHashTable):
(GenerateImplementation):

  • bindings/scripts/CodeGeneratorObjC.pm:

(SkipFunction):

  • bindings/scripts/IDLAttributes.txt:
  • bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:

(webkit_dom_test_obj_private_also_method):

  • bindings/scripts/test/GObject/WebKitDOMTestObj.h:
  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionPrivateMethod):
(WebCore::jsTestObjPrototypeFunctionPrivateAlsoMethod):

  • bindings/scripts/test/ObjC/DOMTestObj.h:
  • bindings/scripts/test/ObjC/DOMTestObj.mm:

(-[DOMTestObj privateAlsoMethod:]):

  • bindings/scripts/test/TestObj.idl:
Location:
trunk/Source/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202274 r202275  
     12016-06-21  Youenn Fablet  <youennf@gmail.com>
     2
     3        Add bindings generator support to add a native JS function to both a 'name' and a private '@name' slot
     4        https://bugs.webkit.org/show_bug.cgi?id=158777
     5
     6        Reviewed by Eric Carlson.
     7
     8        Adding a new PublicIdentifier keyword to cover the case of the same function exposed publicly and privately.
     9        Renaming Private keyword to PrivateIdentifier.
     10        Functions exposed both publicly and privately should set both keywords.
     11        By default, functions are publically exposed.
     12
     13        Updated binding generator to generate public exposure except if PrivateIdentifer is set and PublicIdentifier is
     14        not set.
     15
     16        Keeping skipping of ObjC/GObject binding for PrivateIdentifier-only functions.
     17
     18        Covered by rebased binding tests.
     19
     20        * Modules/fetch/FetchHeaders.idl:
     21        * Modules/fetch/FetchResponse.idl:
     22        * Modules/mediastream/MediaDevices.idl:
     23        * Modules/mediastream/RTCPeerConnection.idl:
     24        * bindings/scripts/CodeGeneratorGObject.pm:
     25        (SkipFunction):
     26        * bindings/scripts/CodeGeneratorJS.pm:
     27        (GeneratePropertiesHashTable):
     28        (GenerateImplementation):
     29        * bindings/scripts/CodeGeneratorObjC.pm:
     30        (SkipFunction):
     31        * bindings/scripts/IDLAttributes.txt:
     32        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
     33        (webkit_dom_test_obj_private_also_method):
     34        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
     35        * bindings/scripts/test/JS/JSTestObj.cpp:
     36        (WebCore::JSTestObjPrototype::finishCreation):
     37        (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
     38        (WebCore::jsTestObjPrototypeFunctionPrivateAlsoMethod):
     39        * bindings/scripts/test/ObjC/DOMTestObj.h:
     40        * bindings/scripts/test/ObjC/DOMTestObj.mm:
     41        (-[DOMTestObj privateAlsoMethod:]):
     42        * bindings/scripts/test/TestObj.idl:
     43
    1442016-06-21  Dan Bernstein  <mitz@apple.com>
    245
  • trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl

    r199587 r202275  
    4444    iterable<DOMString, DOMString>;
    4545
    46     [Private, RaisesException, ImplementedAs=append] void appendFromJS(DOMString name, DOMString value);
    47     [Private, ImplementedAs=fill] void fillFromJS(FetchHeaders? headers);
     46    [PrivateIdentifier, RaisesException, ImplementedAs=append] void appendFromJS(DOMString name, DOMString value);
     47    [PrivateIdentifier, ImplementedAs=fill] void fillFromJS(FetchHeaders? headers);
    4848};
  • trunk/Source/WebCore/Modules/fetch/FetchResponse.idl

    r199641 r202275  
    5555    [NewObject, CallWith=ScriptExecutionContext, RaisesException] FetchResponse clone();
    5656
    57     [Private, RaisesException] void initializeWith(Dictionary parameters);
     57    [PrivateIdentifier, RaisesException] void initializeWith(Dictionary parameters);
    5858};
    5959FetchResponse implements FetchBody;
  • trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl

    r192602 r202275  
    3838    [RaisesException] Promise enumerateDevices();
    3939
    40     [Private, RaisesException, ImplementedAs=getUserMedia] Promise getUserMediaFromJS(Dictionary options);
     40    [PrivateIdentifier, RaisesException, ImplementedAs=getUserMedia] Promise getUserMediaFromJS(Dictionary options);
    4141};
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r202109 r202275  
    9898    // Private API used to implement the overloaded operations above. Queued functions are called by
    9999    // runQueuedOperation() (defined in RTCPeerConnectionInternals.js).
    100     [Private] Promise queuedCreateOffer(optional Dictionary offerOptions);
    101     [Private] Promise queuedCreateAnswer(optional Dictionary answerOptions);
    102     [Private] Promise queuedSetLocalDescription(RTCSessionDescription description);
    103     [Private] Promise queuedSetRemoteDescription(RTCSessionDescription description);
    104     [Private] Promise queuedAddIceCandidate(RTCIceCandidate candidate);
    105     [Private] Promise privateGetStats(MediaStreamTrack? selector);
     100    [PrivateIdentifier] Promise queuedCreateOffer(optional Dictionary offerOptions);
     101    [PrivateIdentifier] Promise queuedCreateAnswer(optional Dictionary answerOptions);
     102    [PrivateIdentifier] Promise queuedSetLocalDescription(RTCSessionDescription description);
     103    [PrivateIdentifier] Promise queuedSetRemoteDescription(RTCSessionDescription description);
     104    [PrivateIdentifier] Promise queuedAddIceCandidate(RTCIceCandidate candidate);
     105    [PrivateIdentifier] Promise privateGetStats(MediaStreamTrack? selector);
    106106
    107107    [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional Dictionary options);
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r201988 r202275  
    385385    return 1 if $function->signature->extendedAttributes->{"JSBuiltin"};
    386386
    387     return 1 if $function->signature->extendedAttributes->{"Private"};
    388 
     387    return 1 if $function->signature->extendedAttributes->{"PrivateIdentifier"} and not $function->signature->extendedAttributes->{"PublicIdentifier"};
    389388    return 0;
    390389}
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r202268 r202275  
    16191619    push(@functions, @{$interface->iterable->functions}) if $interface->iterable;
    16201620    foreach my $function (@functions) {
    1621         next if ($function->signature->extendedAttributes->{"Private"});
     1621        next if ($function->signature->extendedAttributes->{"PrivateIdentifier"} and not $function->signature->extendedAttributes->{"PublicIdentifier"});
    16221622        next if ($function->isStatic);
    16231623        next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
     
    22962296        my $firstPrivateFunction = 1;
    22972297        foreach my $function (@{$interface->functions}) {
    2298             next unless ($function->signature->extendedAttributes->{"Private"});
     2298            next unless ($function->signature->extendedAttributes->{"PrivateIdentifier"});
    22992299            AddToImplIncludes("WebCoreJSClientData.h");
    23002300            push(@implContent, "    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);\n") if $firstPrivateFunction;
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r201988 r202275  
    551551    }
    552552
    553     return 1 if $function->signature->extendedAttributes->{"Private"};
     553    return 1 if $function->signature->extendedAttributes->{"PrivateIdentifier"} and not $function->signature->extendedAttributes->{"PublicIdentifier"};
    554554
    555555    return 0;
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r200236 r202275  
    107107OverrideBuiltins
    108108PassContext
    109 Private
     109PrivateIdentifier
     110PublicIdentifier
    110111PutForwards=*
    111112RaisesException
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp

    r201988 r202275  
    14951495}
    14961496
     1497gchar* webkit_dom_test_obj_public_and_private_method(WebKitDOMTestObj* self, const gchar* argument)
     1498{
     1499    WebCore::JSMainThreadNullState state;
     1500    g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
     1501    g_return_val_if_fail(argument, 0);
     1502    WebCore::TestObj* item = WebKit::core(self);
     1503    WTF::String convertedArgument = WTF::String::fromUTF8(argument);
     1504    gchar* result = convertToUTF8String(item->publicAndPrivateMethod(convertedArgument));
     1505    return result;
     1506}
     1507
    14971508void webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
    14981509{
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h

    r201988 r202275  
    395395
    396396/**
     397 * webkit_dom_test_obj_public_and_private_method:
     398 * @self: A #WebKitDOMTestObj
     399 * @argument: A #gchar
     400 *
     401 * Returns: A #gchar
     402 *
     403 * Stability: Unstable
     404**/
     405WEBKIT_API gchar*
     406webkit_dom_test_obj_public_and_private_method(WebKitDOMTestObj* self, const gchar* argument);
     407
     408/**
    397409 * webkit_dom_test_obj_with_script_state_void:
    398410 * @self: A #WebKitDOMTestObj
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r202268 r202275  
    608608JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(JSC::ExecState*);
    609609JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionPrivateMethod(JSC::ExecState*);
     610JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionPublicAndPrivateMethod(JSC::ExecState*);
    610611JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(JSC::ExecState*);
    611612JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(JSC::ExecState*);
     
    10611062    { 65, -1 },
    10621063    { -1, -1 },
    1063     { 138, -1 },
     1064    { 139, -1 },
    10641065    { -1, -1 },
    10651066    { 21, 513 },
     
    10701071    { -1, -1 },
    10711072    { 63, -1 },
    1072     { 203, -1 },
    1073     { 187, -1 },
     1073    { 204, -1 },
     1074    { 188, -1 },
    10741075    { 56, -1 },
    10751076    { -1, -1 },
     
    10771078    { -1, -1 },
    10781079    { -1, -1 },
    1079     { 140, -1 },
    1080     { -1, -1 },
    1081     { -1, -1 },
    1082     { -1, -1 },
    1083     { -1, -1 },
    1084     { 115, -1 },
    1085     { -1, -1 },
    1086     { 129, -1 },
     1080    { 141, -1 },
     1081    { -1, -1 },
     1082    { -1, -1 },
     1083    { -1, -1 },
     1084    { -1, -1 },
     1085    { 116, -1 },
     1086    { -1, -1 },
     1087    { 130, -1 },
    10871088    { -1, -1 },
    10881089    { 79, -1 },
     
    10911092    { -1, -1 },
    10921093    { -1, -1 },
    1093     { 132, 533 },
    1094     { -1, -1 },
    1095     { -1, -1 },
    1096     { -1, -1 },
    1097     { -1, -1 },
    1098     { -1, -1 },
    1099     { -1, -1 },
    1100     { -1, -1 },
    1101     { -1, -1 },
    1102     { 149, -1 },
     1094    { 133, 533 },
     1095    { -1, -1 },
     1096    { -1, -1 },
     1097    { -1, -1 },
     1098    { -1, -1 },
     1099    { -1, -1 },
     1100    { -1, -1 },
     1101    { -1, -1 },
     1102    { -1, -1 },
     1103    { 150, -1 },
    11031104    { 34, 525 },
    11041105    { -1, -1 },
     
    11081109    { -1, -1 },
    11091110    { -1, -1 },
    1110     { 170, -1 },
    1111     { -1, -1 },
    1112     { -1, -1 },
    1113     { -1, -1 },
     1111    { 171, -1 },
     1112    { -1, -1 },
     1113    { -1, -1 },
     1114    { -1, -1 },
     1115    { 115, -1 },
    11141116    { 114, -1 },
    1115     { 113, -1 },
    11161117    { -1, -1 },
    11171118    { -1, -1 },
     
    11261127    { -1, -1 },
    11271128    { 5, -1 },
    1128     { 178, -1 },
     1129    { 179, -1 },
    11291130    { -1, -1 },
    11301131    { -1, -1 },
     
    11401141    { -1, -1 },
    11411142    { -1, -1 },
    1142     { 106, -1 },
     1143    { 107, -1 },
    11431144    { 97, -1 },
    11441145    { -1, -1 },
     
    11511152    { -1, -1 },
    11521153    { 9, -1 },
    1153     { 164, -1 },
     1154    { 165, -1 },
    11541155    { -1, -1 },
    11551156    { -1, -1 },
     
    11571158    { 90, -1 },
    11581159    { -1, -1 },
    1159     { 157, -1 },
     1160    { 158, -1 },
    11601161    { -1, -1 },
    11611162    { -1, -1 },
    11621163    { 84, -1 },
    1163     { 200, -1 },
     1164    { 201, -1 },
    11641165    { -1, -1 },
    11651166    { 31, 530 },
     
    11711172    { -1, -1 },
    11721173    { -1, -1 },
    1173     { 184, -1 },
    1174     { -1, -1 },
    1175     { -1, -1 },
    1176     { 131, 547 },
    1177     { 109, -1 },
    1178     { -1, -1 },
    1179     { -1, -1 },
    1180     { -1, -1 },
    1181     { 153, -1 },
     1174    { 185, -1 },
     1175    { -1, -1 },
     1176    { -1, -1 },
     1177    { 132, 547 },
     1178    { 110, -1 },
     1179    { -1, -1 },
     1180    { -1, -1 },
     1181    { -1, -1 },
     1182    { 154, -1 },
    11821183    { -1, -1 },
    11831184    { 6, -1 },
    1184     { 130, -1 },
     1185    { 131, -1 },
    11851186    { -1, -1 },
    11861187    { -1, -1 },
     
    11941195    { 1, -1 },
    11951196    { -1, -1 },
    1196     { 144, -1 },
     1197    { 145, -1 },
    11971198    { 48, -1 },
    11981199    { 67, -1 },
    11991200    { -1, -1 },
    1200     { 201, -1 },
     1201    { 202, -1 },
    12011202    { -1, -1 },
    12021203    { -1, -1 },
    12031204    { -1, -1 },
    12041205    { 39, -1 },
    1205     { 124, 532 },
     1206    { 125, 532 },
    12061207    { -1, -1 },
    12071208    { 103, -1 },
     
    12111212    { -1, -1 },
    12121213    { -1, -1 },
    1213     { 171, -1 },
    1214     { 163, -1 },
    1215     { -1, -1 },
    1216     { -1, -1 },
    1217     { -1, -1 },
    1218     { 202, -1 },
     1214    { 172, -1 },
     1215    { 164, -1 },
     1216    { -1, -1 },
     1217    { -1, -1 },
     1218    { -1, -1 },
     1219    { 203, -1 },
    12191220    { -1, -1 },
    12201221    { -1, -1 },
     
    12221223    { -1, -1 },
    12231224    { -1, -1 },
    1224     { 145, -1 },
    1225     { -1, -1 },
     1225    { 146, -1 },
     1226    { 106, -1 },
    12261227    { -1, -1 },
    12271228    { -1, -1 },
     
    12391240    { -1, -1 },
    12401241    { -1, -1 },
    1241     { 156, -1 },
    1242     { 142, -1 },
    1243     { -1, -1 },
    1244     { -1, -1 },
    1245     { -1, -1 },
    1246     { -1, -1 },
    1247     { 125, -1 },
    1248     { -1, -1 },
    1249     { -1, -1 },
    1250     { -1, -1 },
    1251     { 180, 545 },
     1242    { 157, -1 },
     1243    { 143, -1 },
     1244    { -1, -1 },
     1245    { -1, -1 },
     1246    { -1, -1 },
     1247    { -1, -1 },
     1248    { 126, -1 },
     1249    { -1, -1 },
     1250    { -1, -1 },
     1251    { -1, -1 },
     1252    { 181, 545 },
    12521253    { 99, 541 },
    12531254    { -1, -1 },
     
    12931294    { 10, 512 },
    12941295    { -1, -1 },
    1295     { 174, -1 },
     1296    { 175, -1 },
    12961297    { -1, -1 },
    12971298    { 75, 543 },
    1298     { 179, -1 },
    1299     { -1, -1 },
    1300     { -1, -1 },
    1301     { -1, -1 },
    1302     { -1, -1 },
    1303     { 118, 549 },
    1304     { -1, -1 },
    1305     { -1, -1 },
    1306     { -1, -1 },
    1307     { 175, -1 },
    1308     { -1, -1 },
    1309     { 116, -1 },
     1299    { 180, -1 },
     1300    { -1, -1 },
     1301    { -1, -1 },
     1302    { -1, -1 },
     1303    { -1, -1 },
     1304    { 119, 549 },
     1305    { -1, -1 },
     1306    { -1, -1 },
     1307    { -1, -1 },
     1308    { 176, -1 },
     1309    { -1, -1 },
     1310    { 117, -1 },
    13101311    { -1, -1 },
    13111312    { -1, -1 },
     
    13201321    { -1, -1 },
    13211322    { -1, -1 },
    1322     { 152, -1 },
     1323    { 153, -1 },
    13231324    { 100, -1 },
    1324     { 161, -1 },
     1325    { 162, -1 },
    13251326    { -1, -1 },
    13261327    { -1, -1 },
     
    13321333    { -1, -1 },
    13331334    { 49, -1 },
    1334     { 182, -1 },
     1335    { 183, -1 },
    13351336    { 23, -1 },
    13361337    { -1, -1 },
     
    13381339    { -1, -1 },
    13391340    { -1, -1 },
    1340     { 192, -1 },
    1341     { -1, -1 },
    1342     { -1, -1 },
    1343     { 158, -1 },
    1344     { -1, -1 },
    1345     { -1, -1 },
    1346     { -1, -1 },
    1347     { 117, -1 },
    1348     { -1, -1 },
    1349     { -1, -1 },
    1350     { -1, -1 },
    1351     { -1, -1 },
    1352     { -1, -1 },
    1353     { 172, -1 },
    1354     { 167, -1 },
     1341    { 193, -1 },
     1342    { -1, -1 },
     1343    { -1, -1 },
     1344    { 159, -1 },
     1345    { -1, -1 },
     1346    { -1, -1 },
     1347    { -1, -1 },
     1348    { 118, -1 },
     1349    { -1, -1 },
     1350    { -1, -1 },
     1351    { -1, -1 },
     1352    { -1, -1 },
     1353    { -1, -1 },
     1354    { 173, -1 },
     1355    { 168, -1 },
    13551356    { -1, -1 },
    13561357    { -1, -1 },
     
    13591360    { -1, -1 },
    13601361    { -1, -1 },
    1361     { 185, -1 },
     1362    { 186, -1 },
    13621363    { -1, -1 },
    13631364    { 82, 535 },
     
    13931394    { 0, -1 },
    13941395    { -1, -1 },
    1395     { 112, -1 },
     1396    { 113, -1 },
    13961397    { -1, -1 },
    13971398    { -1, -1 },
     
    14021403    { -1, -1 },
    14031404    { -1, -1 },
    1404     { 143, 542 },
     1405    { 144, 542 },
    14051406    { -1, -1 },
    14061407    { 50, 546 },
     
    14101411    { -1, -1 },
    14111412    { -1, -1 },
    1412     { 196, 550 },
     1413    { 197, 550 },
    14131414    { 17, -1 },
    14141415    { -1, -1 },
     
    14331434    { 18, 514 },
    14341435    { -1, -1 },
    1435     { 193, -1 },
     1436    { 194, -1 },
    14361437    { -1, -1 },
    14371438    { 2, 519 },
     
    14411442    { -1, -1 },
    14421443    { -1, -1 },
    1443     { 108, -1 },
     1444    { 109, -1 },
    14441445    { -1, -1 },
    14451446    { -1, -1 },
     
    14531454    { -1, -1 },
    14541455    { 53, 526 },
    1455     { 190, -1 },
     1456    { 191, -1 },
    14561457    { -1, -1 },
    14571458    { -1, -1 },
    14581459    { 74, -1 },
    1459     { 198, -1 },
    1460     { -1, -1 },
    1461     { -1, -1 },
    1462     { 122, 540 },
    1463     { -1, -1 },
    1464     { 127, -1 },
    1465     { -1, -1 },
    1466     { -1, -1 },
    1467     { -1, -1 },
    1468     { 136, -1 },
     1460    { 199, -1 },
     1461    { -1, -1 },
     1462    { -1, -1 },
     1463    { 123, 540 },
     1464    { -1, -1 },
     1465    { 128, -1 },
     1466    { -1, -1 },
     1467    { -1, -1 },
     1468    { -1, -1 },
     1469    { 137, -1 },
    14691470    { 19, -1 },
    14701471    { 25, 544 },
    1471     { 137, -1 },
    1472     { -1, -1 },
    1473     { -1, -1 },
    1474     { 133, -1 },
     1472    { 138, -1 },
     1473    { -1, -1 },
     1474    { -1, -1 },
     1475    { 134, -1 },
    14751476    { -1, -1 },
    14761477    { -1, -1 },
     
    14781479    { -1, -1 },
    14791480    { 101, -1 },
    1480     { 181, -1 },
    1481     { -1, -1 },
    1482     { -1, -1 },
    1483     { -1, -1 },
    1484     { 148, -1 },
     1481    { 182, -1 },
     1482    { -1, -1 },
     1483    { -1, -1 },
     1484    { -1, -1 },
     1485    { 149, -1 },
    14851486    { -1, -1 },
    14861487    { 16, -1 },
     
    14911492    { 96, -1 },
    14921493    { -1, -1 },
    1493     { 159, -1 },
     1494    { 160, -1 },
    14941495    { -1, -1 },
    14951496    { -1, -1 },
     
    15031504    { -1, -1 },
    15041505    { -1, -1 },
    1505     { 191, -1 },
     1506    { 192, -1 },
    15061507    { 68, -1 },
    15071508    { -1, -1 },
    15081509    { 80, -1 },
    1509     { 176, -1 },
     1510    { 177, -1 },
    15101511    { -1, -1 },
    15111512    { -1, -1 },
     
    15181519    { -1, -1 },
    15191520    { -1, -1 },
    1520     { 120, 528 },
     1521    { 121, 528 },
    15211522    { 37, -1 },
    15221523    { -1, -1 },
    1523     { 123, -1 },
     1524    { 124, -1 },
    15241525    { 52, 536 },
    15251526    { -1, -1 },
     
    15281529    { 59, -1 },
    15291530    { -1, -1 },
    1530     { 188, -1 },
     1531    { 189, -1 },
    15311532    { -1, -1 },
    15321533    { 105, -1 },
     
    15421543    { 15, 516 },
    15431544    { 55, -1 },
    1544     { 119, 534 },
     1545    { 120, 534 },
    15451546    { -1, -1 },
    15461547    { 7, 537 },
    15471548    { -1, -1 },
    15481549    { -1, -1 },
    1549     { 121, -1 },
     1550    { 122, -1 },
    15501551    { 81, 523 },
    15511552    { -1, -1 },
    1552     { 166, -1 },
     1553    { 167, -1 },
    15531554    { 89, -1 },
    15541555    { -1, -1 },
    15551556    { -1, -1 },
    15561557    { -1, -1 },
    1557     { 160, -1 },
     1558    { 161, -1 },
    15581559    { -1, -1 },
    15591560    { 12, 520 },
     
    15701571    { 95, -1 },
    15711572    { 102, -1 },
    1572     { 107, -1 },
    1573     { 110, -1 },
     1573    { 108, -1 },
    15741574    { 111, -1 },
    1575     { 126, -1 },
    1576     { 128, -1 },
    1577     { 134, -1 },
     1575    { 112, -1 },
     1576    { 127, -1 },
     1577    { 129, -1 },
    15781578    { 135, -1 },
    1579     { 139, -1 },
    1580     { 141, -1 },
    1581     { 146, -1 },
     1579    { 136, -1 },
     1580    { 140, -1 },
     1581    { 142, -1 },
    15821582    { 147, -1 },
    1583     { 150, -1 },
     1583    { 148, -1 },
    15841584    { 151, -1 },
    1585     { 154, -1 },
     1585    { 152, -1 },
    15861586    { 155, -1 },
    1587     { 162, -1 },
    1588     { 165, -1 },
    1589     { 168, -1 },
     1587    { 156, -1 },
     1588    { 163, -1 },
     1589    { 166, -1 },
    15901590    { 169, -1 },
    1591     { 173, -1 },
    1592     { 177, -1 },
    1593     { 183, -1 },
    1594     { 186, -1 },
    1595     { 189, -1 },
    1596     { 194, -1 },
     1591    { 170, -1 },
     1592    { 174, -1 },
     1593    { 178, -1 },
     1594    { 184, -1 },
     1595    { 187, -1 },
     1596    { 190, -1 },
    15971597    { 195, -1 },
    1598     { 197, -1 },
    1599     { 199, -1 },
     1598    { 196, -1 },
     1599    { 198, -1 },
     1600    { 200, -1 },
    16001601};
    16011602
     
    17451746    { 0, 0, NoIntrinsic, { 0, 0 } },
    17461747#endif
     1748    { "publicAndPrivateMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionPublicAndPrivateMethod), (intptr_t) (1) } },
    17471749    { "addEventListener", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t) (2) } },
    17481750    { "removeEventListener", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t) (2) } },
     
    18611863};
    18621864
    1863 static const HashTable JSTestObjPrototypeTable = { 204, 511, true, JSTestObjPrototypeTableValues, JSTestObjPrototypeTableIndex };
     1865static const HashTable JSTestObjPrototypeTable = { 205, 511, true, JSTestObjPrototypeTableValues, JSTestObjPrototypeTableIndex };
    18641866const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, CREATE_METHOD_TABLE(JSTestObjPrototype) };
    18651867
     
    18841886    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
    18851887    putDirect(vm, clientData.builtinNames().privateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPrivateMethod), ReadOnly | DontEnum);
     1888    putDirect(vm, clientData.builtinNames().publicAndPrivateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPublicAndPrivateMethod), ReadOnly | DontEnum);
    18861889    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral("[Symbol.Iterator]"), jsTestObjPrototypeFunctionSymbolIterator), ReadOnly | DontEnum);
    18871890}
     
    49424945        return JSValue::encode(jsUndefined());
    49434946    JSValue result = jsStringWithCache(state, impl.privateMethod(WTFMove(argument)));
     4947    return JSValue::encode(result);
     4948}
     4949
     4950EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionPublicAndPrivateMethod(ExecState* state)
     4951{
     4952    JSValue thisValue = state->thisValue();
     4953    auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     4954    if (UNLIKELY(!castedThis))
     4955        return throwThisTypeError(*state, "TestObj", "publicAndPrivateMethod");
     4956    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     4957    auto& impl = castedThis->wrapped();
     4958    if (UNLIKELY(state->argumentCount() < 1))
     4959        return throwVMError(state, createNotEnoughArgumentsError(state));
     4960    auto argument = state->argument(0).toWTFString(state);
     4961    if (UNLIKELY(state->hadException()))
     4962        return JSValue::encode(jsUndefined());
     4963    JSValue result = jsStringWithCache(state, impl.publicAndPrivateMethod(WTFMove(argument)));
    49444964    return JSValue::encode(result);
    49454965}
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h

    r201988 r202275  
    164164- (void)customMethod;
    165165- (void)customMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
     166- (NSString *)publicAndPrivateMethod:(NSString *)argument;
    166167- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
    167168- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm

    r201988 r202275  
    12391239#endif
    12401240
     1241- (NSString *)publicAndPrivateMethod:(NSString *)argument
     1242{
     1243    WebCore::JSMainThreadNullState state;
     1244    return IMPL->publicAndPrivateMethod(argument);
     1245}
     1246
    12411247- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
    12421248{
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r201237 r202275  
    151151
    152152    // Private extended attribute
    153     [Private] DOMString privateMethod(DOMString argument);
     153    [PrivateIdentifier] DOMString privateMethod(DOMString argument);
     154    [PrivateIdentifier, PublicIdentifier] DOMString publicAndPrivateMethod(DOMString argument);
    154155
    155156    void addEventListener(DOMString type, EventListener listener, optional boolean useCapture = false);
Note: See TracChangeset for help on using the changeset viewer.