[Webkit-unassigned] [Bug 20141] Cannot call pointer to function console.log

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 11 19:19:47 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=20141





--- Comment #19 from Glenn Maynard <glenn at zewt.org>  2013-04-11 19:18:01 PST ---
This shouldn't work.  Comment #7 is solved simply by using bind(); calling a bound console function does work as expected (it may not have back in 2010, but it does today).

You can't pull random member functions off of objects and have it work.  You can't say "g = document.getElementById; g('foo')".  That's what bind() is for.

This might make a little sense if console.log acted like a static function (eg. if it didn't actually care about the console object), but it doesn't; which console.log you call determines which console it goes to.  Please don't add new weird things to the web.

(In reply to comment #12)
> In order to achieve this, the patch introduces the [LenientThis] WebKitIDL attribute, which is heavily inspired from the LenientThis WebIDL.
> http://www.w3.org/TR/WebIDL/#LenientThis

Notice that WebIDL has a big angry red box explicitly warning against this.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list