Skip to content

runtime/codegen: evaluate async function default parameters and trailing-comma length semantics #3567

Description

@andrewtdiz

Summary

Async function default parameters are evaluated in the correct parameter environment, abrupt completions propagate, and .length ignores parameters after the first default/trailing syntax per spec.

Affected Test262 rows

Perry actual behavior from report

  • 7 x diff: (no output)
  • 1 x runtime-fail: TypeError: value is not a function
  • 1 x runtime-fail: Uncaught exception: length is properly set Expected SameValue(«2», «1») to be true
  • 1 x runtime-fail: Uncaught exception: Test262Error:

Node / ECMAScript expected behavior

Async function default parameters are evaluated in the correct parameter environment, abrupt completions propagate, and .length ignores parameters after the first default/trailing syntax per spec.

Likely subsystem

HIR parameter environment lowering / async function metadata

Acceptance criteria

  • Default parameter reference ordering and abrupt completion rows match Node.
  • Async function .length for default/trailing-comma cases matches Test262.
  • The async body is not entered after a parameter-initializer throw.

Validation

Run the Test262 differential against the affected area and confirm these rows leave the gap report:

scripts/test262_subset.py --root vendor/test262 --dir language/statements/async-function --sample-cap 99999 --report /tmp/ASYNC_DEFAULT_PARAMS.json

This is Perry language/runtime semantics triage, not a Node core API compatibility issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions