jquery / jquery/esprima

Invalid function parameter with async function name mistakenly produces a valid syntax

Open
#1,606 1 comment 0 reactions 1 assignee View on GitHub

@ariya is already working on this.

Since Oct 29, 2016.

defect es2017
Dominant language
TypeScript
Stars
7.1k
Forks
773
PR merge metrics
No merged PRs in 30d

Description

Test case:

esprima.parse('async({x=y})')

Expected: An exception is thrown:

Error: Line 1: Unexpected token =

Actual output: A syntax tree:

Script {
  type: 'Program',
  body: [ ExpressionStatement { type: 'ExpressionStatement', expression: [Object] } ],
  sourceType: 'script' }

Affected version: master branch revision c634d6f0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.