Skip to content

Conversation

@RyanCavanaugh
Copy link
Member

Addresses #1350 and probably some other suggestions as well.

This changes the "do we need to emit __extends" logic to see if a symbol named __extends is already in visible scope at the site of the class declaration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this work:

module M {
  export var __extends = () =>{};

  class A { }
  class B extends A { }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Should we have the emitter handle this, or just say that only a global __extends is valid?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can go either ways. limiting it to global __extends seems simple to implement and handles common scenarios.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please break this into multiple lines. Or provide a helper function for it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants