Project: v8 Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 2328 arguments.callee.caller.arguments isn't bind to caller's arguments
Starred by 1 user Reported by buschto...@gmail.com, Sep 9 2012 Back to list
Status: Duplicate
Merged: issue 222
Owner: ----
Closed: Sep 2012
HW: ----
OS: ----
Priority: ----
Type: ----



Sign in to add a comment
Consider the following:

function change(args) {
	console.log(args[0]); // returns "Doesn't work..."
	args[0] = "It works!";
	console.log(args[0]); // returns "It works!"
}
function test(a) {
	change(arguments);
	console.log(a); // returns "It works!"
}
test("Doesn't work...");

This works, the directly passed arguments object is linked to the function's arguments. But accessing it via callee.caller doesn't work, as shown here.

function change() {
	console.log(arguments.calle.caller.arguments[0]); // returns "Doesn't work..."
	arguments.calle.caller.arguments[0] = "It works!";
	console.log(arguments.calle.caller.arguments[0]); // returns "It works!"
}
function test(a) {
	change();
	console.log(a); // returns "Doesn't work..."
}
test("Doesn't work...");

I'm pretty sure that this behaviour isn't intended and the magic link should work with arguments.calle.caller.arguments as well.

Thanks for your time,
Jan Buschtöns
 
Mergedinto: 222
Status: Duplicate
Sign in to add a comment