Status: Untriaged
Owner: ----

New issue 4264 by [email protected]: Function.arguments object is overwritten when it shouldn't.
https://code.google.com/p/v8/issues/detail?id=4264

Look at the following code.

  function func( a, b, c, d) {
    var arguments = "FAIL";
return a + b + c + d + " " + Array.prototype.slice.call(func.arguments, 0).join("");
  }
  print(func("P", "A", "S", "S"));


SpiderMonkey, JavaScriptCore and TurboFan agrees that it should produce "PASS PASS". However the non-optimizing compiler and CrankShaft both says "PASS FAIL".

I think the correct behavior is "PASS PASS", since reading the specification http://www.ecma-international.org/ecma-262/5.1/#sec-10.6, it states that the arguments object should not be created when there is a VariableDeclaration with the identifier "arguments". Which i interpret to mean that writing to the declared variable arguments, shouldn't change the value of Function.arguments (Function.arguments is however not mentioned in the specification, so I might have gotten it wrong).

It might relate to: https://code.google.com/p/v8/issues/detail?id=222
However, in that bug report the problem is that func.arguments is copied for each access, here func.arguments is incorrectly overwritten.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to