Light, fast, small and well tested OOP in Javascript.
Features
- Backed by native Javascript prototypes,
- Most of definitions are processed at class-creation-time,
- Light wrappers around some constructors
- Single inheritance from base class
- Simple and handy Mixins
- Compact shortcuts for constructors
- Any level of inheritance allowed (up to your stack size :), calls to super class constructor/methods work well
- Compatible with usual prototype-bases pseudo classes - you may inherit Jassino class from mere function
Compatibility
- Object.create() is used
- Google Apps Script
At a glance
Jassino; //Namespace. It may contain members as well var Bees = {}; //--------------------------------------------------------------- ; ; ; //--------------------------------------------------------------- ; ; ; ; ; //---------------------------------------------------------------------------------------------- var Places = {}; { //native prototype-based class thisvisitors_capacity = visitors_capacity thisvisitors = } Placeprototype{ if thisvisitorslength < thisvisitors_capacity thisvisitors_capacity; return true else return false }; Placeprototype{ if thisvisitorslength < thisvisitors_capacity thisvisitors_capacity; return true else return false }; ; ; ; //---------------------------------------------------------------------------------------------- ; //--------------------------------------------------------------- ; //*************************************************************************** var hive = 20 //20 visitors max '' //hive.get_most_productive().gather(place) var queen = 'Victoria';
Installation
Browser
Include jassino.min.js into your javascript bundle/project.
Google Apps Script
Install as library, docs here
Documentation
TODO, for now see Detailed capabilities of the library may be seen from unit-test examples
Build
./build.sh
CHANGELOG
- 2.0.1 - minor cleanup
- 2.0.0 - class members syntax changed,
- there are 2 hierachies: instances and class member objects
- constructor accepts now the class, not superclass,
- and more
- 1.0.0 WIP, many changes
- 0.10.2 - improvements in decorators, multiple decorators, cached decorator, more tests
- 0.10.0 - breaking changes for class members
- 0.9.0 - full rewrite - breaking changes
- v0.5.0 - breaking changes, shortcut constructor changes for super case:
'super_a, super_b, ... ## c, d,...', jassino is now compatible with CoffeeScript 'super' call for ancestor methods, and super constructor in case of explicit declaration of constructor in derived class Error reporting on parameters improved. - v0.4 - breaking changes, shortcut constructors ['par1', 'par2', ...] -> 'par1, par2,...', for super constructor [['a', 'b',...]['c', 'd',...]] - > ['a, b, ...', 'c, d,...']
- v0.3 - first stable version