Comment #3 on issue 1955 by [email protected]: Move all V8-internal JS to
strict mode
http://code.google.com/p/v8/issues/detail?id=1955
Answering here only regarding the ES5 spec. As for what's web or JSC
compatible, that's another matter entirely.
Are you sure that the spec guarantees that this works?
It does not. For non-strict functions and built-in, three of the four
normally poisoned properties are unspecified:
* <function-instance>.caller
* <function-instance>.arguments
* arguments.caller
Only the remaining poisoned property is standard for non-strict function,
arguments.callee, and this is of course not an issue for built-in functions.
If either is strict, the spec guarantees that foo.caller throws.
Not quite. If foo is strict, the spec guarantees that foo.caller throws. If
foo is non-strict or built-in, the spec only guarantees that foo.caller not
reveal a strict function. So if foo's caller is strict, it is perfectly
fine (and may be more web compatible?) for foo.caller to return undefined.
Throwing is also fine of course, just not required.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev