blob: 8e679effa217e96933e0b302249d9c753c86c5e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
---
title: Error.prototype.fileName
slug: Web/JavaScript/Reference/Global_Objects/Error/fileName
translation_of: Web/JavaScript/Reference/Global_Objects/Error/fileName
---
<div>{{JSRef}} {{non-standard_header}}</div>
<p><code><strong>fileName</strong></code> 属性包含引发此错误的文件的路径.</p>
<h2 id="描述">描述</h2>
<p>此非标准属性包含引发此错误的文件的路径. 如果从调试器上下文调用,例如Firefox Developer Tools,将会返回“debugger eval code”.</p>
<h2 id="例子">例子</h2>
<h3 id="使用_fileName">使用 <code>fileName</code></h3>
<pre class="brush: js">var e = new Error('Could not parse input');
throw e;
// e.fileName could look like "file:///C:/example.html"
</pre>
<h2 id="规范">规范</h2>
{{Specifications}}
<h2 id="浏览器兼容性">浏览器兼容性</h2>
{{Compat}}
<h2 id="相关链接">相关链接</h2>
<ul>
<li>{{jsxref("Error.prototype.stack")}} {{non-standard_inline}}</li>
<li>{{jsxref("Error.prototype.columnNumber")}} {{non-standard_inline}}</li>
<li>{{jsxref("Error.prototype.lineNumber")}} {{non-standard_inline}}</li>
</ul>
|