This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 459934 - [quickfix] Quick fix for removing arguments.callee
Summary: [quickfix] Quick fix for removing arguments.callee
Status: CLOSED WONTFIX
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-13 17:54 EST by Mark Macdonald CLA
Modified: 2017-01-10 15:41 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2015-02-13 17:54:04 EST
Consider the following code, which produces lint warnings:

> function f() {
>     arguments.callee; // 'arguments.callee' is deprecated.
> }

> (function() {
>     arguments.callee; // 'arguments.callee' is deprecated.
> }());

The warnings can be eliminated by replacing 'arguments.callee' with a reference to the specific function it refers to:

> function f() {
>     f;
> }

> (function __func0() {
>     __func0;
> }());

The idea being
* arguments.callee always binds to the enclosing function.
* When the "callee" function is anonymous, we generate a fresh (unbound) symbol and name it: __func0, __func1, ...

We should provide a quick fix for this. It should work in pretty much every case, barring dynamic hax like eval and the Function() constructor.
Comment 1 Michael Rennie CLA 2017-01-10 15:41:48 EST
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html