Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property initializers capture the wrong 'arguments' value #2779

Closed
DanielRosenwasser opened this issue Apr 15, 2015 · 2 comments
Closed

Property initializers capture the wrong 'arguments' value #2779

DanielRosenwasser opened this issue Apr 15, 2015 · 2 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@DanielRosenwasser
Copy link
Member

When a variable named arguments is used in a property initializer, our emitted code refers to the wrong arguments.

Input

var arguments = 100;

class C {
    y = arguments;
    constructor() {
    }
}

Output

var arguments = 100;
var C = (function () {
    function C() {
        this.y = arguments;
    }
    return C;
})();
@mhegazy
Copy link
Contributor

mhegazy commented May 7, 2015

This looks like the instance side of #442.

@mhegazy mhegazy added this to the Community milestone May 7, 2015
@mhegazy mhegazy added the Help Wanted You can do this label May 7, 2015
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@RyanCavanaugh
Copy link
Member

All cool code is in strict mode now

@RyanCavanaugh RyanCavanaugh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants