Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//// { compiler: { ts: "4.0.2" } }

// JavaScript는 어떠한 값도 전달할 수 있기 때문에,
// TypeScript는 에러의 타입 선언을 지원하지 않습니다

try {
// ..
} catch (e) {}

// 역사적으로, catch문의 `e`는 기본적으로
// any 타입으로 설정되는 것을 의미합니다.
// 그래서 어떠한 프로퍼티 접근도 마음대로 접근할 수 있는 자유를 허용했었습니다.
// 4.0에서는, `any`와 `unknown` 모두 허용하기 위해
// catch 절에서 타입 할당의 제한을 완화했습니다.

// any 타입으로 동일한 동작
try {
// ..
} catch (e) {
e.stack;
}

// unknown 타입으로 명확한 동작:

try {
// ..
} catch (e: unknown) {
// 타입 시스템이 그게 무엇인지 배울 때까지
// `e`를 전혀 사용할 수 없습니다, 더 많은 정보 살펴보세요:
Comment thread
yahma25 marked this conversation as resolved.
Outdated
// 예시:unknown-and-never
e.stack;

if (e instanceof SyntaxError) {
e.stack;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yahma25 PR 감사합니다. :) 다른 PR 에도 마지막 라인에 개행이 없는 것 같은데 한번 확인해 주실 수 있으신가요??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeonjuan 확인 감사합니다. 😄
원본 영문 파일의 라인 수 일치 때문에 마지막 라인까지 동일하게 맞췄습니다.
다른 PR 포함해서 앞으로도 마지막 라인에 개행은 원본과 라인 수가 달라져도 추가하면 될까요?