Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Named arguments that are reserved ES6 keywords cannot be destructured #392

Closed
@ochafik

Description

@ochafik

Right now we rename variables only. With destructuring of args (#180), looks like we would hit issues with reserved keywords:

main() {
  void f({delete, function}) {
    print("delete: $delete");
    print("function: $function");
  }
  f(delete: 1, function: 2);
}

Would give some syntax-error-full code:

function main() {
  function f({delete = null, function = null} = {}) {
    core.print(`delete: ${delete}`);
    core.print(`function: ${function}`);
  }
  f({delete: 1, function: 2});
}

(note: compiler currently works fine, issues are only with destructuring of named args)

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