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

TypeError: Cannot call method 'sort' of undefined #59

Open
exos opened this issue May 28, 2014 · 2 comments
Open

TypeError: Cannot call method 'sort' of undefined #59

exos opened this issue May 28, 2014 · 2 comments

Comments

@exos
Copy link

exos commented May 28, 2014

Hi! I'm using vim + tagbar plugin and this use jsctags for generate a tags explorer.

For configure it I folllow this:
https://github.com/majutsushi/tagbar/wiki#javascript

But, when I try to open the panel, vim reports this error:

Executed command: "'/usr/bin/jsctags'  -f -  '/tmp/v2XOofL/28.js'"
Command output:
Array.prototype.push called on null or undefined
/usr/lib/node_modules/jsctags/jsctags/ctags/writer.js:89
        this.tags = this.tags.sort(sortfunc);
                              ^
TypeError: Cannot call method 'sort' of undefined
    at Object.exports.TagWriter.Trait.write (/usr/lib/node_modules/jsctags/jsctags/ctags/writer.js:89:31)
    at Object.<anonymous> (/usr/lib/node_modules/jsctags/bin/jsctags.js:269:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

I trayed to run this manually:

jsctags -f - gui.js

And the error is the same.

More info:

$ node -v 
v0.10.26
$ npm info jsctags | grep version
npm http GET https://registry.npmjs.org/jsctags
npm http 304 https://registry.npmjs.org/jsctags
  versions: '0.1.0',
  version: '0.1.0',

File with I tryed working: http://paste.kde.org/pfnchcp0f

Sorry my poor english :)

@joelburget
Copy link

I get the same. A little extra info: I installed with npm install -g and have some additional output:

joelburget@gorebridge ~/k/perseus> jsctags src
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined
Array.prototype.push called on null or undefined

/usr/local/lib/node_modules/jsctags/jsctags/ctags/writer.js:89
        this.tags = this.tags.sort(sortfunc);
                              ^
TypeError: Cannot call method 'sort' of undefined
    at Object.exports.TagWriter.Trait.write (/usr/local/lib/node_modules/jsctags/jsctags/ctags/writer.js:89:31)
    at Object.<anonymous> (/usr/local/lib/node_modules/jsctags/bin/jsctags.js:269:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Hope that's helpful!

@ericlgf819
Copy link

same issue as this closed thread #52

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

3 participants