Skip to content

Emit of 'arguments' in arrow functions is incorrect per ES6 spec. #1609

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

From 9.2.13 of the ES6 Spec Draft:

a. NOTE Arrow functions never have an arguments objects.

In fact, we should be capturing arguments from the first containing function expression and error if there is none. The correct emit for something like

function f() {
    return () => arguments;
}

would be the following:

function f() {
    var _arguments = arguments;
    return () => _arguments;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions