quirkey / sammy

Sammy is a tiny javascript framework built on top of jQuery, It's RESTful Evented Javascript.
http://sammyjs.org
MIT License
2.99k stars 384 forks source link

change sequence of assignment in app#route #210

Closed luckydrq closed 10 years ago

luckydrq commented 10 years ago

if no verb argument is applied in app.route(verb, path), the code snippet below mistakes in assignment sequence:

// if the method signature is just (path, callback)
// assume the verb is 'any'
  if (callback.length === 0 && _isFunction(path)) {
    path = verb;
    callback = [path];
    verb = 'any';
  }
endor commented 10 years ago

Thanks, this makes sense. Could you please add a test for that?

endor commented 10 years ago

Thanks.