[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Error/stack [Back]  [Original]

Error.prototype.stack - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Error.prototype.stack

: . , , . , , , .

In this article

stack Error , , . .

; ( ), (@), ( , , ), , , . , Error fileName, lineNumber columnNumber, , ( , ).

, Firefox. . , Safari 6+ Opera 12- . , , JavaScript V8 (, Chrome, Opera 15+, Android) IE10+, ( error.stack MSDN).

: Firefox 14 (Firefox bug 744842) (@) , . ( ) "[object Object]", , , , ( Firefox 14 arguments.callee.caller.arguments, arguments.callee.caller.name). "undefined" "(void 0)". , , "@", "(", ")" ( ), . , Firefox 14 .

HTML stack.

html
<!doctype html>
<meta charset="UTF-8" />
<title>  </title>
<body>
  <script>
    function trace() {
      try {
        throw new Error(" ");
      } catch (e) {
        alert(e.stack);
      }
    }
    function b() {
      trace();
    }
    function a() {
      b(3, 4, "\n\n", undefined, {});
    }
    a(" ,  ");
  </script>
</body>

, C:\example.html Windows. :

Firefox 30 , (Firefox bug 762556):

trace@file:///C:/example.html:9:17
b@file:///C:/example.html:16:13
a@file:///C:/example.html:19:13
@file:///C:/example.html:21:9

Firefox 14 Firefox 29:

trace@file:///C:/example.html:9
b@file:///C:/example.html:16
a@file:///C:/example.html:19
@file:///C:/example.html:21

Firefox 13 :

Error(" ")@:0
trace()@file:///C:/example.html:9
b(3,4,"\n\n",(void 0),[object Object])@file:///C:/example.html:16
a(" ,  ")@file:///C:/example.html:19
@file:///C:/example.html:21

eval()

Firefox 30, Function() eval() . Function "> Function", eval() "> eval". Firefox bug 332176.

js
try {
  new Function("throw new Error()")();
} catch (e) {
  console.log(e.stack);
}

// anonymous@file:///C:/example.html line 7 > Function:1:1
// @file:///C:/example.html:7:6

try {
  eval("eval('FAIL')");
} catch (x) {
  console.log(x.stack);
}

// @file:///C:/example.html line 7 > eval line 1 > eval:1:1
// @file:///C:/example.html line 7 > eval:1:1
// @file:///C:/example.html:7:6

eval() //# sourceURL. eval() , ( ).

- . .


Web Proxy Viewer  |  New URL  |  Original Page