static/ext/src/ux/AceEditor/b339f0b799f23466a9fb3ac92af4cb7e572604a6@/worker.js
function addCommand(command) {
    if (!command.name) {
        throw new Error('All registered commands must have a name');
    }
    if (command.params == null) {
        command.params = [];
    }
    if (!Array.isArray(command.params)) {
        throw new Error('command.params must be an array in ' + command.name);
    }
    // Replace the type
    command.params.forEach(function(param) {
        if (!param.name) {
            throw new Error('In ' + command.name + ': all params must have a name');
        }
        upgradeType(command.name, param);
    }, this);
    commands[command.name] = command;

    if (command.bindKey) {
        buildKeyHash(command);   
    }

    commandNames.push(command.name);
    commandNames.sort();
}
function addCommand(command) {
    if (!command.name) {
        throw new Error('All registered commands must have a name');
    }
    if (command.params == null) {
        command.params = [];
    }
    if (!Array.isArray(command.params)) {
        throw new Error('command.params must be an array in ' + command.name);
    }
    // Replace the type
    command.params.forEach(function(param) {
        if (!param.name) {
            throw new Error('In ' + command.name + ': all params must have a name');
        }
        upgradeType(command.name, param);
    }, this);
    commands[command.name] = command;

    if (command.bindKey) {
        buildKeyHash(command);   
    }

    commandNames.push(command.name);
    commandNames.sort();
}
function addCommand ( command ) { if ( ! command . name ) { throw new Error ( 'All registered commands must have a name' ) ; } if ( command . params == null ) { command . params = [ ] ; } if ( ! Array . isArray ( command . params ) ) { throw new Error ( 'command.params must be an array in ' + command . name ) ; } // Replace the type command . params . forEach ( function ( param ) { if ( ! param . name ) { throw new Error ( 'In ' + command . name + ': all params must have a name' ) ; } upgradeType ( command . name , param ) ; } , this ) ; commands [ command . name ] = command ; if ( command . bindKey ) { buildKeyHash ( command ) ; } commandNames . push ( command . name ) ; commandNames . sort ( ) ; }
This registration method isn't like other Ace registration methods because
it doesn't return a decorated command because there is no functional
decoration to be done.
TODO: Are we sure that in the future there will be no such decoration?
This registration method isn t like other Ace registration methods because it doesn t return a decorated command because there is no functional decoration to be done . TODO : Are we sure that in the future there will be no such decoration?