nl_tokens: Determine if the given err satisfies the criteria defined by matcher : - if matcher is a String expect the error message to contain matcher - if matcher is a RegExp match the error message against it - if matcher is a Function call the function with err and return the result - if matcher is an Error expect their constructors to be the same
pl_tokens: function doesMatch ( _ref2 ) { var matcher = _ref2 . matcher ; var err = _ref2 . <mask> ; if ( typeof matcher === 'string' ) { return err . message . indexOf ( matcher ) > - 1 ; } if ( matcher instanceof RegExp ) { return matcher . test ( err . message ) ; } if ( typeof matcher === 'function' ) { return matcher ( err ) ; } if ( matcher . constructor === Error . constructor ) { return err instanceof matcher ; } throw new Error ( UNRECOGNISED_MATCHER_ERR ) ; }