Uploaded image for project: 'Aptana Studio'
  1. Aptana Studio
  2. APSTUD-4074

JS formatter cases where lines are not maintained when the formatter is repeatedly invoked

    Details

      Description

      Have these code segments (together, or separately) in a JS file and invoke the formatter twice. You will notice that some lines are moving up and down between invocations.

      // case 1
      var $c;
      foo('a') = s;
      d = bz(a, b, b);
       
      // case 2
      function bo(a) {
        var b = a;
        bh.appendChild(b);
      }
       
      // case 3
      var b = a;
      bh.appendChild(b) = 2;
       
      // case 4
      var b = 1;
      bh.appendChild(b), b.innerHTML = a;
       
      // case 5
      var b = s;
      b === "input" ? bm(a) : b !== a != s && f.grep(a.getElementsByTagName("input"), bm)
      var $checkboxes = a;
       
      // case 6
      $(s) ? 1 : 2;
      function cy(a) {
        return f.isWindow(a) ? a : 2;
      }
       
      // case 7
      var d = w;
      c = a, a = d;
       
      // case 8
      elem.className += (elem.className ? " " : "" ) + cur;
       
      // case 9
      f.event.add(this, "click._submit keypress._submit", function(a) {
        var c = a.target, d = f.nodeName(c, "input") || f.nodeName(c, "button") ? c.form : b;
        d && !d._submit_attached && (f.event.add(d, "submit._submit", function(a) {
          this.parentNode && !a.isTrigger && f.event.simulate("submit", this.parentNode, a, !0)
        }), d._submit_attached = !0)
      });
      a = g ? "pageXOffset" in g ? g[ a ? "pageYOffset" : "pageXOffset"] : f.support.boxModel && g.document.documentElement[d] || g.document.body[d] : e[d]
       
      // case 10
      while(mll.length) {
        (mll.pop())();
      }
       
      // case 11
      l && f && (e.isPlainObject(f) || ( g = e.isArray(f))) ? ( zz ? ( g = !1, h = d && e.isArray(d) ? d : []) : h = d && e.isPlainObject(d) ? d : {}, i[c] = e.extend(l, h, f)) : f !== b && (i[c] = f)(a, d._submit_attached = !0);
       
      // case 12
      var b = 0;
      a === "fx" && b[0] !== "inprogress" && f.dequeue(this, a)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sgibly Shalom Gibly
                Reporter:
                sgibly Shalom Gibly
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Integration