Loading jsduck.rb +10 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,16 @@ module JsDuck lex.look(:string, ":", "function") then # name: function(){ doc.set_default(:function, {:name => lex.next}) elsif lex.look(:keyword, ".") then # some.long.prototype.chain = function() { lex.next while lex.look(".", :keyword) do lex.next name = lex.next if lex.look("=", "function") then doc.set_default(:function, {:name => name}) end end end docs << doc else Loading tc_jsduck.rb +10 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,16 @@ foo: function() { assert_equal("foo", docs[0][:function][:name]) end def test_function_in_prototype docs = JsDuck.parse(" /** */ Some.Long.prototype.foo = function() { } ") assert_equal("foo", docs[0][:function][:name]) end def test_function_private docs = JsDuck.parse(" // no doc-comment for this function Loading Loading
jsduck.rb +10 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,16 @@ module JsDuck lex.look(:string, ":", "function") then # name: function(){ doc.set_default(:function, {:name => lex.next}) elsif lex.look(:keyword, ".") then # some.long.prototype.chain = function() { lex.next while lex.look(".", :keyword) do lex.next name = lex.next if lex.look("=", "function") then doc.set_default(:function, {:name => name}) end end end docs << doc else Loading
tc_jsduck.rb +10 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,16 @@ foo: function() { assert_equal("foo", docs[0][:function][:name]) end def test_function_in_prototype docs = JsDuck.parse(" /** */ Some.Long.prototype.foo = function() { } ") assert_equal("foo", docs[0][:function][:name]) end def test_function_private docs = JsDuck.parse(" // no doc-comment for this function Loading