Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

'Didn't find a name for constructor' Error on tags genratation #44

Open
Ferroman opened this issue Jun 12, 2012 · 10 comments
Open

'Didn't find a name for constructor' Error on tags genratation #44

Ferroman opened this issue Jun 12, 2012 · 10 comments

Comments

@Ferroman
Copy link

Hi

I have tried to generate the tags using "jsctags ." command in folder with .js files, but I got an error:

$ jsctags .
Didn't find a name for constructor

/usr/local/bin/jsctags:195
                throw e;
                      ^
Error: Didn't find a name for constructor
    at errorWithCode (/usr/local/lib/cfa2/jscfa.js:157:11)
    at Array.toType (/usr/local/lib/cfa2/jscfa.js:1574:11)
    at /usr/local/lib/cfa2/jscfa.js:1994:18
    at Aval.forEachObj (/usr/local/lib/cfa2/jscfa.js:2020:5)
    at Aval.toType (/usr/local/lib/cfa2/jscfa.js:1993:8)
    at funToType (/usr/local/lib/cfa2/jscfa.js:3736:31)
    at getTags (/usr/local/lib/cfa2/jscfa.js:3786:24)
    at Object.interpret (/usr/local/lib/jsctags/ctags/interp.js:54:21)
    at Object.scan (/usr/local/lib/jsctags/ctags/index.js:104:16)
    at processPath (/usr/local/bin/jsctags:189:18)

My system info:

$ echo $NODE_PATH
/usr/local/lib/jsctags/:
$ node --version
v0.6.19
doctorjs$ git log -1
commit 96793072fb43cb0baca6025a187aeaf9f7cdfd79
Author: Dimitris Vardoulakis <[email protected]>
Date:   Sat Apr 14 15:45:09 2012 -0400

    Bugfix for exports in commonJS mode.
@averyvery
Copy link

+1

@ilya-biryukov
Copy link

I'm having the same problem on current jquery development version after 2(!!) minutes of analysis.
http://code.jquery.com/jquery-1.7.2.js

@marekkalnik
Copy link

Same here when trying to run with node 0.8.1 on Modernizr.

@wangyu0248
Copy link

yes me too!
jquery-1.7.2.js

@marekkalnik
Copy link

I've isolated a code causing the error. The example comes from Modernizr, I've left out everything that didn't change the outcome, so the code doesn't make much sense.

(function( window, document) {
    function isEventSupported( eventName, element ) {
        eventName = 'on' + eventName;
        element = document.createElement('div');
        element[eventName] = undefined;
    }
})(this, this.document);

Hope it will be of any help. I can look into it when I'll have some more time, but I don't know if it will be any time soon.

@fradeve
Copy link

fradeve commented Aug 2, 2012

same error on OpenLayers.js

echo $NODE_PATH
/usr/local/lib/jsctags/:/usr/local/lib/jsctags/:

node --version
v0.5.10

git log -1
commit 96793072fb43cb0baca6025a187aeaf9f7cdfd79
Author: Dimitris Vardoulakis <[email protected]>
Date:   Sat Apr 14 15:45:09 2012 -0400

@aquillano
Copy link

I'm seeing the same error.

@hkrish
Copy link

hkrish commented Jan 12, 2013

Same with JQuery 1.8.3

@stffrdhrn
Copy link

I didnt look too much into it, but I put a patch like this and it seems to work around the issue. The problem seems to be that cfa2 fails when it cant find a proper type, this just returns the default type of "any" instead of backing out with an exception.

This will mean we might lose some type metadata. But me this is better than not getting any ctags.

lib/cfa2/jscfa.js : ~line 1574
 if (types.length === 0)
+      return ("any");
-      throw errorWithCode(CFA_ERROR, "Didn't find a name for constructor");
 normalizeUnionType(types);

shinglyu pushed a commit to shinglyu/doctorjs that referenced this issue Nov 4, 2014
@MarcinWieczorek
Copy link

Thank you @shinglyu for the patch, it works and should be merged with the master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants