Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Error.prototype.stack の今と未来

Error.prototype.stack の今と未来

私たちが普段の開発で何気なく見ている `Error` の stack trace は実は標準化されていません。
このトークでは `Error.prototype.stack` について、各 JavaScript Runtime の実装と、これを標準化しようとする動きを紹介します。

リンク集: https://gist.github.com/progfay/4d0a79eee4483ac34937a0e8af106acc

Avatar for Shunsuke Mano

Shunsuke Mano

November 15, 2025
Tweet

More Decks by Shunsuke Mano

Other Decks in Technology

Transcript

  1. ɾWeb Frontend Engineer ɾI like... ɾ🔍 Researching Web Trends ɾ🎤

    Japanese Rap Name: Shunsuke Mano   @progfay
  2. V8

  3. JSC

  4. JSC

  5. I believe is this seems like too much, too big,

    not well motivated as a big proposal. Make we could split it up. やりすぎ、 大 きすぎ、根拠も不 十 分に 見 える。 分割しよう。 notes/meetings/2024-12/december-05.md at 3bb70e4b6745798dc145be6859c92a7a0b6d0100 · tc39/notes proposal-error-stacks EN JP
  6. • getter: calc & cache formatted stack • setter: update

    cache V8's Error.prototype.stack is exotic! v8/src/execution/messages.cc at 740213e7e48558f16b6842bb74be0086ac2980d2 · v8/v8 v8/src/builtins/accessors.cc at 740213e7e48558f16b6842bb74be0086ac2980d2 · v8/v8 check cache & return if exists set cache
  7. proposal-error-stack-accessor • focus Error.prototype.stack accessor (getter / setter) • the

    only requirement is that it return a string Spec - Error Stack Accessor
  8. Conclusion • Present: So many runtime, so many stack format

    • Standardizing activity: proposal-error-stacks, proposal-error-stack-accessor • Future: runtimes may provide Structured stack frame There's long way to go...