colhountech / js2-mode

Automatically exported from code.google.com/p/js2-mode
0 stars 0 forks source link

properties in an object literal that contain functions are not always highlighted as a function #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Consider the following code:

function generateQI(iids)
{
    return function(iid)
    {
        // …
    };
}

var obj = {
    foo: function() { },
    QueryInterface: generateQI([iface1, iface2])
};

What is the expected output? What do you see instead?

The expected outcome is that both property names 'foo' and 'QueryInterface'
are styled using font-lock-function-name-face. Instead 'QueryInterface' is
using font-lock-variable-name-face.

What version of the product are you using? On what operating system?

Emacs 22.0.60.2, js2-20080413.el

Please provide any additional information below.

This example is drawn from common usage in the Firefox codebase, but
obviously it could occur anywhere.

Original issue reported on code.google.com by dlb...@gmail.com on 17 Apr 2008 at 12:28

GoogleCodeExporter commented 8 years ago
This is unlikely to be fixed any time soon, as it requires flow-graph analysis 
not
currently present in js2-mode (except for the inconsistent return-usage stuff 
that I
borrowed from Rhino.)

Original comment by steve.ye...@gmail.com on 19 Apr 2008 at 9:10