[webkit-dev] Adding LenientThis to WebKitIDL

Ryosuke Niwa rniwa at webkit.org
Wed Apr 10 15:03:57 PDT 2013

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130410/01eb4a1d/attachment.html>

More information about the webkit-dev mailing list