Commit 71a42c10 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Merge branch 'master' into esprima-parser

parents 74a30768 8b44f7b1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ module JsDuck

      key = @input.scan(/[a-zA-Z0-9_]+/)
      return false unless key
      @out << key

      skip_whitespace
      if @input.scan(/:/)
@@ -321,8 +322,10 @@ module JsDuck

      # All type names besides * can be followed by .<arguments>
      if name != "*" && @input.scan(/\.</)
        @out << ".&lt;"
        return false unless type_arguments
        return false unless @input.scan(/>/)
        @out << "&gt;"
      end

      true
+5 −2
Original line number Diff line number Diff line
@@ -198,6 +198,10 @@ app.get('/auth/:sdk/:version/comments_recent', util.getCommentReads, function(re
        filter._id = { $nin: req.commentMeta.reads };
    }

    if (req.query.hideCurrentUser) {
        filter.userId = { $ne: req.session.user.userid };
    }

    Comment.find(filter).sort("createdAt", -1).run(function(err, comments) {
        var total_rows = comments.length;

@@ -252,7 +256,6 @@ app.post('/auth/:sdk/:version/comments', util.requireLoggedInUser, function(req,
        author: req.session.user.username,
        userId: req.session.user.userid,
        content: req.body.comment,
        action: req.body.action,
        rating: Number(req.body.rating),
        contentHtml: util.markdown(req.body.comment),
        downVotes: [],
@@ -268,7 +271,7 @@ app.post('/auth/:sdk/:version/comments', util.requireLoggedInUser, function(req,
    });

    comment.saveNew(req.session.user, function(err) {
        res.json({ success: true, id: comment._id, action: req.body.action });
        res.json({ success: true, id: comment._id });

        util.sendEmailUpdates(comment);
    });
+0 −1
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ CommentSchema = new mongoose.Schema({
    sdk:         String,
    version:     String,

    action:      String,
    author:      String,
    userId:      Number,
    content:     String,
+21 −3
Original line number Diff line number Diff line
@@ -303,11 +303,29 @@ describe JsDuck::TypeParser do
      p.out.should == '<a href="String">string</a>'
    end

    it "preserves whitespace in output" do
    def parse_to_output(input)
      relations = JsDuck::Relations.new([])
      p = JsDuck::TypeParser.new(relations)
      p.parse("( string | number )")
      p.out.should == '( string | number )'
      p.parse(input)
      return p.out
    end

    it "preserves whitespace in output" do
      parse_to_output("( string | number )").should == "( string | number )"
    end

    it "converts < and > to HTML entities in output" do
      parse_to_output("number.<string, *>").should == "number.&lt;string, *&gt;"
    end

    it "preserves function notation in output" do
      input = 'function(this:string, ?number=, !number, ...[number]): boolean'
      parse_to_output(input).should == input
    end

    it "preserves object literal notation in output" do
      input = '{myNum: number, myObject}'
      parse_to_output(input).should == input
    end

  end
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,11 @@ Ext.define("Docs.Settings", {
            "inherited": true,
            "accessor": true
        },
        comments: {
            hideRead: false,
            hideCurrentUser: false,
            sortByScore: false
        },
        showPrivateClasses: false,
        classTreeLogic: "PackageLogic"
    },
Loading