Mascara
: ECMAScript 4 → Classic JavaScript translator
Try it
Download
About
Documentation
Weblog
Contact
This version should work in most browsers. The fancy version with syntax coloring is
over here
.
Meditating...
Translate
ECMAScript 4
Run
Generated Javascript 1.2
// this is some sample Ecmascript 4.0 // the second line should generate a warning var x : int = 17; var y : int = 18.5; // example of generics: var d = new Vector.<Date>; d[1] = new Date(); d[2] = "hello"; // error! // nullable types var a : ?boolean = null; // OK! var b : !Object = null; // error! // example of classes and inheritance: class Car { var color : String; function Car(color : String) { this.color = color; } } class Volvo extends Car { function Volvo() : super("red") {} } var v : Car = new Volvo(); v.color;
Output: