-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[ko] with 문서 신규 번역 #22055
[ko] with 문서 신규 번역 #22055
Conversation
Preview URLs Flaws (5)URL:
(comment last updated: 2024-07-01 14:46:37) |
@1ilsang 이 PR 린트 돌다 만것 같은데 원인이 뭘까요? |
@wisedog 님 현재는 린트가 깨진 것으로 보이는데요, 이 부분을 질문 주신 게 맞을까요? 제가 이전에 잠깐 봤을 때 린트 자체가 실행되지 않은 것 같았는데 이 부분을 질문 주신 걸까요? |
Preview URL에서 확인해 보았을 때 최상단의 영문 문서 원본에서는 |
다시 확인해 보았더니 제가 생각한 게 아니었고 |
해당 브랜치에 추가 커밋하면 아마 린트가 다시 실행될겁니다. |
d84a040
to
79c1ec0
Compare
감사합니다! 다시 커밋하였습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@witch-factory 님 안녕하세요. 기여해주셔서 감사합니다! 💯
몇 가지 코멘트 남겨두었습니다.
확인하시고 다시 리뷰 요청 부탁드리겠습니다. 🙇
질문이나 도움이 필요하시다면 언제든 멘션 부탁드리겠습니다.
title: with | ||
slug: Web/JavaScript/Reference/Statements/with | ||
l10n: | ||
sourceCommit: 38361b921514fe10258f5c44a4a0563b917859cd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceCommit: 38361b921514fe10258f5c44a4a0563b917859cd | |
sourceCommit: fb85334ffa4a2c88d209b1074909bee0e0abd57a |
sourceCommit이 잘못된 것 같은데요, 해당 커밋이 맞을까요?
이 파일의 최신 커밋은 fb85334ffa4a2c88d209b1074909bee0e0abd57a입니다.
} | ||
``` | ||
|
||
## 명세 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
---보는중 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---보는중 |
원문과 다른 내용은 삭제해 주세요.
|
||
`with`문은 문의 스코프 체인을 확장합니다. | ||
|
||
## 문법 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(globalThis.Math === Math); // true | ||
``` | ||
|
||
`with` 문은 문의 본문이 평가되는 동안 주어진 객체를 스코프 체인의 맨 앞에 추가한다. 모든 제한되지 않은 이름은 상위 스코프 체인을 검색하기 전에 먼저 주어진 객체 내에서 ([in](/ko/docs/Web/JavaScript/Reference/Operators/in)으로 확인하여) 검색됩니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`with` 문은 문의 본문이 평가되는 동안 주어진 객체를 스코프 체인의 맨 앞에 추가한다. 모든 제한되지 않은 이름은 상위 스코프 체인을 검색하기 전에 먼저 주어진 객체 내에서 ([in](/ko/docs/Web/JavaScript/Reference/Operators/in)으로 확인하여) 검색됩니다. | |
`with` 문은 문의 본문이 평가되는 동안 주어진 객체를 스코프 체인의 맨 앞에 추가합니다. 모든 제한되지 않은 이름은 상위 스코프 체인을 검색하기 전에 먼저 주어진 객체 내에서 ([in](/ko/docs/Web/JavaScript/Reference/Operators/in)으로 확인하여) 검색됩니다. |
```js | ||
function f(foo, values) { | ||
with (foo) { | ||
console.log(values); | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
``` | ||
|
||
ECMAScript 5 환경에서 `f([1, 2, 3], obj)`를 호출하면, `with` 문 내의 `values` 참조는 `obj`로 이행됩니다. 그러나 ECMAScript 2015는 Array.prototype에 [values](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/values) 속성을 도입합니다(따라서 모든 배열에서 `values` 속성을 사용할 수 있게 됩니다). 따라서 환경을 업그레이드하면 `with` 문 내의 `values` 참조는 `[1, 2, 3].values`로 이행되며, 이는 버그를 일으킬 가능성이 큽니다. 이 특정 예제에서는 `values`가 [Array.prototype[@@unscopables]](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/@@unscopables)에 의해 스코프에 포함되지 않도록 정의되어 있어 해당 코드의 `values`는 여전히 `values` 매개변수로 올바르게 이행됩니다. 만약 스코프에 포함되지 않도록 정의되지 않았다면, 이는 디버깅하기 어려운 문제가 될 수 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ECMAScript 5 환경에서 `f([1, 2, 3], obj)`를 호출하면, `with` 문 내의 `values` 참조는 `obj`로 이행됩니다. 그러나 ECMAScript 2015는 Array.prototype에 [values](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/values) 속성을 도입합니다(따라서 모든 배열에서 `values` 속성을 사용할 수 있게 됩니다). 따라서 환경을 업그레이드하면 `with` 문 내의 `values` 참조는 `[1, 2, 3].values`로 이행되며, 이는 버그를 일으킬 가능성이 큽니다. 이 특정 예제에서는 `values`가 [Array.prototype[@@unscopables]](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/@@unscopables)에 의해 스코프에 포함되지 않도록 정의되어 있어 해당 코드의 `values`는 여전히 `values` 매개변수로 올바르게 이행됩니다. 만약 스코프에 포함되지 않도록 정의되지 않았다면, 이는 디버깅하기 어려운 문제가 될 수 있습니다. | |
ECMAScript 5 환경에서 `f([1, 2, 3], obj)`를 호출하면, `with` 문 내의 `values` 참조는 `obj`로 이행됩니다. 그러나 ECMAScript 2015는 `Array.prototype`에 [`values`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/values) 속성을 도입합니다(따라서 모든 배열에서 `values` 속성을 사용할 수 있게 됩니다). 따라서 환경을 업그레이드하면 `with` 문 내의 `values` 참조는 `[1, 2, 3].values`로 이행되며, 이는 버그를 일으킬 가능성이 큽니다. | |
이 특정 예제에서는 `values`가 [`Array.prototype[@@unscopables]`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/@@unscopables)에 의해 스코프에 포함되지 않도록 정의되어 있어 해당 코드의 `values`는 여전히 `values` 매개변수로 올바르게 이행됩니다. 만약 스코프에 포함되지 않도록 정의되지 않았다면, 이는 디버깅하기 어려운 문제가 될 수 있습니다. |
- 줄 수는 원본과 동일하게 해주세요. 관련 논의는 여기에서 확인할 수 있습니다.
- 원문과 형태를 동일하게 유지해 주세요.
`
백틱이 빠져있습니다.
79c1ec0
to
f81f82e
Compare
@1ilsang 안녕하세요. ���뷰해 주신 부분들을 반영하였습니다. 확인 부탁드립니다. 그리고 unscopables를 "스코프 지정 불가능"으로 변경하였습니다. 스코프 지정 불가능이라는 번역은 Array.prototype[@@unscopables]에서 unscopable을 "범위 지정 불가능"으로 번역하고 있는 걸 참고하였습니다. 용어 안내서에서는 scope를 범위로 번역하고 있으나, 이 글에서는 다른 부분에서 "스코프 체인"이라는 단어가 반복적으로 쓰이는데 다른 문서에서도 이를 스코프 체인으로 번역한 문서가 많아 범위 체인과 같이 변경하는 것은 어색하다고 보였습니다. 그래서 일단 스코프 쪽으로 통일하였는데 용어 가이드를 따라 scope를 범위로 일괄적으로 번역하거나 scope chain을 스코프 체인으로, unscopable은 범위 지정 불가능으로 하는 등 다른 방식이 낫다면 그대로 반영하겠습니다. 감사합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단일 문서 내의 용어를 통일하는 것이 더 좋다고 느낍니다. 따라서 "스코프 체인 / 스코프 지정 불가능"으로 번역되어도 문제없어 보입니다.
LGTM 고생하셨습니다. 👍
Description
deprecated된 명령문이기는 하지만 기존에 한국어로 존재하지 않던 문서 with을 신규 번역하였습니다.
Motivation
Additional details
Related issues and pull requests