backbone.statemachine.js
function(methodNames) {
        var methods = [], i, length, method

        for (i = 0, length = methodNames.length; i < length; i++) {
          // first, check if this is an anonymous function
          if (_.isFunction(methodNames[i]))
            method = methodNames[i]
          else {
            // else, get the function from the View
            method = this[methodNames[i]]
            if (!method)
              throw new Error('Method "' + methodNames[i] + '" does not exist')
          }
          methods.push(method)
        }
        return methods
      }
function(methodNames) {
        var methods = [], i, length, method

        for (i = 0, length = methodNames.length; i < length; i++) {
          // first, check if this is an anonymous function
          if (_.isFunction(methodNames[i]))
            method = methodNames[i]
          else {
            // else, get the function from the View
            method = this[methodNames[i]]
            if (!method)
              throw new Error('Method "' + methodNames[i] + '" does not exist')
          }
          methods.push(method)
        }
        return methods
      }
function ( methodNames ) { var methods = [ ] , i , length , method for ( i = 0 , length = methodNames . length ; i < length ; i ++ ) { // first, check if this is an anonymous function if ( _ . isFunction ( methodNames [ i ] ) ) method = methodNames [ i ] else { // else, get the function from the View method = this [ methodNames [ i ] ] if ( ! method ) throw new Error ( 'Method "' + methodNames [ i ] + '" does not exist' ) } methods . push ( method ) } return methods }
Helper for collecting callbacks provided as strings.
Helper for collecting callbacks provided as strings .