Adding a source map for the entire snapshot was expensive in terms of
memory and seemed to be triggering some sort of bug in Chromium when
reloading with the DevTools open.
The custom row translation relies on a much more compact representation
of the data and avoids the crash.
Signed-off-by: Nathan Sobo <nathan@github.com>
When calling remote functions or emitting deprecation warnings
respectively Electron and Grim create a fake `Error` object to retrieve
the stack trace of the current call site.
When doing this for the first time, if the call site was located inside
a snapshotted file, previously we would parse the source map for the
snapshot and translate the position of each call in the stack trace.
However, since the snapshot source map is quite big, we were observing
major slowdowns when parsing it for the first time.
With this commit we will parse the snapshot source map while generating
the snapshot, which will allow to not pay for it during runtime.
Signed-off-by: Michelle Tilley <binarymuse@github.com>
This will report the correct file and line numbers on stack traces
instead of always showing `<embedded>:absoluteLineNumber`. As a result,
it will also fix the `notifications` package, which will be able again
to identify which package threw an exception and to create an issue on
its repository.
Previously, prepareStackTraceWithStackAssignment could end up calling
itself when third-party code assigned Error.prepareStackTrace back
to its original value. Now, we short-circuit this process if the
rawStack property has already been assigned.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This error will only happen when the compile-cache file is compiled
twice, which seems to be happening on windows when running specs.
This doesn't fix that problem, but prevents further errors from
cascading in a confusing way.
Previously, our Error.convertStackTrace function was provided by coffeestack,
which only works for coffee-script. This adds a dependency on 'source-map-support',
which works for any source file with inline source maps.
This also refactors the code for registering our compilers (coffee-script,
typescript, and babel) so that caching logic is shared.