nl_tokens: Bug checking function that will throw an error whenever the condition sent to it is evaluated to false Processes the message and outputs the correct message if the condition is false . Otherwise it outputs null .
pl_tokens: function processCondition ( condition , errorMessage ) { if ( ! condition ) { var completeErrorMessage = '' ; var re = / at ([^\s]+)\s\( / g ; var stackTrace = new Error ( ) . stack ; var stackFunctions = [ ] ; var funcName = <mask> . exec ( stackTrace ) ; while ( funcName && funcName [ 1 ] ) { stackFunctions . push ( funcName [ 1 ] ) ; funcName = re . exec ( stackTrace ) ; } // Number 0 is processCondition itself, // Number 1 is assert, // Number 2 is the caller function. if ( stackFunctions [ 2 ] ) { completeErrorMessage = stackFunctions [ 2 ] + ': ' + completeErrorMessage ; } completeErrorMessage += errorMessage ; return completeErrorMessage ; } return null ; }