[찬우] proposal-accessible-object-hasownproperty 번역#41
Open
chanuuuuu wants to merge 34 commits into
Open
Conversation
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
Co-authored-by: HyukJoo Kwon <76726411+huckjoo@users.noreply.github.com>
damilog
approved these changes
Jun 21, 2023
|
|
||
| ### `Object.create(null)` | ||
|
|
||
| `Object.create(null)` 는 `Object.prototype`를 상속받지 않는 객체를 생성하므로, 이 것이 가진 메서드에 대해 접근이 불가능합니다. |
Member
There was a problem hiding this comment.
Suggested change
| `Object.create(null)` 는 `Object.prototype`를 상속받지 않는 객체를 생성하므로, 이 것이 가진 메서드에 대해 접근이 불가능합니다. | |
| `Object.create(null)` 는 `Object.prototype`를 상속받지 않는 객체를 생성하므로, 이것이 가진 메서드에 대해 접근이 불가능합니다. |
|
|
||
| ### `hasOwnProperty`의 재정의 | ||
|
|
||
| 객체에 정의되어 있는 속성을 직접적으로 소유하지 않는 경우, 당신은 내장 함수인 `.hasOwnProperty()`의 호출을 100% 확신할 수 없습니다. |
Member
There was a problem hiding this comment.
you를 번역하지 않아도 괜찮을 것 같은데 어떠신가요?
Suggested change
| 객체에 정의되어 있는 속성을 직접적으로 소유하지 않는 경우, 당신은 내장 함수인 `.hasOwnProperty()`의 호출을 100% 확신할 수 없습니다. | |
| 객체에 정의되어 있는 속성을 직접적으로 소유하지 않는 경우, 내장 함수인 `.hasOwnProperty()`의 호출을 100% 확신할 수 없습니다. |
|
|
||
| ### ESLint의 `no-prototype-builtins` 규칙 | ||
|
|
||
| ESLint는 `hasOwnProperty`와 같은 프로토타입 내장객체의 사용을 금지하는 [내장 규칙][eslint-no-prototype-builtins]을 가집니다. |
Member
There was a problem hiding this comment.
Suggested change
| ESLint는 `hasOwnProperty`와 같은 프로토타입 내장객체의 사용을 금지하는 [내장 규칙][eslint-no-prototype-builtins]을 가집니다. | |
| ESLint는 `hasOwnProperty`와 같은 프로토타입 내장 객체의 사용을 금지하는 [내장 규칙][eslint-no-prototype-builtins]을 가집니다. |
| Object.hasOwn(object3, "foo") // false | ||
| ``` | ||
|
|
||
| ## 구현사항 |
Member
There was a problem hiding this comment.
Suggested change
| ## 구현사항 | |
| ## 구현 사항 |
| - [npm: object.hasown](https://www.npmjs.com/package/object.hasown) | ||
| - [core-js](https://github.com/zloirock/core-js/#accessible-objecthasownproperty) | ||
|
|
||
| 유사한 라이브러리들에서부터 `Object.hasOwn()`로 마이그레이션하기 위한 codemod는 아래에 있습니다. |
Member
There was a problem hiding this comment.
라이브러리라고만 번역해도 괜찮을 것 같습니다~
Suggested change
| 유사한 라이브러리들에서부터 `Object.hasOwn()`로 마이그레이션하기 위한 codemod는 아래에 있습니다. | |
| 유사한 라이브러리에서 `Object.hasOwn()`로 마이그레이션하기 위한 codemod는 아래에 있습니다. |
|
|
||
| ### 왜 `Object.hasOwnProperty(object, property)`가 아닌가요? | ||
|
|
||
| 현재 이미 존재하고 있는 `Object.hasOwnProperty(property)`는 `Object.prototype`로부터 `Object`가 상속받은 것입니다. 그러므로 다른 시그니처를 가진 새로운 메서드를 정의하는 변화가 필요합니다. |
Member
There was a problem hiding this comment.
Suggested change
| 현재 이미 존재하고 있는 `Object.hasOwnProperty(property)`는 `Object.prototype`로부터 `Object`가 상속받은 것입니다. 그러므로 다른 시그니처를 가진 새로운 메서드를 정의하는 변화가 필요합니다. | |
| 현재 이미 존재하고 있는 `Object.hasOwnProperty(property)`는 `Object.prototype`로부터 `Object`가 상속받은 것입니다. 그러므로 다른 시그니처를 가진 새로운 메서드를 정의하는 변화가 필요합니다. |
|
|
||
| 현재 이미 존재하고 있는 `Object.hasOwnProperty(property)`는 `Object.prototype`로부터 `Object`가 상속받은 것입니다. 그러므로 다른 시그니처를 가진 새로운 메서드를 정의하는 변화가 필요합니다. | ||
|
|
||
| ### 왜 이름이 `hasOwn`인가요? |
Member
There was a problem hiding this comment.
Suggested change
| ### 왜 이름이 `hasOwn`인가요? | |
| ### 왜 이름이 `hasOwn`인가요? |
|
|
||
| https://v8.dev/features/object-fromentries#objects-vs.-maps의 발췌문입니다. | ||
|
|
||
| > JavaScript는 일반적인 객체보다 조금 더 적합한 데이터 구조로 사용되는 Maps 또한 제공합니다. 그래서 완벽하게 통제가 가능한 코드 내에서는 객체 대신 map을 사용할 수 있습니다. 그러나 개발자로서 항상 확신하지는 못합니다. 가끔 당신이 다루는 데이터는 외부의 API나 라이브러리 함수 들로부터 map이 아닌 객체로 제공됩니다. |
Member
There was a problem hiding this comment.
Suggested change
| > JavaScript는 일반적인 객체보다 조금 더 적합한 데이터 구조로 사용되는 Maps 또한 제공합니다. 그래서 완벽하게 통제가 가능한 코드 내에서는 객체 대신 map을 사용할 수 있습니다. 그러나 개발자로서 항상 확신하지는 못합니다. 가끔 당신이 다루는 데이터는 외부의 API나 라이브러리 함수 들로부터 map이 아닌 객체로 제공됩니다. | |
| > JavaScript는 일반적인 객체보다 조금 더 적합한 데이터 구조로 사용되는 Maps 또한 제공합니다. 그래서 완벽하게 통제가 가능한 코드 내에서는 객체 대신 map을 사용할 수 있습니다. 그러나 개발자로서 항상 확신하지는 못합니다. 가끔 당신이 다루는 데이터는 외부의 API나 라이브러리 함수로부터 map이 아닌 객체로 제공됩니다. |
|
|
||
| ### `Reflect`에 해당 메서드가 제공되나요? | ||
|
|
||
| `Reflect`의 의도는 `Proxy` 트랩에 대한 메서드를 1:1로 포함하는 것입니다. `Proxy`에는 이미 `hasOwnProperty` (`getOwnPropertyDescriptor`)를 트랩하는 메서드가 존재합니다. 그러므로 추가적인 트랩을 추가하는 것은 올바르지 않으며, `Reflect`에 해당 메서드를 포함시키는 것 또한 올바르지 않습니다. |
Member
There was a problem hiding this comment.
Suggested change
| `Reflect`의 의도는 `Proxy` 트랩에 대한 메서드를 1:1로 포함하는 것입니다. `Proxy`에는 이미 `hasOwnProperty` (`getOwnPropertyDescriptor`)를 트랩하는 메서드가 존재합니다. 그러므로 추가적인 트랩을 추가하는 것은 올바르지 않으며, `Reflect`에 해당 메서드를 포함시키는 것 또한 올바르지 않습니다. | |
| `Reflect`의 의도는 `Proxy` 트랩에 대한 메서드를 1:1로 포함하는 것입니다. `Proxy`에는 이미 `hasOwnProperty` (`getOwnPropertyDescriptor`)를 트랩하는 메서드가 존재합니다. 그러므로 추가적인 트랩을 추가하는 것은 올바르지 않으며, `Reflect`에 해당 메서드를 포함시키는 것 또한 올바르지 않습니다. |
huckjoo
approved these changes
Jun 21, 2023
|
|
||
| 현재 당신의 코드 내의 `Object.hasOwn()`에 사용할 수 있는 폴리필과 codemod에 대한 [구현](#implementations)섹션을 확인하시길 바랍니다. | ||
|
|
||
| 만약 `Object.hasOwn()`를 사용하고 있다면, [issue #18](https://github.com/tc39/proposal-accessible-object-hasownproperty/issues/18)에 피드백을 남겨주세요. (긍정적인 피드백이나 부정적인 피드백 모두 권장합니다.) |
Contributor
There was a problem hiding this comment.
Suggested change
| 만약 `Object.hasOwn()`를 사용하고 있다면, [issue #18](https://github.com/tc39/proposal-accessible-object-hasownproperty/issues/18)에 피드백을 남겨주세요. (긍정적인 피드백이나 부정적인 피드백 모두 권장합니다.) | |
| 만약 `Object.hasOwn()`를 사용하고 있다면, [issue #18](https://github.com/tc39/proposal-accessible-object-hasownproperty/issues/18)에 피드백을 남겨주세요. (긍정적인 피드백이나 부정적인 피드백 모두 권장합니다). |
|
|
||
| MDN 공식문서는 `Object.prototype.hasOwnProperty`에 대해 프로토타입 체인의 메서드를 직접적으로 사용하지 말라는 [조언][mdn-hasownproperty-advice]을 포함합니다. | ||
|
|
||
| > JavaScript는 hasOwnProperty 속성의 이름을 보호하지 않습니다. 그래서 객체가 이 이름의 속성을 가질 수 있다는 가능성이 존재한다면, 올바른 결과값을 가지기 위해서 외부의 hasOwnProperty를 사용할 필요가 있습니다. .... |
Contributor
There was a problem hiding this comment.
Suggested change
| > JavaScript는 hasOwnProperty 속성의 이름을 보호하지 않습니다. 그래서 객체가 이 이름의 속성을 가질 수 있다는 가능성이 존재한다면, 올바른 결과값을 가지기 위해서 외부의 hasOwnProperty를 사용할 필요가 있습니다. .... | |
| > JavaScript는 hasOwnProperty 속성의 이름을 보호하지 않습니다. 그래서 객체가 이 이름의 속성을 가질 수 있다는 가능성이 존재한다면, 올바른 결과값을 가지기 위해서 외부의 hasOwnProperty를 사용할 필요가 있습니다 [...] |
[...] 표시가 중략의 느낌이라서 그대로 가져왔는데 어떻게 생각하시나요?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
아
pull이 습관이 되어버린 나머지 그냥 해버렸습니다.rebase!!🙇🏻♂️