File tree Expand file tree Collapse file tree 3 files changed +5
-26
lines changed Expand file tree Collapse file tree 3 files changed +5
-26
lines changed Original file line number Diff line number Diff line change 3
3
4
4
This incorporates all changes after 4.13.1 up to 4.14.0.
5
5
6
+ * remove:
7
+ - ` res.jsonp(status, obj) ` signature - use ` res.status(status).jsonp(val) `
8
+
6
9
5.0.0-alpha.2 / 2015-07-06
7
10
==========================
8
11
Original file line number Diff line number Diff line change @@ -234,20 +234,11 @@ res.json = function json(obj) {
234
234
* res.jsonp(null);
235
235
* res.jsonp({ user: 'tj' });
236
236
*
237
- * @param {string|number|boolean|object } obj
237
+ * @param {string|number|boolean|object } val
238
238
* @public
239
239
*/
240
240
241
- res . jsonp = function jsonp ( obj ) {
242
- var val = obj ;
243
-
244
- // support res.jsonp(status, obj)
245
- if ( arguments . length === 2 ) {
246
- deprecate ( 'res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead' ) ;
247
- this . statusCode = arguments [ 0 ] ;
248
- val = arguments [ 1 ] ;
249
- }
250
-
241
+ res . jsonp = function jsonp ( val ) {
251
242
// settings
252
243
var app = this . app ;
253
244
var replacer = app . get ( 'json replacer' ) ;
Original file line number Diff line number Diff line change @@ -286,21 +286,6 @@ describe('res', function(){
286
286
} )
287
287
} )
288
288
289
- describe ( '.jsonp(status, object)' , function ( ) {
290
- it ( 'should respond with json and set the .statusCode' , function ( done ) {
291
- var app = express ( ) ;
292
-
293
- app . use ( function ( req , res ) {
294
- res . jsonp ( 201 , { id : 1 } ) ;
295
- } ) ;
296
-
297
- request ( app )
298
- . get ( '/' )
299
- . expect ( 'Content-Type' , 'application/json; charset=utf-8' )
300
- . expect ( 201 , '{"id":1}' , done )
301
- } )
302
- } )
303
-
304
289
it ( 'should not override previous Content-Types' , function ( done ) {
305
290
var app = express ( ) ;
306
291
You can’t perform that action at this time.
0 commit comments