Bug 351473 - [editor] Incorrect local variable highlighting
Summary: [editor] Incorrect local variable highlighting
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 12:19 EDT by Victor Homyakov CLA
Modified: 2013-06-19 11:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Homyakov CLA 2011-07-07 12:19:12 EDT
Overview:
The local variable is not highlighted in closure.

Steps to Reproduce:
1. Create JavaScript file
(function() {
  var pasteEventName = (Prototype.Browser.IE ? 'paste' : 'input'), storageKey = "mask_data";

  function setMask(element) {
    (function(element) {
      var input = element;
      if (!input.readAttribute("readonly")) {
        input.observe("mask:unmask", function() {
          input.store(storageKey, undefined).stopObserving(pasteEventName);
        });
      }
    })(element);
    return element;
  }

  setMask.storageKey = storageKey;
})();

2. Click on the declaration of storageKey variable (2nd line of the script).

Actual Results:
Only two occurrences of storageKey are highlighted (on 2nd and 16th lines).

storageKey on the 9th line is incorrectly highlighted as occurrence of setMask.storageKey.

Expected Results:
Three occurrences should be highlighted (on 2nd, 9th and 16th lines). 

Build Date & Platform:
Eclipse J2EE Indigo 20110615-0604, JSDT 1.3.0.v201103031824
Comment 1 Victor Homyakov CLA 2012-07-06 04:19:02 EDT
This bug is still present in Web Tools 3.4.0