Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added information about the new, required, class metadata property

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 (wink) ):

Code Block
languagejavascript
/**
 * 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:

  1. implemented interfaces:
    Code Block
    languagejavascript
    
    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.

...