Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 460976

Summary: [linting] Do not warn about arguments.callee and arguments.caller if not in a functional scope
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

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'].