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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15986

--- Comment #7 from Cameron McCormack <cam@mcc.id.au> 2012-02-14 23:55:48 UTC ---
Yes, argument values are consistently evaluated/converted left to right. 
Regarding invoking the overload resolution algorithm even when there is only a
single operation, consider the following.  Assume we didn't call the overload
resolution algorithm with a single operation, and start with:

  void f(long x, Node n);

Call f({ valueOf: function() { throw "hi" }}, window).  This will result in
"hi" being thrown, since we just do the argument conversion from left to right
without checking the values that were passed in before doing the conversions.

If we add an overload:

  void f(long x, Node n);
  void f();

then calling f({ valueOf: function() { throw "hi" }}, window) will now throw a
TypeError due to there being no appropriate overload (window didn't match
Node).

I think it is preferable to avoid this kind of behaviour change for existing
calls when introducing a new overload.

-- 
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, 14 February 2012 23:55:50 UTC