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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 14 12:43:06 PDT 2013


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





--- Comment #29 from Kyle Simpson <getify at gmail.com>  2013-04-14 12:41:21 PST ---
I really can't think of any reason for the `log()` function (and all the other console.*) to be "unbound", or rather, rebindable, to other objects. Why wouldn't you just want all of them to act as if they're hard bound to the console and/or window object? What use case would it serve to leave them re-bindable (whereas several use-cases in this thread have already pointed out shorter typing and nicer abstractability as reasons why the defaulted hard-binding would be nice)?

I understand the general argument of "so it works like all other methods", but in JS in general, there's lots of usefulness to be able to borrow functions and manually set their `this` object... except in the specific case of the console.* functions, I'm just not seeing that usefulness. Am I missing something we'd want to preserve?

Seems to me like the lesser evil would be to remove some surprises from the use cases stated here, at the almost zero cost/risk of surprising someone who's intentionally doing something very strange like trying to rebind `log()` to some other object.

-- 
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