Skip to content

Lack of ability to customize __extend() function #1193

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

Closed
Sleepyowl opened this issue Nov 18, 2014 · 2 comments
Closed

Lack of ability to customize __extend() function #1193

Sleepyowl opened this issue Nov 18, 2014 · 2 comments
Labels
By Design Deprecated - use "Working as Intended" or "Design Limitation" instead External Relates to another program, environment, or user action which we cannot control.

Comments

@Sleepyowl
Copy link

__extend() function generated by TypeScript is mostly compatible with inheritance mechanisms used by Backbone and Knockback. However, compared to Knockback extend() function, it lacks a couple of steps which leads to faulty behaviour of view models subclassed from Knockback ViewModel using TypeScript inheritance syntax.

I would like to be able to customize the way TypeScript generates inheritance code so it's possible to use TypeScript inheritance syntax with javascript libraries using their own inheritance patterns.

@RyanCavanaugh RyanCavanaugh added the External Relates to another program, environment, or user action which we cannot control. label Nov 18, 2014
@RyanCavanaugh
Copy link
Member

__extends is specifically implemented this way:

var __extends = this.__extends || function (d, b) { ...

Note the || operator -- if an __extends function is already defined, that one is used instead. If you have a different __extends function you want, you can simply add a function __extends in a script that loads before any TypeScript file to change it.

@danquirk danquirk added the By Design Deprecated - use "Working as Intended" or "Design Limitation" instead label Nov 18, 2014
@Sleepyowl
Copy link
Author

Thanks for pointing out the obvious thing. I'm ashamed I missed it. :-)

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
By Design Deprecated - use "Working as Intended" or "Design Limitation" instead External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

3 participants