Skip to content

AST seems to allow MemberExpression in function parameter list (T7068) #4059

@babel-bot

Description

@babel-bot

Issue originally made by Francisco (tolmasky)

Bug information

  • Babel version: 6.4.5
  • Node version: 0.12.9
  • npm version: 2

Input code

https://runkit.com/tolmasky/babel-function-declaration-params-issue/1.0.0

Description

require("babel-types").NODE_FIELDS.FunctionDeclaration.params.validate.chainOf[1].each lists “LVal”, which contains “MemberExpression"

This means that function parameters can be Member Expressions. This may totally be correct, but I am not familiar with this and certainly when you try to parse:

function a(a.b) { } it fails.

However, constructing that does not break validation, and get code generated (see reduction above in input code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has PRhelp wantedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions