From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../functions/arguments/caller/index.html | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 files/zh-cn/web/javascript/reference/functions/arguments/caller/index.html (limited to 'files/zh-cn/web/javascript/reference/functions/arguments/caller/index.html') diff --git a/files/zh-cn/web/javascript/reference/functions/arguments/caller/index.html b/files/zh-cn/web/javascript/reference/functions/arguments/caller/index.html deleted file mode 100644 index 13128ec962..0000000000 --- a/files/zh-cn/web/javascript/reference/functions/arguments/caller/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: caller -slug: Web/JavaScript/Reference/Functions/arguments/caller -translation_of: Archive/Web/JavaScript/arguments.caller ---- -

{{jsSidebar("Functions")}}

- -

废弃的 arguments.caller 属性原先用在函数执行的时候调用自身。本属性已被移除且不再有用。

- -

描述

- -

arguments.caller 已经不可使用了,但是你还可以使用 {{jsxref("Function.caller")}}。

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

示例

- -

下例演示了arguments.caller属性的作用.

- -
function whoCalled() {
-   if (arguments.caller == null)
-      console.log('该函数在全局作用域内被调用.');
-   else
-      console.log(arguments.caller + '调用了我!');
-}
- -

规范

- -

无相关标准。JavaScript 1.1 实现,{{bug(7224)}} 移除 caller,因为潜在的不安全性。

- -

浏览器支持

- - - -

{{Compat("javascript.functions.arguments.caller")}}

- -

相关链接

- - -- cgit v1.2.3-54-g00ecf