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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 14 15:01:16 PDT 2013


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





--- Comment #35 from Glenn Maynard <glenn at zewt.org>  2013-04-14 14:59:31 PST ---
> However, by contrast, the core implementation of the `log()` function, as far as I'm aware, could not possibly be borrowed and reused against any random JS object in any useful way, 

Two problems:

- This isn't something special about console.  Calling Element.prototype.appendChild on something that isn't an Element, or Worker.prototype.terminate on something that isn't a Worker, doesn't make any more sense than calling console.log on something that isn't a console.  If we take "not useful to call on random objects" as a reason to do this, then we'll be doing it with tons of APIs--which is why we shouldn't.
- This isn't a reason why methods on other APIs aren't bound to their object.  After all, if you do want to call a method--say, appendChild--on an interface on something other than an instance of the object, you wouldn't say "document.appendChild.call(otherObject, node)", you get the method from the interface: "HTMLElement.prototype.appendChild.call(otherObject, node)".  Binding the functions wouldn't prevent this, but we still don't do it.

I'm running low on time and energy for this, and if the discussion so far hasn't convinced whoever in WebKit's process needs to be convinced, I don't think another five pages of discussion will help.  So, unless new information arises, I'll be winding down in this discussion for now.

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