Thanks to visit codestin.com
Credit goes to developer.mozilla.org

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Error: fileName

비표준: 이 기능은 표준화되어 있지 않습니다. 비표준 기능은 브라우저 지원이 제한적이며 변경되거나 제거될 수 있으므로 프로덕션 환경에서 사용하는 것은 권장되지 않습니다. 그러나 표준 옵션이 없는 특정 상황에서는 적절한 대안이 될 수 있습니다.

Error 인스턴스의 fileName 데이터 속성은 이 오류가 발생한 파일의 경로를 포함합니다.

문자열.

Property attributes of Error: fileName
쓰기 가능가능
열거 가능불가능
설정 가능가능

설명

이 비표준 속성은 이 오류가 발생한 파일의 경로를 포함합니다. 디버거 컨텍스트(예를 들어 Firefox 개발자 도구)에서 호출할 경우, "debugger eval code" 가 반환됩니다.

예제

fileName 사용하기

js
const e = new Error("Could not parse input");
throw e;
// e.fileName은 "file:///C:/example.html" 처럼 보일 수 있습니다.

명세

표준의 일부가 아닙니다.

브라우저 호환성

같이 보기