A5 employs a completely new, ground up rethink of how close object oriented JavaScript can mirror classical OOP languages like C# and Java, while retaining the performance benefits of the prototype object model and working in zero compile, native JavaScript objects.
A5 Language Features:
- Classes, interfaces, enums, and mixins
- Import statements and validated packages
- Instance and static members
- Real constructors, named to match their owner class
- Superclass accessors
- Dealloc destructors
- Validation enforced override and final method declarations
- Reflection on classes and methods
- Attributes for applying meta information to classes and methods
- Singleton, Abstract, and Final class declarations
- Aspect oriented cross-cutting (before/after/around) for methods
Validated on: IE 5.5+ FF2+ Chrome Safari 3.2+, CommonJS compliant
Defining a class: hello world
|
1 2 3 4 5 6 7 8 9 10 |
a5.Package('sampleApp') .Class('Foo', function(cls, im){ cls.Foo = function(){ console.log('Hello World!'); } }); a5.Create(sampleApp.Foo); |
