Commit 243f212d authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Detect default value when it's a function call.

parent 47faa4b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ module JsDuck
          return {
            :tagname => :css_var,
            :name => "$" + node.name,
            :default => node.expr.to_s,
            :default => node.expr.to_sass,
            :type => TYPE.detect(node.expr),
          }
        elsif node.class == Sass::Tree::MixinDefNode
+12 −0
Original line number Diff line number Diff line
@@ -179,7 +179,19 @@ describe JsDuck::Css::SassParser do
    it "detects two docsets" do
      docs.length.should == 2
    end
  end

  describe "parsing SCSS variable followed by unknown function" do
    let(:var) do
      parse(<<-EOCSS)[0]
        /** My docs */
        $foo: myfunc(1, 2);
      EOCSS
    end

    it "detects the function call as default value" do
      var[:code][:default].should == "myfunc(1, 2)"
    end
  end

end