--- title: Error.prototype.fileName slug: Web/JavaScript/Reference/Global_Objects/Error/fileName translation_of: Web/JavaScript/Reference/Global_Objects/Error/fileName ---
fileName 属性包含引发此错误的文件的路径.
此非标准属性包含引发此错误的文件的路径. 如果从调试器上下文调用,例如Firefox Developer Tools,将会返回“debugger eval code”.
fileNamevar e = new Error('Could not parse input');
throw e;
// e.fileName could look like "file:///C:/example.html"