Skip to content

Proper Error objects with stack traces #36

@memburg

Description

@memburg

Summary

Replace raw-value throw/catch with proper Error objects that include message and stack properties.

Motivation

throw and try/catch/finally are already implemented, but exceptions are raw values with no stack trace or structured error info. Proper Error objects would greatly improve debugging and align with JS expectations.

Scope

  • Error constructor: new Error("message")
  • Error.prototype.message
  • Error.prototype.stack (string with stack trace)
  • Error.prototype.toString()
  • TypeError, ReferenceError, SyntaxError — use internally where appropriate
  • Backward-compatible: raw-value throws should still work alongside Error objects

Out of scope

  • Error.captureStackTrace
  • AggregateError
  • cause property / error.cause

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions