chaijs / assertion-error

Error constructor for test and validation frameworks that implements standardized AssertionError specification.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Let the callee be configurable instead of depending on `arguments.callee`.

dead-claudia opened this issue · comments

First, it's deprecated and considered legacy. Second, not all callers may necessarily call it at the top level, so you can end the stack traces at the API boundary.

arguments.callee references the currently executing function. I'm not sure why it was arguments.callee instead of AssertionError in the first place; that line is from 2013, well before my time here.

Anyway, the AssertionError function is merely the default starting point to remove frames from the stack trace. It can already be overridden by passing a function as the ssf parameter.

Okay. Thanks! (I crossed up arguments.caller with arguments.callee. Haven't dealt with those in a while.)