Status: New
Owner: ----
New issue 1834 by [email protected]: func of CallExpression shoud be get
from the MemberExpression before Arguments are evaluated
http://code.google.com/p/v8/issues/detail?id=1834
var obj = {};
obj.foo( obj.foo = function(){ console.log("new func"); } );
// "new func"
obj.foo();
// "new func"
This code shoud throw "obj.foo is not function" exception. But v8 engine
[[call]] the value of function which is assigned by Arguments
Function Calls is following step by ECMAScript 5th Specification
http://es5.github.com/#x11.2.3
1. Let ref be the result of evaluating MemberExpression.
2. Let func be GetValue(ref).
3. Let argList be the result of evaluating Arguments, producing an
internal list of argument values
4. If Type(func) is not Object, throw a TypeError exception.
5. If IsCallable(func) is false, throw a TypeError exception.
6. (snip)
So, func indicates shoud be Undefined and it should throw TypeError by
step4.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev