Commit 8db9c37f authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

property/cfg type defaults to "Object" in Merger.

parent 38c79ec1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ module JsDuck
    end

    def signature_suffix(item)
      " : " + (item[:type] || "Object")
      " : " + item[:type]
    end

  end
+4 −0
Original line number Diff line number Diff line
@@ -184,7 +184,11 @@ module JsDuck
          "Function"
        elsif code[:right][:type] == :literal
          code[:right][:class]
        else
          "Object"
        end
      else
        "Object"
      end
    end

+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ module JsDuck
    end

    def signature_suffix(item)
      " : " + (item[:type] || "Object")
      " : " + item[:type]
    end

  end
+18 −0
Original line number Diff line number Diff line
@@ -468,6 +468,24 @@ this.locked = false;
    assert_equal("Function", docs[0][:type])
  end

  def test_default_property_type_is_object
    docs = JsDuck.parse("
/**
 * @property foo
 */
")
    assert_equal("Object", docs[0][:type])
  end

  def test_default_cfg_type_is_object
    docs = JsDuck.parse("
/**
 * @cfg foo
 */
")
    assert_equal("Object", docs[0][:type])
  end

  def test_visibility_modifiers
    ["@private", "@hide", "@ignore", "@protected"].each do |tagname|
      docs = JsDuck.parse("/**\n * #{tagname}\n */");