Commit 967a4ff2 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

@type now implies @property.

parent 591e13e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ module JsDuck
        :event
      elsif doc_map[:method]
        :method
      elsif doc_map[:property]
      elsif doc_map[:property] || doc_map[:type]
        :property
      elsif code[:type] == :ext_extend
        :class
+12 −0
Original line number Diff line number Diff line
@@ -399,6 +399,18 @@ foo: true,
    assert_equal("My comment", docs[0][:doc])
  end

  def test_type_implies_property
    docs = JsDuck.parse("
/**
 * @type Boolean
 */
MY_CONSTANT: true,
")
    assert_equal(:property, docs[0][:tagname])
    assert_equal("MY_CONSTANT", docs[0][:name])
    assert_equal("Boolean", docs[0][:type])
  end

  def test_property_ident_chain_begins_with_this
    docs = JsDuck.parse("
/**