Extending from native classes
See original GitHub issueFollow up of https://github.com/ember-decorators/ember-decorators/issues/115#issuecomment-427057102 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:19 (15 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
Extend those Native Classes! - Medium
We can extend native classes to get more out of them. ... Overriding & extending native classes to reap more usability through retroactive...
Read more >Extending built-in classes - The Modern JavaScript Tutorial
As we already know, native classes extend each other. For instance, Array extends Object . Normally, when one class extends another, ...
Read more >Native Classes - Octane Upgrade Guide - Ember Guides
Use the create static method to create instances of the class: const Person = EmberObject.extend({}); let jen = Person. · You can pass...
Read more >Missing extension of native class? - Unity Answers
[System.Serializable] public class Dialogues { public string speakerName; public Animator anim;. [TextArea( ...
Read more >Extending Classes And Interfaces - NativeScript Docs
The main difference between inheriting classes and implementing interfaces in NativeScript is the use of the extend keyword. Basically, you implement an ...
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

If you create a patched version extend in your app so that babel compiles it according to your App settings.
then import from that in your app it should workaround the problem until we publish the es so that ember-cli compiles ember with the same babel settings.
Great! Thanks for link 😃