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.

arguments.caller

This article needs an editorial review. How you can help.

La propietat obsoleta arguments.caller solia proporcionar la funció que invoca la funció que s'està executant en aquest moment. Aquesta propietat s'ha eleminitat i ja no funciona.

Descripció

La propietat ja no és troba disponible, però encara es pot utilitzar Function.caller.

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

Exemples

El codi següent s'utilitzava per comprovar el valor de arguments.caller en una funció, però ja no funciona.

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

Especificacions

No forma part de cap estàndard. Implementat en JavaScript 1.1 i eliminat en errada 7224 a causa una potencial vulnerabilitat de seguretat.

Compatibilitat amb navegadors

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic Not supported Not supported Not supported Not supported Not supported
Característica Android Chrome per Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic Not supported Not supported Not supported Not supported Not supported Not supported

Vegeu també

Document Tags and Contributors

 Contributors to this page: llue
 Last updated by: llue,