@@ -25,7 +25,6 @@ var objectToString = callBound('Object.prototype.toString');
25
25
var $split = callBound ( 'String.prototype.split' ) ;
26
26
var $replace = callBound ( 'String.prototype.replace' ) ;
27
27
var $strSlice = callBound ( 'String.prototype.slice' ) ;
28
- var $push = callBound ( 'Array.prototype.push' ) ;
29
28
var $shift = callBound ( 'Array.prototype.shift' ) ;
30
29
var $slice = callBound ( 'Array.prototype.slice' ) ;
31
30
@@ -155,7 +154,7 @@ Test.prototype.run = function run() {
155
154
Test . prototype . test = function test ( name , opts , cb ) {
156
155
var self = this ;
157
156
var t = new Test ( name , opts , cb ) ;
158
- $push ( this . _progeny , t ) ;
157
+ this . _progeny [ this . _progeny . length ] = t ;
159
158
this . pendingCount ++ ;
160
159
this . emit ( 'test' , t ) ;
161
160
t . on ( 'prerun' , function ( ) {
@@ -235,12 +234,12 @@ function wrapFunction(original) {
235
234
var completed = false ;
236
235
try {
237
236
var returned = bound ? bound ( this , arguments ) : void undefined ;
238
- $push ( calls , { args : args , receiver : this , returned : returned } ) ;
237
+ calls [ calls . length ] = { args : args , receiver : this , returned : returned } ;
239
238
completed = true ;
240
239
return returned ;
241
240
} finally {
242
241
if ( ! completed ) {
243
- $push ( calls , { args : args , receiver : this , threw : true } ) ;
242
+ calls [ calls . length ] = { args : args , receiver : this , threw : true } ;
244
243
}
245
244
}
246
245
} ,
@@ -326,16 +325,16 @@ Test.prototype.intercept = function intercept(obj, property) {
326
325
try {
327
326
var returned = getter ( this , arguments ) ;
328
327
completed = true ;
329
- $push ( calls , { type : 'get' , success : true , value : returned , args : args , receiver : this } ) ;
328
+ calls [ calls . length ] = { type : 'get' , success : true , value : returned , args : args , receiver : this } ;
330
329
return returned ;
331
330
} finally {
332
331
if ( ! completed ) {
333
- $push ( calls , { type : 'get' , success : false , threw : true , args : args , receiver : this } ) ;
332
+ calls [ calls . length ] = { type : 'get' , success : false , threw : true , args : args , receiver : this } ;
334
333
}
335
334
}
336
335
}
337
336
}
338
- $push ( calls , { type : 'get' , success : true , value : value , args : args , receiver : this } ) ;
337
+ calls [ calls . length ] = { type : 'get' , success : true , value : value , args : args , receiver : this } ;
339
338
return value ;
340
339
}
341
340
@@ -346,19 +345,19 @@ Test.prototype.intercept = function intercept(obj, property) {
346
345
try {
347
346
var returned = setter ( this , arguments ) ;
348
347
completed = true ;
349
- $push ( calls , { type : 'set' , success : true , value : v , args : args , receiver : this } ) ;
348
+ calls [ calls . length ] = { type : 'set' , success : true , value : v , args : args , receiver : this } ;
350
349
return returned ;
351
350
} finally {
352
351
if ( ! completed ) {
353
- $push ( calls , { type : 'set' , success : false , threw : true , args : args , receiver : this } ) ;
352
+ calls [ calls . length ] = { type : 'set' , success : false , threw : true , args : args , receiver : this } ;
354
353
}
355
354
}
356
355
}
357
356
var canSet = isAccessor || writable ;
358
357
if ( canSet ) {
359
358
value = v ;
360
359
}
361
- $push ( calls , { type : 'set' , success : ! ! canSet , value : value , args : args , receiver : this } ) ;
360
+ calls [ calls . length ] = { type : 'set' , success : ! ! canSet , value : value , args : args , receiver : this } ;
362
361
363
362
if ( ! canSet && strictMode ) {
364
363
throw new TypeError ( 'Cannot assign to read only property `' + inspect ( property ) + '` of object `' + inspect ( obj ) + '`' ) ;
@@ -855,7 +854,8 @@ Test.prototype['throws'] = function (fn, expected, msg, extra) {
855
854
var keys = objectKeys ( expected ) ;
856
855
// Special handle errors to make sure the name and the message are compared as well.
857
856
if ( expected instanceof Error ) {
858
- $push ( keys , 'name' , 'message' ) ;
857
+ keys [ keys . length ] = 'name' ;
858
+ keys [ keys . length ] = 'message' ;
859
859
} else if ( keys . length === 0 ) {
860
860
throw new TypeError ( '`throws` validation object must not be empty' ) ;
861
861
}
0 commit comments