Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Registrati per tradurlo tu.

The obsolete arguments.caller property used to provide the function that invoked the currently executing function. This property has been removed and no longer works.

Description

This property is not available anymore, but you can still use Function.caller.

function whoCalled() {
   if (whoCalled.caller == null)
      console.log('I was called from the global scope.');
   else
      console.log(whoCalled.caller + ' called me!');
}

Examples

The following code was used to check the value of arguments.caller in a function, but doesn't work anymore.

function whoCalled() {
   if (arguments.caller == null)
      console.log('I was called from the global scope.');
   else
      console.log(arguments.caller + ' called me!');
}

Specifications

Not part of any standard. Implemented in JavaScript 1.1 and removed in bug 7224 due to potentially vulnerable for security.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support No support No support No support
removed in IE 9
No support No support
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support No support No support No support No support No support

See also

Tag del documento e collaboratori

 Hanno collaborato alla realizzazione di questa pagina: claudepache, fscholz, Havvy, Sheppy, null---, evilpie, ziyunfei, Mgjbot, Bellerophon, Nickolay, Ptak82, Maian, Prodoc, Dria
 Ultima modifica di: claudepache,