The ECMAScript 4 support is only part of the goal of the project. Another part is to check integrity in existing classic JavaScript by performing static analysis. For example, inheritance through prototypes or other JavaScript patterns can (at least to a certain extent) be statically inferred, which allows us to catch a number of errors.
One idea I have been toying with, is to allow type annotations in comments on existing JavaScript, eg.
/* type Point = {x : int, y: int}; */
var p /* : Point */ = {x: 10, y: 100};
Ugly, yes, but might be a viable path for developers who are not ready to jump ship to ES4, but still would like better integrity checks. I believe this becomes more desirable the large the code base.
One idea I have been toying with, is to allow type annotations in comments on existing JavaScript, eg.
Ugly, yes, but might be a viable path for developers who are not ready to jump ship to ES4, but still would like better integrity checks. I believe this becomes more desirable the large the code base.