New issue 838 by utatane....@gmail.com: Function [[Call]] should return
Reference Type
http://code.google.com/p/v8/issues/detail?id=838
v8 set Left Hand Side Error in parsing phase and reduces Identifier +
PropertyAccess as ValidLeftHandSide, but, Function [[Call]] returns
Reference Type.
in following case,
console.log("TEST") = "VAL";
before v8 raises ReferenceError: "Invalid left-hand side in assignment",
console.log("TEST") should be called.
Comment #1 on issue 838 by l...@chromium.org: Function [[Call]] should
return Reference Type
http://code.google.com/p/v8/issues/detail?id=838
This is correct. While V8 never has a function return a Reference, it would
be against the spirit of ES5 section 16 to consider this an early error
(unlike, e.g., the assignment "3=4").
The spec isn't entirely clear, due to the wording of the last case where
Early Errors are required: "Attempts to call PutValue on any value for
which an early determination can be made that the value is not a Reference
(for example, executing the assignment statement 3=4)."
V8 can actually determine early that a function call isn't a Reference,
because it never is in V8, but that seems counter to the intended meaning
when reading the following sentence: "An implementation shall not treat
other kinds of errors as early errors even if the compiler can prove that a
construct cannot execute without error under any circumstances.".