This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 460976 - [linting] Do not warn about arguments.callee and arguments.caller if not in a functional scope
Summary: [linting] Do not warn about arguments.callee and arguments.caller if not in a...
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 8.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 9.0   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-26 12:44 EST by Michael Rennie CLA
Modified: 2015-02-26 14:07 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2015-02-26 12:44:51 EST
Consider the following snippet:

var arguments = {
 callee: 1
}
arguments.callee;

The 'callee' part will be tagged as deprecated (when it shouldn't be)

we should only be warning about the use when inside functions, like:

function f() {
  arguments.callee();
}

and

var f = function f() {
  arguments.callee();
}

and

function* f() {
 yield arguments.caller();
}

var f = function* f() {
 yield* arguments.caller();
}
Comment 1 Michael Rennie CLA 2015-02-26 14:07:11 EST
Fix + tests:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f12fa7c1d7047203d1770e0a713b9147c271b0f8

also updated the rule to check for arguments['callee'] and arguments['caller'].