-
Notifications
You must be signed in to change notification settings - Fork 846
[재작업] 1-js/09-classes/02-class-inheritance 리뷰 반영 및 오류 수정 #330
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
[재작업] 1-js/09-classes/02-class-inheritance 리뷰 반영 및 오류 수정 #330
Conversation
[클래스상속] 리뷰반영 및 오류수정 [클래스상속] 리뷰반영 및 오류수정 Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/task.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/solution.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/article.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/2-clock-class-extended/task.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/solution.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/solution.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/solution.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/solution.md Co-Authored-By: Ju Yeong <[email protected]> Update 1-js/09-classes/02-class-inheritance/3-class-extend-object/solution.md Co-Authored-By: Ju Yeong <[email protected]> [클래스상속] 리뷰반영 및 오류수정 [클래스상속] 리뷰반영 및 오류수정 [클래스상속] 오류수정 Revert "[클래스상속] 오류수정" This reverts commit f487d7a Revert "[클래스상속] 리뷰반영 및 오류수정" This reverts commit 1f3c59a [클래스상속] 오류수정2 [클래스상속] 오류수정
|
||
Here's the code with `Rabbit` extending `Animal`. | ||
아래에 `Animal` 클래스를 상속하는 `Rabbit` 코드가 있습니다. |
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.
아래에 `Animal` 클래스를 상속하는 `Rabbit` 코드가 있습니다. | |
아래에 `Animal` 클래스를 상속하는 `Rabbit` 클래스에 대한 코드가 있습니다. |
조금 더 의미 전달이 잘 되게 수정해 보았습니다. 😀
|
||
We've got a `Clock` class. As of now, it prints the time every second. | ||
`Clock`이라는 매초 시간을 출력하는 클래스가 있습니다. |
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.
뒤에 공백이 들어갔는데 제거 부탁드립니다.
|
||
|
||
[js src="source.view/clock.js"] | ||
|
||
Create a new class `ExtendedClock` that inherits from `Clock` and adds the parameter `precision` -- the number of `ms` between "ticks". Should be `1000` (1 second) by default. | ||
`Clock`을 상속받는 `ExtendedClock`을 생성하고, `precision`이라는 매개변수를 추가해보세요. `precision`은 '초' 사이의 간격을 의미하고, 기본값은 `1000`(1초)이 되어야 합니다. |
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.
`Clock`을 상속받는 `ExtendedClock`을 생성하고, `precision`이라는 매개변수를 추가해보세요. `precision`은 '초' 사이의 간격을 의미하고, 기본값은 `1000`(1초)이 되어야 합니다. | |
`Clock`을 상속받는 `ExtendedClock`을 생성하고, `precision`이라는 매개변수를 추가해보세요. `precision`은 '초' 사이의 간격을 의미하고, 기본값은 `1000`(1초)이 되어야 합니다. |
띄어쓰기가 두 칸 들어갔네요.
@@ -37,45 +37,45 @@ alert( Rabbit.prototype.__proto__ === Object.prototype ); // (1) true | |||
alert( Rabbit.__proto__ === Object ); // (2) true | |||
``` | |||
|
|||
So `Rabbit` now provides access to static methods of `Object` via `Rabbit`, like this: | |||
그래서 `Rabbit` 이 `Object` 의 정적인 메서드에 `Rabbit` 을 통해서 접근할 수 있게 해야 합니다. 아래와 같이 말이죠. |
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.
그래서 `Rabbit` 이 `Object` 의 정적인 메서드에 `Rabbit` 을 통해서 접근할 수 있게 해야 합니다. 아래와 같이 말이죠. | |
그래서 `Rabbit`이 `Object`의 정적 메서드에 `Rabbit`을 통해서 접근할 수 있게 해야 합니다. 아래와 같이 말이죠. |
|
||
```js run | ||
class Rabbit extends Object {} | ||
|
||
*!* | ||
// normally we call Object.getOwnPropertyNames | ||
// 보통은 Object.getOwnPropertyNames 로 호출합니다. |
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.
// 보통은 Object.getOwnPropertyNames 로 호출합니다. | |
// 보통은 Object.getOwnPropertyNames 로 호출합니다. |
alert( Rabbit.__proto__ === Function.prototype ); // as any function by default | ||
alert( Rabbit.prototype.__proto__ === Object.prototype ); // (1) (true Rabbit의 프로토타입은 객체의 프로토타입입니다. - Chris) | ||
alert( Rabbit.__proto__ === Object ); // (2) false (!) (Rabbit의 프로토타입은 객체가 아닙니다. - Chris) | ||
alert( Rabbit.__proto__ === Function.prototype ); // 어떠한 함수든 기본으로 (__proto__는 함수의 프로토타입입니다. - Chris) |
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.
옮긴이
가 맞아요~ 제가 작업중이어서 이 PR엔 이제 리뷰 안해주셔도 될것같습니다.
|
||
By the way, `Function.prototype` has "generic" function methods, like `call`, `bind` etc. They are ultimately available in both cases, because for the built-in `Object` constructor, `Object.__proto__ === Function.prototype`. | ||
어쨌든 `Function.prototype` 은 `call`, `bind` 기타 등등의 "제네릭" 함수의 메서드를 가집니다. 제네릭 함수들은 궁극적으로 두 가지 경우에 모두 사용 가능합니다. 왜냐하면, `Object`의 내장된 생성자는 `Object.__proto__ === Function.prototype` 이기 때문이죠. |
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.
어쨌든 `Function.prototype` 은 `call`, `bind` 기타 등등의 "제네릭" 함수의 메서드를 가집니다. 제네릭 함수들은 궁극적으로 두 가지 경우에 모두 사용 가능합니다. 왜냐하면, `Object`의 내장된 생성자는 `Object.__proto__ === Function.prototype` 이기 때문이죠. | |
어쨌든 `Function.prototype`은 `call`, `bind` 등의 "제네릭" 함수의 메서드를 가집니다. 제네릭 함수들은 궁극적으로 두 가지 경우에 모두 사용 가능합니다. 왜냐하면, `Object`의 내장된 생성자는 `Object.__proto__ === Function.prototype`이기 때문이죠. |
|
||
Internally, `extends` keyword works using the good old prototype mechanics. It sets `Rabbit.prototype.[[Prototype]]` to `Animal.prototype`. So, if a method is not found in `Rabbit.prototype`, JavaScript takes it from `Animal.prototype`. | ||
내부적으로, `extends` 키워드는 오래된 좋은 방법인 프로토타입 매커니즘을 사용합니다. extends 키워드는 `Rabbit.prototype.[[Prototype]]`을 `Animal.prototype`으로 설정합니다. 그래서 `Rabbit.prototype`에서 메서드를 찾을 수 없으면 자바스크립트는 `Animal.prototype`으로부터 가져옵니다. |
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.
내부적으로, `extends` 키워드는 오래된 좋은 방법인 프로토타입 매커니즘을 사용합니다. extends 키워드는 `Rabbit.prototype.[[Prototype]]`을 `Animal.prototype`으로 설정합니다. 그래서 `Rabbit.prototype`에서 메서드를 찾을 수 없으면 자바스크립트는 `Animal.prototype`으로부터 가져옵니다. | |
내부적으로, `extends` 키워드는 오래된 좋은 방법인 프로토타입 매커니즘을 사용합니다. `extends` 키워드는 `Rabbit.prototype.[[Prototype]]`을 `Animal.prototype`으로 설정합니다. 그래서 `Rabbit.prototype`에서 메서드를 찾을 수 없으면 자바스크립트는 `Animal.prototype`으로부터 가져옵니다. |
백틱이 빠져있네요.
|
||
````smart header="Any expression is allowed after `extends`" | ||
Class syntax allows to specify not just a class, but any expression after `extends`. | ||
````smart header="`extends` 이후에 어떠한 표현형식이든 가능합니다" |
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.
````smart header="`extends` 이후에 어떠한 표현형식이든 가능합니다" | |
````smart header="`extends` 이후에 어떠한 표현형식이든 가능합니다." |
|
||
If accessed, it's taken from the outer function. For instance: | ||
만약에 부모 함수에 접근 가능하다면 외부의 함수에서 가져왔을 겁니다. 아래 예제를 보면 알 수 있습니다. |
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.
만약에 부모 함수에 접근 가능하다면 외부의 함수에서 가져왔을 겁니다. 아래 예제를 보면 알 수 있습니다. | |
부모 함수에 접근이 가능하다면 외부의 함수에서 가져왔을 겁니다. 아래 예제를 보면 알 수 있습니다. |
|
||
The task may seem simple, but it isn't. The engine knows the current object `this`, so it could get the parent `method` as `this.__proto__.method`. Unfortunately, such a "naive" solution won't work. | ||
작업은 단순해 보일 수도 있지만 그렇지 않습니다. 엔진은 현재 객체 `this`를 알고 있으므로, 부모 `method`를 `this.__ proto __. method`로 얻을 수 있을 것 같지만 불행히도 이러한 "간단한" 해결책은 효과가 없습니다. |
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.
작업은 단순해 보일 수도 있지만 그렇지 않습니다. 엔진은 현재 객체 `this`를 알고 있으므로, 부모 `method`를 `this.__ proto __. method`로 얻을 수 있을 것 같지만 불행히도 이러한 "간단한" 해결책은 효과가 없습니다. | |
작업은 단순해 보일 수도 있지만 그렇지 않습니다. 엔진은 현재 객체 `this`를 알고 있으므로, 부모 `method`를 `this.__proto__.method`로 얻을 수 있을 것 같지만 불행히도 이러한 "간단한" 해결책은 효과가 없습니다. |
|
||
In the example below, `rabbit.__proto__ = animal`. Now let's try: in `rabbit.eat()` we'll call `animal.eat()`, using `this.__proto__`: | ||
아래 `rabbit.__ proto__ = animal` 예시를 보면, `rabbit.eat ()`에서 `this.__ proto__`를 사용하여`animal.eat()`를 호출하는 것을 시도합니다. |
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.
아래 `rabbit.__ proto__ = animal` 예시를 보면, `rabbit.eat ()`에서 `this.__ proto__`를 사용하여`animal.eat()`를 호출하는 것을 시도합니다. | |
아래 `rabbit.__proto__ = animal` 예시를 보면, `rabbit.eat()`에서 `this.__proto__`를 사용하여`animal.eat()`를 호출하는 것을 시도합니다. |
@@ -323,11 +323,11 @@ let rabbit = { | |||
rabbit.eat(); // Rabbit eats. | |||
``` | |||
|
|||
At the line `(*)` we take `eat` from the prototype (`animal`) and call it in the context of the current object. Please note that `.call(this)` is important here, because a simple `this.__proto__.eat()` would execute parent `eat` in the context of the prototype, not the current object. | |||
`(*)`줄에서는 prototype (`animal`)에서 `eat`을 가져와서 현재 객체의 컨텍스트에서 호출합니다. 간단한 `this.__ proto __.eat()`은 현재 객체가 아니라 프로토타입의 맥락에서 부모의 `eat`을 실행할 것이기 때문에 `.call(this)`이 중요하게 사용되었습니다. |
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.
`(*)`줄에서는 prototype (`animal`)에서 `eat`을 가져와서 현재 객체의 컨텍스트에서 호출합니다. 간단한 `this.__ proto __.eat()`은 현재 객체가 아니라 프로토타입의 맥락에서 부모의 `eat`을 실행할 것이기 때문에 `.call(this)`이 중요하게 사용되었습니다. | |
`(*)`줄에서는 prototype (`animal`)에서 `eat`을 가져와서 현재 객체의 컨텍스트에서 호출합니다. 간단한 `this.__proto__.eat()`은 현재 객체가 아니라 프로토타입의 맥락에서 부모의 `eat`을 실행할 것이기 때문에 `.call(this)`이 중요하게 사용되었습니다. |
|
||
So, in both lines `(*)` and `(**)` the value of `this.__proto__` is exactly the same: `rabbit`. They both call `rabbit.eat` without going up the chain in the endless loop. | ||
그래서`(*)`와`(**)`두 줄에서 `this.__ proto__`의 값은 정확히 `rabbit`으로 동일합니다. 그래서 둘 다 무한 루프 속에서 `rabbit.eat`을 호출하려고 합니다. |
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.
그래서`(*)`와`(**)`두 줄에서 `this.__ proto__`의 값은 정확히 `rabbit`으로 동일합니다. 그래서 둘 다 무한 루프 속에서 `rabbit.eat`을 호출하려고 합니다. | |
그래서`(*)`와`(**)`두 줄에서 `this.__proto__`의 값은 정확히 `rabbit`으로 동일합니다. 그래서 둘 다 무한 루프 속에서 `rabbit.eat`을 호출하려고 합니다. |
|
||
 | ||
|
||
1. Inside `longEar.eat()`, the line `(**)` calls `rabbit.eat` providing it with `this=longEar`. | ||
1. `longEar.eat()` 내부에서 `(**)`는 `this = longEar`를 가지고 있는 `rabbit.eat`을 호출합니다. |
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.
1. `longEar.eat()` 내부에서 `(**)`는 `this = longEar`를 가지고 있는 `rabbit.eat`을 호출합니다. | |
1. `longEar.eat()` 내부에서 `(**)`는 `this=longEar`를 가지고 있는 `rabbit.eat`을 호출합니다. |
rabbit.eat.call(this); | ||
``` | ||
2. Then in the line `(*)` of `rabbit.eat`, we'd like to pass the call even higher in the chain, but `this=longEar`, so `this.__proto__.eat` is again `rabbit.eat`! | ||
2. 그런 다음 `rabbit.eat`의 `(*)`줄에서 더 위 단계에 호출을 전달하려고 합니다. 그러나 `this=longEar`이므로 `this.__ proto __.eat`은 다시 `rabbit.eat` 입니다! |
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.
2. 그런 다음 `rabbit.eat`의 `(*)`줄에서 더 위 단계에 호출을 전달하려고 합니다. 그러나 `this=longEar`이므로 `this.__ proto __.eat`은 다시 `rabbit.eat` 입니다! | |
2. 그런 다음 `rabbit.eat`의 `(*)`줄에서 더 위 단계에 호출을 전달하려고 합니다. 그러나 `this=longEar`이므로 `this.__proto__.eat`은 다시 `rabbit.eat` 입니다! |
|
||
When a function is specified as a class or object method, its `[[HomeObject]]` property becomes that object. | ||
함수가 클래스나 객체 메서드로 지정되면, 그것의 [[HomeObject]] 속성은 그 객체가 됩니다. |
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.
함수가 클래스나 객체 메서드로 지정되면, 그것의 [[HomeObject]] 속성은 그 객체가 됩니다. | |
함수가 클래스나 객체 메서드로 지정되면, 그것의 `[[HomeObject]]` 프로퍼티는 그 객체가 됩니다. |
|
||
### `[[HomeObject]]` | ||
|
||
To provide the solution, JavaScript adds one more special internal property for functions: `[[HomeObject]]`. | ||
해결책을 제공하기 위해 자바스크립트는 함수를 위한 `[[HomeObject]]`라는 하나의 특별한 내부 속성을 추가합니다. |
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.
해결책을 제공하기 위해 자바스크립트는 함수를 위한 `[[HomeObject]]`라는 하나의 특별한 내부 속성을 추가합니다. | |
해결책을 제공하기 위해 자바스크립트는 함수를 위한 `[[HomeObject]]`라는 하나의 특별한 내부 프로퍼티를 추가합니다. |
longEar.eat(); // Long Ear eats. | ||
*/!* | ||
``` | ||
|
||
It works as intended, due to `[[HomeObject]]` mechanics. A method, such as `longEar.eat`, knows its `[[HomeObject]]` and takes the parent method from its prototype. Without any use of `this`. | ||
`[[HomeObject]]`의 메커니즘 때문에 의도한 대로 작동합니다. `longEar.eat`과 같은 메서드는 그것의 `[[HomeObject]]`를 알고 프로토타입으로부터 부모 메서드를 취합니다. `this`를 사용하지 않고도 말이죠. |
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.
`[[HomeObject]]`의 메커니즘 때문에 의도한 대로 작동합니다. `longEar.eat`과 같은 메서드는 그것의 `[[HomeObject]]`를 알고 프로토타입으로부터 부모 메서드를 취합니다. `this`를 사용하지 않고도 말이죠. | |
`[[HomeObject]]`의 매커니즘 때문에 의도한 대로 작동합니다. `longEar.eat`과 같은 메서드는 그것의 `[[HomeObject]]`를 알고 프로토타입으로부터 부모 메서드를 취합니다. `this`를 사용하지 않고도 말이죠. |
|
리뷰에 많은 시간을 쏟아 주셔서 여기까지는 Pull Request 남기려 합니다.
리뷰해주신부분 적용된거 확인하였고 커밋합치고 올립니다.
적용할수 있을지 없을지에대해서는 판단에 따를게요.
고생많으셨습니다. 한글판 배포 잘되길 바라겠습니다!