There are two tools that will greatly improve the quality of the code in the JS framework, if used consistently. They are: gjslint and JSHint.
Class Metadata
Each class in the FlexJS JS framework needs to have the following member (replace class and package name with relevant information ):
Code Block | ||
---|---|---|
| ||
/**
* Metadata
*
* @type {Object.<string, Array.<Object>>}
*/
org.apache.flex.core.Application.prototype.FLEXJS_CLASS_INFO =
{ names: [{ name: 'Application',
qName: 'org.apache.flex.core.Application'}] }; |
This property must hold at least the 'names' array, but must also contain the following metadata information, if relevant:
- implemented interfaces:
Code Block language javascript org.apache.flex.core.Application.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Application', qName: 'org.apache.flex.core.Application'}], interfaces: [org.apache.flex.core.IBead] };
gjslint
gjslint is the linter that comes with the Google Closure Tools. You can download it from here and get instructions on how to install and use it.
...