Commit accbe16c authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

An additional test case for object properties.

Note that with previous additions the EsprimaParser has become
a little bit less performant:

JsParser:      3.5s
EsprimaParser: 4.5s
parent c4fdc8fc
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -112,5 +112,22 @@ describe JsDuck::EsprimaParser do
    end
  end

  describe "parsing comment before object property" do
    before do
      @docs = parse(<<-EOS)
          var x = {
              foo: 5,
              // Some docs
              bar: 5
          }
      EOS
    end

    it "detects comment as belonging to the second property" do
      @docs[0][:code]["type"].should == "Property"
      @docs[0][:code]["key"]["name"].should == "bar"
    end
  end

end