Skip to content
Snippets Groups Projects
Commit 5407cc87 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Mark all auto-merged fields as auto-detected.

parent 47261b3b
No related branches found
No related tags found
No related merge requests found
......@@ -55,11 +55,15 @@ module JsDuck
h[key] = value unless h.has_key?(key) || Merger::explicit?(key)
end
# Add all items in code not already in result.
# But only if the explicit and auto-detected names don't conflict.
# Add all items in code not already in result and mark them as
# auto-detected. But only if the explicit and auto-detected
# names don't conflict.
if DocsCodeComparer.matches?(docs, code)
code.each_pair do |key, value|
h[key] = value unless h.has_key?(key) || Merger::explicit?(key)
unless h.has_key?(key) || Merger::explicit?(key)
h[key] = value
DocsCodeComparer.mark_autodetected(h, key)
end
end
end
end
......
......@@ -197,6 +197,10 @@ describe JsDuck::Aggregator do
cls[:members][0][:chainable].should == true
end
it "marks :chainable field as autodetected" do
cls[:members][0][:autodetected][:chainable].should == true
end
it "adds @return {MyClass} this" do
cls[:members][0][:return][:type].should == "MyClass"
cls[:members][0][:return][:doc].should == "this"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment