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

Backbone.js class style not recognized #8

Open
ggerrietts opened this issue Jul 22, 2011 · 10 comments
Open

Backbone.js class style not recognized #8

ggerrietts opened this issue Jul 22, 2011 · 10 comments

Comments

@ggerrietts
Copy link

I can't tell for sure whether this is a usage pattern problem, but if I feed jsctags the source of the [Todos example][http://documentcloud.github.com/backbone/examples/todos/todos.js] featured in the Backbone.js documentation, I get a sequence of function tags back out. Top-level names like window.Todo and window.Todolist aren't generating tags, and neither are non-function properties like model or events. I can understand why the backbone-style classes aren't recognized as classes, but as a consequence, none of the functions are identified as part of the classes, either.

I'm not sure if there's a usage pattern that I'm not familiar with, or a way of indicating dependencies, or a flag for turning on output of variables. I'm also not sure if maybe this is fixed downstream of where I'm working (commit f63c1e0), to work around the problems I've been having with the narcissus submodule not responding properly to the submodule init/update commands (it wants SSH access) and the follow-on build problems reported elsewhere.

Despite my uncertainty, I did want to make sure someone was aware of the issue.

@dimvar
Copy link

dimvar commented Jul 22, 2011

Hi ggerrietts, can you say more about the submodule errors you're getting? Anybody that clones the doctorjs code and does submodule-init/update should be able to get the narcissus code. I'm curious why it's not working for you.

@ggerrietts
Copy link
Author

If you can read past my funky shell prompt, this should illustrate the problem I'm having:

~/src
osir(p1):geoff rm -rf doctorjs


~/src
osir(p1):geoff git clone https://github.com/mozilla/doctorjs.git
Cloning into doctorjs...
remote: Counting objects: 3013, done.
remote: Compressing objects: 100% (1188/1188), done.
remote: Total 3013 (delta 1818), reused 2826 (delta 1631)
Receiving objects: 100% (3013/3013), 1.39 MiB | 552 KiB/s, done.
Resolving deltas: 100% (1818/1818), done.


~/src
osir(p1):geoff cd doctorjs/


~/src/doctorjs
osir(p1):geoff git submodule init
Submodule 'narcissus' ([email protected]:mozilla/narcissus.git) registered for path 'narcissus'


~/src/doctorjs
osir(p1):geoff git submodule update
Cloning into narcissus... 
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Clone of '[email protected]:mozilla/narcissus.git' into submodule path 'narcissus' failed

@ggerrietts
Copy link
Author

whoops, "close" means issue, not dialog. >.<

@dimvar
Copy link

dimvar commented Jul 22, 2011

OK, the submodule issue should be fixed now in the latest commit.

@ggerrietts
Copy link
Author

The submodule issue is now fixed, yes. Thanks!

@ggerrietts
Copy link
Author

Using the current recipe for executing jsctags.js, the source of todos.js crashes:

Cannot set property 'children' of undefined

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
TypeError: Cannot set property 'children' of undefined
    at fixExp (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:232:22)
    at fixExp (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:267:15)
    at fixStm (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:432:22)
    at fixStm (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:409:16)
    at fixFun (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:315:17)
    at fixExp (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:280:5)
    at fixe (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:217:37)
    at Array.forEach (native)
    at fixExp (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:277:20)
    at fixStm (/Users/geoff/src/doctorjs/lib/cfa2/jscfa.js:432:22)

@dimvar
Copy link

dimvar commented Jul 22, 2011

Pull now, it should work.

@ggerrietts
Copy link
Author

I can confirm that it now works at least as well as it did in f63c1e0d30bd8a15823e. Function tags are still the only tags being generated, and I assume it's because of the style employed by Backbone.js applications.

@rolnxyz
Copy link

rolnxyz commented Sep 4, 2011

I would love to see tags generated for Backbone.js classes as well.

@wagenet
Copy link

wagenet commented May 1, 2012

I would like to see this work for Ember.js also. The extend syntax is generally the same so I imagine getting it to work with one would help with both.

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

4 participants