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

Typed this in JavaScript Object Literals #16184

Closed
mjbvz opened this issue Jun 1, 2017 · 4 comments
Closed

Typed this in JavaScript Object Literals #16184

mjbvz opened this issue Jun 1, 2017 · 4 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jun 1, 2017

From microsoft/vscode#27693

TypeScript Version: 2.3.4

const obj = {
    prop: 2,

    method() {
        this.prop|
    }
}

#14141 added typing for this in object literals in certain cases. Should this also be applied in regular JavaScript for intellisense, perhaps in a less strict form? We currently do not return any suggestions for this.| in obj

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Jun 1, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Jun 1, 2017

referenced in #14617

@mhegazy mhegazy added this to the TypeScript 2.5 milestone Jun 1, 2017
@mhegazy mhegazy added Bug A bug in TypeScript Salsa labels Jun 1, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Jun 1, 2017

we should enable the inference by default for .js files (similar to --noImplicitAny contingent inferences)

@n-peugnet
Copy link

ok, this is exactly what I wanted, so I think this indeed should also be applied in regular JavaScript.

@sandersn
Copy link
Member

Fix is up at #17252

@sandersn sandersn added the Fixed A PR has been merged for this issue label Jul 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

4 participants