-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Translate 1 file to ko - Unknown in Catch #1518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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`를 전혀 사용할 수 없습니다, 더 많은 정보 살펴보세요: | ||||||||
| // 예시:unknown-and-never | ||||||||
| e.stack; | ||||||||
|
|
||||||||
| if (e instanceof SyntaxError) { | ||||||||
| e.stack; | ||||||||
| } | ||||||||
| } | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yahma25 PR 감사합니다. :) 다른 PR 에도 마지막 라인에 개행이 없는 것 같은데 한번 확인해 주실 수 있으신가요??
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yeonjuan 확인 감사합니다. 😄 |
||||||||
Uh oh!
There was an error while loading. Please reload this page.