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

Extending from native classes #17042

Open
bastimeyer opened this Issue Oct 4, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@bastimeyer

bastimeyer commented Oct 4, 2018

Follow up of
ember-decorators/ember-decorators#115 (comment)
and new issue here, as requested by @rwjblue

Extending a native class with .extend which itself is extending EmberObject is throwing a

TypeError: Class constructor CLASS_NAME cannot be invoked without 'new'

The motivation of this is being able to use native classes and mixins, like this:

class Foo extends EmberObject {
  // ...
}

const Bar = Foo.extend({
  // ...
});

class Baz extends Bar {
  // ...
}

See this ember-twiddle:
https://canary.ember-twiddle.com/b365ecfbc29444455d082cf1b295156b?openFiles=tests.foo-test.js%2C

@boris-petrov

This comment has been minimized.

Show comment
Hide comment
@boris-petrov

boris-petrov commented Oct 16, 2018

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Oct 16, 2018

Member

Yes, it is the same issue.

Member

rwjblue commented Oct 16, 2018

Yes, it is the same issue.

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