mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
In V8, the `stack` property of errors contains a prelude and then the stack trace. The contents of the prelude depends on whether the error has a message or not. If the error has _not_ got a message, the prelude contains the name of the error and a newline. If the error _has_ got a message, the prelude contains the name of the error, a colon, a space, the message and a newline. In other words, the prelude consists of `error.toString() + "\n"` Before, coffee-script’s patched stack traces worked exactly like that, except that it _always_ added a colon and a space after the name of the error. This fix is important because it allows for easy and consistent consumption of the stack trace only: `stack = error.stack[error.toString().length..]`