Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack level too deep error using inheritdoc on method of class missing comment #659

Open
jbohmann opened this issue Jan 6, 2017 · 1 comment

Comments

@jbohmann
Copy link

jbohmann commented Jan 6, 2017

jsduck 5.3.4

I'm hoping this situation can be detected or a better error can be reported. It was hard to track down the problem (missing class docs on ClassB):

//test.js

/**
 * Class A
 */ 
Ext.define('xyz.ClassA', {

    /**
     * Docs for Class A method X.
     */
    methodX: function() {}
});

Ext.define('xyz.ClassB', {
    
    /**
     * Docs for Class B method X.
     * @inheritdoc xyz.ClassA#methodX
     */
    methodX: function() {}
});

running jsduck like so:

jsduck --verbose ./3rdparty/extjs/4.2.2/ext-all.js test.js --output ./output

fails with this message:

/var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/class.rb:160:in `each': stack level too deep (SystemStackError)
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/class.rb:160:in `find_all'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/class.rb:160:in `find_members'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/process/inherit_members.rb:229:in `lookup_member'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/process/inherit_members.rb:157:in `find_parent'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/process/inherit_members.rb:50:in `resolve_member'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/process/inherit_members.rb:75:in `resolve_parent'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/process/inherit_members.rb:52:in `resolve_member'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/process/inherit_members.rb:75:in `resolve_parent'
	 ... 9028 levels...
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/lib/jsduck/app.rb:21:in `run'
	from /var/lib/gems/2.3.0/gems/jsduck-5.3.4/bin/jsduck:25:in `<top (required)>'
	from /usr/local/bin/jsduck:23:in `load'
	from /usr/local/bin/jsduck:23:in `<main>'

Adding a comment block to ClassB (even an empty one) fixes the issue.

Of course, we want to document ClassB and should always do so. The difficulty was finding the cause of this error, mainly due to how many files our project has and that jsduck was being run on a concatenated intermediate (large) file.

@nene
Copy link
Member

nene commented Jan 7, 2017

Thanks for reporting. Looks like a genuine bug.

Maybe I get to fixing this... but it's been a while since I really did any maintenance on JSDuck. Just saying, so you don't get your hopes up.

But thanks.

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

No branches or pull requests

2 participants