# Extends clause

**URL:** <https://es.discourse.group/t/extends-clause/2042>\
**Category:** I have questions\
**Created:** [May 24, 2024, 9:39pm UTC](https://es.discourse.group/t/extends-clause/2042 "2024-05-24T21:39:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheusds](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/matheusds/32/2093_2.png) [@matheusds](https://es.discourse.group/u/matheusds)\
**Post date:** [May 24, 2024, 9:39pm UTC](https://es.discourse.group/t/extends-clause/2042/1 "2024-05-24T21:39:16Z")

</div>

I've just experienced something I didn't expect at all when using class inheritance in ECMAScript Harmony.

For users of reactive frameworks this is not a concern. It is a concern for those using class inheritance across different ECMAScript modules.

Because the class's `extends` (as in `class B extends A`) clause is resolved as soon as the class declaration is evaluated, there's no way to defer its resolution in case `A` is declared after that class.

TypeScript will not help in anyway to declare the classes in the right order, so I'm wondering if there are any plans on mimmicking ECMAScript 4 behavior here? I believe this is impossible to resolve at ECMAScript Harmony, though.

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [May 24, 2024, 10:42pm UTC](https://es.discourse.group/t/extends-clause/2042/2 "2024-05-24T22:42:18Z")

</div>

Indeed a superclass must exist before you can inherit from it. I’m not aware of any desire, need, or likelihood to change that.
