@@ -25,7 +25,6 @@ var objectToString = callBound('Object.prototype.toString');
2525var $split = callBound ( 'String.prototype.split' ) ;
2626var $replace = callBound ( 'String.prototype.replace' ) ;
2727var $strSlice = callBound ( 'String.prototype.slice' ) ;
28- var $push = callBound ( 'Array.prototype.push' ) ;
2928var $shift = callBound ( 'Array.prototype.shift' ) ;
3029var $slice = callBound ( 'Array.prototype.slice' ) ;
3130
@@ -155,7 +154,7 @@ Test.prototype.run = function run() {
155154Test . prototype . test = function test ( name , opts , cb ) {
156155 var self = this ;
157156 var t = new Test ( name , opts , cb ) ;
158- $push ( this . _progeny , t ) ;
157+ this . _progeny [ this . _progeny . length ] = t ;
159158 this . pendingCount ++ ;
160159 this . emit ( 'test' , t ) ;
161160 t . on ( 'prerun' , function ( ) {
@@ -235,12 +234,12 @@ function wrapFunction(original) {
235234 var completed = false ;
236235 try {
237236 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 } ;
239238 completed = true ;
240239 return returned ;
241240 } finally {
242241 if ( ! completed ) {
243- $push ( calls , { args : args , receiver : this , threw : true } ) ;
242+ calls [ calls . length ] = { args : args , receiver : this , threw : true } ;
244243 }
245244 }
246245 } ,
@@ -326,16 +325,16 @@ Test.prototype.intercept = function intercept(obj, property) {
326325 try {
327326 var returned = getter ( this , arguments ) ;
328327 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 } ;
330329 return returned ;
331330 } finally {
332331 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 } ;
334333 }
335334 }
336335 }
337336 }
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 } ;
339338 return value ;
340339 }
341340
@@ -346,19 +345,19 @@ Test.prototype.intercept = function intercept(obj, property) {
346345 try {
347346 var returned = setter ( this , arguments ) ;
348347 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 } ;
350349 return returned ;
351350 } finally {
352351 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 } ;
354353 }
355354 }
356355 }
357356 var canSet = isAccessor || writable ;
358357 if ( canSet ) {
359358 value = v ;
360359 }
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 } ;
362361
363362 if ( ! canSet && strictMode ) {
364363 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) {
855854 var keys = objectKeys ( expected ) ;
856855 // Special handle errors to make sure the name and the message are compared as well.
857856 if ( expected instanceof Error ) {
858- $push ( keys , 'name' , 'message' ) ;
857+ keys [ keys . length ] = 'name' ;
858+ keys [ keys . length ] = 'message' ;
859859 } else if ( keys . length === 0 ) {
860860 throw new TypeError ( '`throws` validation object must not be empty' ) ;
861861 }
0 commit comments