Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: small edit (remove extra list bullet)

...

  • Support for OR typing of parameters: "@param {String|Number} name description" 
  • Support for typing parameters as Objects with certain properties:

    Code Block
    /**
     * @param {Object} person
     * @param {String} person.name
     * @param {String} person.email
     * @param {Number} [person.age] optional "age" property
     */
    function processPerson(person) {
      application.output(person.name);
      application.output(person.email);
    }
  • Support for rest parameters: Allows to indicate through JSDoc that a function can take unlimited trailing arguments of the specified type:

    Code Block
    /**
      * @param {...String} someExtraStrings One or more additional String can be send into this function
      */
    function methodWithRestParams(someExtraString){}
    
    
    function test() {
       methodWithRestParams('one', 'two', 'three', 'four');
    }
  • Support for typing as an instance of a Form. Can also be used to indicate that the Form must extend the specified Form:
    • @type {Form<mySuperFormName>}
  • Support for the so-called "AnyType"
    • @param * myParam A parameter that can contain any type of value. 
  • Beans are made available as types in CodeCompletion, to be used for type checking and JSDoc 
  • Support for @AllowToRunInFind on functions to indicate that the the function should be executed on event handlers while in FindMode:
    Eliminates the //controller.search() workaround. Note that that running JavaScript while in FindMode has it's limitations and not all behavior is 100% defined. More details will follow.
  • Support for @constructor tag, to indicate that a function declaration is to be used as a Constructor. Functions marked as Constructor also display differently in the Script Outline view 
  • Automatic JSDoc @type setting on global and Form variables
  • Ability to update the type of a variable by updating the JSdoc @type tag value AND the default value
  • Added specific JSDoc context for Templates (Window > Preferences > JavaScript > Editor > Templates), besides the already existing JavaScript context.
  • Added dedicated RuntimeXxxx types for all runtime element types and for Forms. For example RuntimeLabel, RuntimeTextField and RuntimeForm. These types can be used in JSDoc, but also in scripting to check if an object is and instance of a certain type, using the instanceOf operator. Note that RuntimeForm and Form are the same, RuntimeForm was added for consistency. RuntimeComponent is the base type for all default elements that Servoy Ships with
  • Removed Strict Mode option from the JavaScript Preferences: the additional warnings that where generated with Strict Mode enabled are now part of the extended JavaScript Error/Warnings preferences and thus can be enabled/disabled on individual basis  

...