@trevnorris are you saying the code should switch from `assert` to `util.*`? It's not clear from your wording.

On Aug 5, 2013, at 8:50, Trevor Norris <notifications@github.com> wrote:

> In lib/continuation_local_storage.js:
> 
> > +Namespace.prototype.exit = function(context) {
> > +  assert(context, 'context must be provided for exiting');
> > +
> > +  // Fast path for most exits that are at the top of the stack
> > +  if (this.active === context) {
> > +    assert(this._stack.length, 'can\'t remove top context');
> > +    this.active = this._stack.pop();
> > +    return;
> > +  }
> > +
> > +  // Fast search in the stack using lastIndexOf
> > +  var index = this._stack.lastIndexOf(context);
> > +  assert(index >= 0, 'context not currently entered; can\'t exit');
> > +  assert(index, 'can\'t remove top context');
> > +  this.active = this._stack[index - 1];
> > +  this._stack.length = index - 1;
> Never use assert in hot code. Calling to a global function requires a context switch, but since we do the same with debug and the new until.is* not we actually care.
> \
> Reply to this email directly or view it on GitHub.