For AI agents: the complete documentation index is available at /tc39-atlas/en/llms.txt, the full documentation bundle is available at /tc39-atlas/en/llms-full.txt, and this page is available as Markdown at /tc39-atlas/en/proposals/year/pending/proposal-standardized-debug.md.
  • English
  • Standardized Debug S1

    Proposal details
    Proposal overview

    This proposal standardizes debugging facilities across ECMAScript implementations by introducing two meta-property functions, debugger.log and debugger.break, which are identity functions and only valid in call expression form.

    Note

    The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.

    Standardized Debug

    This proposal is at Stage 1 of the TC39 Process.

    Motivation

    Different environments expose different APIs for interacting with debugger facilities. Some of them do not expose any APIs for this at all. This proposal aims to provide standardized debugging facilities across all ECMAScript implementations. Additionally, the APIs are constrained to be identity functions - that is, they return the value which is passed to them.

    This proposal suggests adding the following meta-property-functions to ES:

    • debugger.log ( v )
    • debugger.break ( [ v ] )

    Note that, like import(), they are only valid in call expression form. For example, x().then(debugger.break) would be invalid. You would have to do x().then((v) => debugger.break(v)). This limitation is in place to ensure these methods (particularly break) are only ever invoked from ECMAScript code.