Skip to content

do expressions should allow return statements #5233

@jamiebuilds

Description

@jamiebuilds

https://twitter.com/sebmarkbage/status/825197254252257280

function method() {
  let a = do {
    if (true) return 1;
    2;
  };
  return a;
}

let result = method();

assert(result === 1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR: Spec Compliance 👓A type of pull request used for our changelog categoriesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions