Skip to content
Myr

Added `res.json(obj, status)` support back for BC

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 26fab2a · Browse files · 2 files+26 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+26 added−2 removed

  • tests:+19 added−0 removed
  • other:+7 added−2 removed

2 files+26 added−2 removed

modified:lib/response.js+7 added-2 removed
171 unmodified lines
172173res.json = function(obj){174 // allow status / body175 if (2 == arguments.length) {176 // res.json(body, status) backwards compat177 if ('number' == typeof arguments[1]) {178 this.statusCode = arguments[1];179 } else {176 this.statusCode = obj;177 obj = arguments[1];180 this.statusCode = obj;181 obj = arguments[1];182 }183 }184185 var app = this.app186 , jsonp = app.get('jsonp callback')
500 unmodified lines
modified:test/res.json.js+19 added