返回一个对函数的引用,该函数调用了当前函数。
function.caller 
实参
- Function — 函数
 必选。 当前正在执行的 Function 对象的名称。
备注
caller 属性只有当函数正在执行时才被定义。 如果函数是从 JScript 程序的顶层调用的,则 caller 包含 null。
如果在字符串上下文中使用 caller 属性,则其结果和 functionName.toString 相同,就是说,将显示函数的反编译文本。
提示
当程序以快速模式(JScript 的默认模式)运行时,caller 属性不可用。 若要从命令提示符下编译使用 caller 属性的程序,必须使用 /fast- 关闭快速选项。 由于线程处理问题,在 ASP.NET 中关闭快速选项是不安全的。
示例
下面的示例演示如何使用 caller 属性。
function callLevel()
{
    if (callLevel.caller == null)
        print("callLevel was called from the top level.");
    else
    {
        print("callLevel was called by:");
        print(callLevel.caller);
    }
}
function testCall()
{
    callLevel()
}
// Call callLevel directly.
callLevel();
// Call callLevel indirectly.
testCall();
此程序的输出如下所示。
callLevel was called from the top level.
callLevel was called by:
function testCall() {
   callLevel()
}