Here's some code written in a "leading comma" style, laid out as I'd like.
(function () {
namespace.thing = function () {
this.init();
};
var thing = namespace.thing
, Lang = YAHOO.lang
, Dom = YAHOO.util.Dom
;
thing.prototype =
{ init: function () {
...
}
, doSomething: function () {
...
}
};
})();
However, js2-20080424.el indents it as:
var namespace = { };
(function () {
namespace.thing = function () {
this.init();
};
var thing = namespace.thing
, Lang = YAHOO.lang
, Dom = YAHOO.util.Dom
;
thing.prototype =
{ init: function () {
// ...
}
, doSomething: function () {
// ...
}
};
})();
Which is surprisingly close to, yet annoyingly far from the right thing for my
money.
I've attached a patch that fixes things to my taste, but I'm not sure if it
breaks things to others'
tastes. It shouldn't be too hard to make it customizable though.
Original issue reported on code.google.com by pdcaw...@gmail.com on 28 Apr 2008 at 3:46
Original issue reported on code.google.com by
pdcaw...@gmail.com
on 28 Apr 2008 at 3:46Attachments: