Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Causes observable changes with prepareStackTrace

Offen
#8 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
javascript
Bereich
tooling

Rechercherichtung

Start with the issue's Error.captureStackTrace and Error.prepareStackTrace example, then inspect the linked source-map-support implementation at source-map-support.js around line 397. Compare the observable ordering and evaluation-cost concerns described here; the work is complete when the proposal has a decided behavior and its compatibility implications are documented.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

When requiring the stack properties value to be eagerly evaluated in captureStackTrace there is a problematic interaction with the existing accompanying prepareStackTrace. That one allows arbitrarily formatting of the stack trace attached to the error object. This makes it observable when the string content of the stack property is computed.

The proposal here would require eager evaluation of the stack formatting code at captureStackTrace time. Whereas the current implementation does it lazily.

Error.prepareStackTrace = (error, stack) => {console.log("2. prepare")};
let err = {}; 
Error.captureStackTrace(err);
console.log("1. capture");
err.stack;

Here we would essentially have to swap the order of effect 1 and 2.

I think this is not just a theoretical issue. Next to an observable change in behavior it would also make the prepareStackTrace API prohibitively expensive to use.

There is evidence of effectfull and expensive prepareStackTrace handlers, see e.g., source-map-support for node.

Vorherrschende Sprache
Keine Sprachdaten
Sterne
15
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus tc39/proposal-error-capturestacktrace

Alle Issues in tc39/proposal-error-capturestacktrace

Ähnliche Issues

Weitere Issues zu DevTools

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.