| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | [Back] [Original] |
Get to know MDN better
stack
Error.prototype Error Error.prototype.stack | |
|---|---|
JavaScript
function foo() {
bar();
}
function bar() {
baz();
}
function baz() {
console.log(new Error().stack);
}
foo();
#### JavaScriptCore
baz@filename.js:10:24
bar@filename.js:6:6
foo@filename.js:2:6
global code@filename.js:13:4
#### SpiderMonkey
baz@filename.js:10:15
bar@filename.js:6:3
foo@filename.js:2:3
@filename.js:13:1
#### V8
Error
at baz (filename.js:10:15)
at bar (filename.js:6:3)
at foo (filename.js:2:3)
at filename.js:13:1
V8 API Error.captureStackTrace()Error.stackTraceLimitError.prepareStackTrace() API
function foo() {
console.log(new Error().stack);
}
throw
console.log(new Function("return new Error('Function failed')")().stack);
console.log("====");
console.log(eval("new Error('eval failed')").stack);
#### JavaScriptCore
anonymous@
global code@filename.js:1:65
====
eval code@
eval@[native code]
global code@filename.js:3:17
#### SpiderMonkey
anonymous@filename.js line 1 > Function:1:8
@filename.js:1:65
====
@filename.js line 3 > eval:1:1
@filename.js:3:13
#### V8
Error: Function failed
at eval (eval at <anonymous> (filename.js:1:13), <anonymous>:1:8)
at filename.js:1:65
====
Error: eval failed
at eval (eval at <anonymous> (filename.js:3:13), <anonymous>:1:1)
at filename.js:3:13
Firefox //# sourceURL eval Firefox eval
stack
<div id="output"></div>
#output {
white-space: pre;
font-family: monospace;
}
function trace() {
throw new Error("trace() failed");
}
function b() {
trace();
}
function a() {
b(3, 4, "\n\n", undefined, {});
}
try {
a("first call, first arg");
} catch (e) {
document.getElementById("output").textContent = e.stack;
}
| Web Proxy Viewer | New URL | Original Page |