⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 7-3.txt

📁 Javascript语言开发经典教程开发
💻 TXT
字号:
// This function returns the name of a given function. It does this by// converting the function to a string, then using a regular expression// to extract the function name from the resulting code.function funcname(f) {    var s = f.toString().match(/function (\w*)/)[1];    if ((s == null) || (s.length == 0)) return "anonymous";    return s;}// This function returns a string that contains a "stack trace."function stacktrace() {    var s = "";  // This is the string we'll return.    // Loop through the stack of functions, using the caller property of    // one arguments object to refer to the next arguments object on the    // stack.    for(var a = arguments.caller; a != null; a = a.caller) {        // Add the name of the current function to the return value.        s += funcname(a.callee) + "\n";        // Because of a bug in Navigator 4.0, we need this line to break.        // a.caller will equal a rather than null when we reach the end         // of the stack. The following line works around this.        if (a.caller == a) break;    }    return s;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -