Skip to content

Should not suggest "caller" in strict mode as it causes TypeError #6649

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

Closed
egamma opened this issue Jan 27, 2016 · 2 comments
Closed

Should not suggest "caller" in strict mode as it causes TypeError #6649

egamma opened this issue Jan 27, 2016 · 2 comments
Labels
Suggestion An idea for TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@egamma
Copy link
Member

egamma commented Jan 27, 2016

From @alexandrudima on January 27, 2016 14:22

Testing #2218

function restricted()
{
    "use strict";
    restricted.ca
}

console.log(restricted());

image

Since we're at it, it could also highlight the caller and arguments below with a squiggly indicating a TypeError:

function restricted()
{
    "use strict";
    restricted.caller;    // throws a TypeError
    restricted.arguments; // throws a TypeError
}

console.log(restricted());

Copied from original issue: microsoft/vscode#2454

@billti
Copy link
Member

billti commented Jan 27, 2016

This is beyond syntax and type checking. TypeScript also doesn't error here. This would be a considerable new feature to add.

@billti billti changed the title Salsa should not suggest "caller" in strict mode as it causes TypeError Should not suggest "caller" in strict mode as it causes TypeError Jan 27, 2016
@billti billti added Suggestion An idea for TypeScript In Discussion Not yet reached consensus labels Jan 27, 2016
@RyanCavanaugh RyanCavanaugh added Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it and removed In Discussion Not yet reached consensus labels Feb 1, 2016
@RyanCavanaugh
Copy link
Member

Not clear anyone is making this mistake

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Suggestion An idea for TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

3 participants