js/ka-validator.js
/**
     * Parses the specified code returning an Abstract Syntax Tree object. If there is
     * an exception, an alert object is added to the alerts collection parameter and
     * undefined is returned.
     * @param {string} script - the javascript code to parse
     * @param {Object[]} alerts - the alerts object where any parsing errors are placed
     */
Parses the specified code returning an Abstract Syntax Tree object. If there is
an exception, an alert object is added to the alerts collection parameter and
undefined is returned.
@param {string} script - the javascript code to parse
@param {Object[]} alerts - the alerts object where any parsing errors are placed
Parses the specified code returning an Abstract Syntax Tree object . If there is an exception an alert object is added to the alerts collection parameter and undefined is returned . @param { string } script - the javascript code to parse @param { Object [] } alerts - the alerts object where any parsing errors are placed
function parseCode(script, alerts) {
        try {
            return acorn.parse(script);
        } catch (e) {
            alerts.push({
                type: alertTypes.PARSER_ERROR,
                message: e.message
            });
        }
        return undefined;
    }
function parseCode ( script , alerts ) { try { return acorn . parse ( script ) ; } catch ( e ) { alerts . push ( { type : alertTypes . PARSER_ERROR , message : e . message } ) ; } return undefined ; }
Parses the specified code returning an Abstract Syntax Tree object.
Parses the specified code returning an Abstract Syntax Tree object .