Is TypeScript a superset of JavaScript? Or is there valid JavaScript that doesn't compile in TS?
var x = "".constructor(5);
// The property 'constructor' does not exist on value of type 'String'.
The exceptions make sense if you dig into how the type system works. AFAIK these can always be worked around with an explicit cast to any: var x = (<any>"").constructor(5);
I've found TypeScript to be a huge win for maintainability, and can't imagine going back to raw JS for an app of any complexity. I'd love to have a chance to pair it with Node for something.Is there a guarantee that TS will remain a strict superset?
Looking at the syntax, it reminds me of Flash ActionScript, which started out as an ECMAScript implementation but became an incompatible superset that pretended to be JavaScript compatible but would whine endlessly about untyped var declarations...
Hopefully ActionScript and C++ will serve as warnings to TypeScript designers: if you're ever thinking about disrupting code compatibility with the original language in the name of added type safety, don't do it.