arguments is a live reference to the arguments on the call stack, so

function f(a) {
   g();
   alert([a, arguments[0]])
}
function g() {
    f.arguments[0] = "foo";
}
f("bar");

will produce foo, foo

Isn't ES a marvelous language? :D

caller and callee aren't writable though.

--Oliver

On Sep 21, 2010, at 11:37 AM, Holger Freyther wrote:

> On 09/22/2010 02:09 AM, Oliver Hunt wrote:
> 
>> 
>> In the general case this would require being able to convert from inlined 
>> code to a 'correct' call stack at some arbitrary point
> 
> argh, I had hoped that such things would be only necessary when we have a
> debugger attached. This mean besides what maciej had said, we will need to
> remember that this range of instructions belongs to a inlined call and be able
> to generate the virtual call record.
> 
> Can one write to arguments, callee and such?
> 
> I wonder (and will try to measure based on sunspider and other test content)
> how many functions occur like function f(x) { return x +2; } or even fully
> constant. Is there any classification of the complexity of functions at parse
> time?

_______________________________________________
squirrelfish-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/squirrelfish-dev

Reply via email to