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

Bug 351473

Summary: [editor] Incorrect local variable highlighting
Product: [WebTools] JSDT Reporter: Victor Homyakov <vkhomyackov>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

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