[webkit-dev] Adding LenientThis to WebKitIDL

Victor Costan costan at gmail.com
Wed Apr 10 15:24:37 PDT 2013


Thank you for the very quick response, Ryosuke!

My main concerns with custom binding code is that I'd like to cover
the related functions in console (debug, error, info, warn, dir,
dirxml, table, trace, count), and I think something like LenientThis
can be useful for making other functions more developer-friendly in
the future.

Should I still use custom bindings? I'm pretty sure it'll make this
patch easier for me :)

Thank you very much for your advice!
    Victor


On Wed, Apr 10, 2013 at 6:03 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> You can also write a custom binding code instead of adding a new IDL keyword
> for this specific use case.
>
> - R. Niwa
>
>
> On Wed, Apr 10, 2013 at 3:02 PM, Victor Costan <costan at gmail.com> wrote:
>>
>> Dear WebKit devs,
>>
>>
>> I would like to make console.log and related functions work without
>> requiring that "this" is set to the console object. This would make
>> debugging from Web Inspector easier, because console.log could be
>> passed directly to functions that require a callback, instead of
>> having to pass function(arg) { console.log(arg); }
>>
>> In order to make this happen, I need a static method that shows up on
>> the console object (or its prototype). The closest thing I could find
>> in WebIDL is the [LenientThis] attribute. In WebIDL it's only intended
>> for attributes, but I think it would be very useful for methods.
>>
>> If it makes a difference, Firefox supports using console.log without
>> "this" being the console object, and this feature has been requested
>> on the Chromium bug tracker, so it is useful to people other than
>> myself.
>>
>>
>> Before I embark on a quest to learn Perl so I can change the code
>> generator, I would like to check if this is worthwhile. Would a patch
>> along these lines be considered for WebKit? Is there another
>> established pattern for achieving my goal? (e.g. some form of const
>> attribute that returns a function?)
>>
>> Thank you very much for your help,
>>     Victor
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
>
>


More information about the webkit-dev mailing list