From 3d5573921e732c4a63794e5d25f5953d0a40ff0e Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 28 Jun 2023 13:53:09 -0700 Subject: 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> --- test/js/node/v8/capture-stack-trace.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/js/node/v8/capture-stack-trace.test.js') 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(); -- cgit v1.2.3