diff options
author | 2023-06-28 13:53:09 -0700 | |
---|---|---|
committer | 2023-06-28 13:53:09 -0700 | |
commit | 3d5573921e732c4a63794e5d25f5953d0a40ff0e (patch) | |
tree | fc309e5614f6f727c4bdde030a3805625185e612 /test/js/node/v8/capture-stack-trace.test.js | |
parent | 43752ec3f0fac7ffe790272ba5d0ebbbca02572c (diff) | |
download | bun-3d5573921e732c4a63794e5d25f5953d0a40ff0e.tar.gz bun-3d5573921e732c4a63794e5d25f5953d0a40ff0e.tar.zst bun-3d5573921e732c4a63794e5d25f5953d0a40ff0e.zip |
Error.prototype.stack gets sourcemapped stacktraces and introduce Error.appendStackTrace (#3441)
* Fix potential crash when reading sourcemapped stack traces
* Format & sourcemap Error.prototype.stack
* prevent double sourcemapping
* Introduce Error.appendStackTrace
* Fix source url
* hide private stack traces in non-debug builds
* fixes #3443
* Bump WebKit
* Fix test failure in vm.test
* Support new() & add test
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'test/js/node/v8/capture-stack-trace.test.js')
-rw-r--r-- | test/js/node/v8/capture-stack-trace.test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/js/node/v8/capture-stack-trace.test.js b/test/js/node/v8/capture-stack-trace.test.js index d96f91483..cb2624681 100644 --- a/test/js/node/v8/capture-stack-trace.test.js +++ b/test/js/node/v8/capture-stack-trace.test.js @@ -5,6 +5,18 @@ afterEach(() => { Error.prepareStackTrace = origPrepareStackTrace; }); +test("Regular .stack", () => { + var err; + class Foo { + constructor() { + err = new Error("wat"); + } + } + + new Foo(); + expect(err.stack).toMatch(/at new Foo/); +}); + test("capture stack trace", () => { function f1() { f2(); |