08-05-2014, 10:44 PM
Via "arguments.callee.caller":
A adapter si besoin.
var x = true;
var toto = function test()
{
console.log(
"CONTEXT = ", (arguments.callee.caller == null? 'global': 'local')
,"This = ", this
,"x = ", x
,"arguments=", arguments
,"callee=", arguments.callee
,"caller=", arguments.callee.caller
);
};
toto();
(
function()
{
var tatati = function test()
{
console.log(
"CONTEXT = ", (arguments.callee.caller == null? 'global': 'local')
,"This = ", this
,"x = ", x
,"arguments=", arguments
,"callee=", arguments.callee
,"caller=", arguments.callee.caller
);
};
tatati();
}
)();
Citation :CONTEXT = global This = Window contexte.html x = true arguments= [] callee= test() caller= null
CONTEXT = local This = Window contexte.html x = true arguments= [] callee= test() caller= function()
A adapter si besoin.