Error: fileName
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Thuộc tính dữ liệu fileName của một instance Error chứa đường dẫn đến tệp đã tạo ra lỗi này.
Giá trị
Một chuỗi.
Property attributes of Error: fileName | |
|---|---|
| Writable | yes |
| Enumerable | no |
| Configurable | yes |
Mô tả
Thuộc tính không chuẩn này chứa đường dẫn đến tệp đã tạo ra lỗi này. Nếu được gọi từ ngữ cảnh debugger, chẳng hạn như Firefox Developer Tools, chuỗi "debugger eval code" sẽ được trả về.
Ví dụ
>Sử dụng fileName
js
const e = new Error("Could not parse input");
throw e;
// e.fileName could look like "file:///C:/example.html"
Đặc tả kỹ thuật
Không thuộc bất kỳ tiêu chuẩn nào.