Error.prototype.fileName
非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!
fileName
属性包含引发此错误的文件的路径。
描述
此非标准属性包含引发此错误的文件的路径。如果从调试器上下文调用,例如 Firefox Developer Tools,将会返回“debugger eval code”.
示例
使用 fileName
js
var e = new Error("Could not parse input");
throw e;
// e.fileName could look like "file:///C:/example.html"
规范
No specification found
No specification data found for javascript.builtins.Error.fileName
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fileName |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.