Dynamic override?

Topics: General, Language Specification
Nov 18, 2012 at 6:51 PM

I am looking to define an override function in a class, but only for certain browsers. I don't want to have to implement browser checks everywhere and call some derived class, I would prefer to just define an override, but only for certain conditions.

How would I go about doing this? 

Nov 18, 2012 at 7:22 PM
redtoline wrote:

I am looking to define an override function in a class, but only for certain browsers. I don't want to have to implement browser checks everywhere and call some derived class, I would prefer to just define an override, but only for certain conditions.

How would I go about doing this? 

I have also been looking to accomplish something along these lines. Unfortunately, I have yet to discover a way to accomplish this in TypeScript, so I resorted to a small library called jTypes instead. But hopefully someone can shed some light on this question, because I would like to know the answer as well since some of my other projects are still relying on TypeScript.

Nov 19, 2012 at 4:31 PM

Thank you! That's exactly what I was looking for. It's a shame I can't do this with TypeScript, but so be it.