W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

[Bug 15986] Specify exactly how and when ECMAScript arguments are evaluated

From: <bugzilla@jessica.w3.org>
Date: Tue, 13 Mar 2012 16:57:38 +0000
To: public-script-coord@w3.org
Message-Id: <E1S7V2Y-00047z-H9@jessica.w3.org>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15986

--- Comment #20 from Aryeh Gregor <ayg@aryeh.name> 2012-03-13 16:57:32 UTC ---
(In reply to comment #19)
> What are the concrete bad things about the current overload resolution
> algorithm?

I think the major bad thing is that arguments are evaluated an unpredictable
number of times.  If I call a WebIDL operation on an object with valueOf, I
expect it to be called either zero times or once, and predictably so.  The
simplest thing would be to evaluate all arguments in advance, but I guess we
can't do that because it would require knowing in advance which arguments we
need to convert to primitives and which we want to leave as-is.

But frankly this is a relatively marginal concern.  At this point I think we've
spent about as much effort on it as it deserves, if not more.  If the current
spec is unambiguous and makes enough sense in common cases, I don't have a
problem with leaving it alone.  The problem is a lot hairier than I had
initially assumed, because I hadn't thought about the fact that identifying the
type of an object can have side-effects in JS.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Tuesday, 13 March 2012 16:57:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:05 UTC