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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 14 13:32:16 PDT 2013


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





--- Comment #30 from Glenn Maynard <glenn at zewt.org>  2013-04-14 13:30:31 PST ---
(In reply to comment #29)
> 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)?

The burden of showing use cases is on people arguing to do something unusual, not on the ones saying we shouldn't, just as you don't get to say "what are the use cases for *not* implementing my feature proposal?".

("Shorter typing" to save 14 characters in uncommon scenarios isn't something that I can take seriously, and I don't know what you mean by "nicer abstractability".)

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

Am I missing something that makes the console functions special and different from everything else?  It's just another API like any other, and a particularly simple and mundane one at that.

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

This is a non-argument, since you could make it for pretty much every API on the platform.

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