Skip to content

Binding identifier should care about await/yield contextΒ #44459

@Kingwl

Description

@Kingwl

Bug Report

πŸ”Ž Search Terms

parsing, await, yield

πŸ•— Version & Regression Information

  • This changed between versions 3.9.7 and now

⏯ Playground Link

Playground

πŸ’» Code

async function foo () {
  var await = 1; // should be an error, but not
}

async function bar () {
  let await = 2; // error
}

function * foo1() {
  var yield = 1; // should be an error, but not
}

function * bar1() {
  let yield = 2; // error
}

πŸ™ Actual behavior

BindingIdentifier in await/yield with var keyword does not throw errors.

πŸ™‚ Expected behavior

It should.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions