From 3be0d3ed0b2f62467238297cb051b1498a1ba3e5 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 7 May 2022 14:17:41 +0600 Subject: [PATCH 1/7] remove one extra break line --- 1-js/09-classes/02-class-inheritance/article.md | 1 - 1 file changed, 1 deletion(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index 48c9e468..8790465b 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -176,7 +176,6 @@ setTimeout(function() { super.stop() }, 1000); ``` ```` - ## Overriding constructor With constructors it gets a little bit tricky. From 2f56ecf1a7b09fa66ddedba9d0e91f6433b91219 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 7 May 2022 14:30:39 +0600 Subject: [PATCH 2/7] add a missed break line --- 1-js/09-classes/02-class-inheritance/article.md | 1 + 1 file changed, 1 insertion(+) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index 8790465b..ef91edeb 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -160,6 +160,7 @@ Now `Rabbit` has the `stop` method that calls the parent `super.stop()` in the p As was mentioned in the chapter , arrow functions do not have `super`. If accessed, it's taken from the outer function. For instance: + ```js class Rabbit extends Animal { stop() { From d84ebc225885040d3b1d9aa7f7d704da39a80aa9 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 7 May 2022 14:40:09 +0600 Subject: [PATCH 3/7] remove extra break lines --- 1-js/09-classes/02-class-inheritance/article.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index ef91edeb..733d5fb4 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -280,8 +280,6 @@ alert(rabbit.earLength); // 10 */!* ``` - - ### Overriding class fields: a tricky note ```warn header="Advanced note" From 060d8fe8fdd0073bca17d7c08799fd7a49cebd25 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 7 May 2022 14:42:05 +0600 Subject: [PATCH 4/7] remove another one extra break line --- 1-js/09-classes/02-class-inheritance/article.md | 1 - 1 file changed, 1 deletion(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index 733d5fb4..590eb1f1 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -374,7 +374,6 @@ Luckily, this behavior only reveals itself if an overridden field is used in the If it becomes a problem, one can fix it by using methods or getters/setters instead of fields. - ## Super: internals, [[HomeObject]] ```warn header="Advanced information" From 35d465c62bd6b280c16f83f698c5110829673ee3 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 7 May 2022 15:55:32 +0600 Subject: [PATCH 5/7] add comma --- 1-js/09-classes/02-class-inheritance/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index 590eb1f1..d46be273 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -327,7 +327,7 @@ What's odd about it? If it's not clear yet, please compare with methods. -Here's the same code, but instead of `this.name` field we call `this.showName()` method: +Here's the same code, but instead of `this.name` field, we call `this.showName()` method: ```js run class Animal { From 5fa86797bbf6c4c550df6b4a3ee6f4f9f81cfa61 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 7 May 2022 16:08:18 +0600 Subject: [PATCH 6/7] add dot --- 1-js/09-classes/02-class-inheritance/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index d46be273..c79a0aa4 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -368,7 +368,7 @@ In our case, `Rabbit` is the derived class. There's no `constructor()` in it. As So, `new Rabbit()` calls `super()`, thus executing the parent constructor, and (per the rule for derived classes) only after that its class fields are initialized. At the time of the parent constructor execution, there are no `Rabbit` class fields yet, that's why `Animal` fields are used. -This subtle difference between fields and methods is specific to JavaScript +This subtle difference between fields and methods is specific to JavaScript. Luckily, this behavior only reveals itself if an overridden field is used in the parent constructor. Then it may be difficult to understand what's going on, so we're explaining it here. From b70d33217a263c0ac53f4285899639baef99f388 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Thu, 12 May 2022 18:01:02 +0600 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=91=BE=20smth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1-js/09-classes/02-class-inheritance/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index c79a0aa4..f098b2fa 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -327,7 +327,7 @@ What's odd about it? If it's not clear yet, please compare with methods. -Here's the same code, but instead of `this.name` field, we call `this.showName()` method: +Here's the same code, but instead of `this.name` field we call `this.showName()` method: ```js run class Animal {