File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22var EventEmitter = require ( 'events' ) . EventEmitter ;
33var util = require ( 'util' ) ;
44
5- function extendTrace ( object , property ) {
5+ function extendTrace ( object , property , pos ) {
66 var old = object [ property ] ;
7- object [ property ] = function ( x ) {
7+ object [ property ] = function ( ) {
88 var error = new Error ( ) ;
99 var name = object . constructor . name + '#' + property + '(' +
1010 Array . prototype . slice . call ( arguments ) . map ( function ( el ) {
1111 return util . inspect ( el , false , 0 ) ;
1212 } ) . join ( ', ' ) + ')' ;
1313
14- var last = arguments . length - 1 ;
15- var cb = arguments [ last ] ;
16- if ( typeof arguments [ last ] === 'function' ) {
17- arguments [ last ] = function replacement ( ) {
14+ if ( typeof pos === 'undefined' ) pos = - 1 ;
15+ if ( pos < 0 ) pos += arguments . length ;
16+ var cb = arguments [ pos ] ;
17+ if ( typeof arguments [ pos ] === 'function' ) {
18+ arguments [ pos ] = function replacement ( ) {
1819 try {
1920 return cb . apply ( this , arguments ) ;
2021 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments