DescriptionCurrently, the js prettyprint renderer indents something like this:
{
___.loadModule({
'instantiate': function (___, IMPORTS___) {
var $v = ___.readImport(IMPORTS___, '$v', {
'getOuters': {
'()': { }
}
});
}
});
}
The deep indentation is awkward in several ways, especially when
it gets close to the 80-column limit and the prettyprinter ends
up emitting 2-3 tokens per line in a skinny far-right column.
This change makes the prettyprinter indent like this:
{
___.loadModule({
'instantiate': function (___, IMPORTS___) {
var $v = ___.readImport(IMPORTS___, '$v', {
'getOuters': {
'()': { }
}
});
}
});
}
1. Each open bracket adds 2 to indent.
2. Continued statements add 2 to indent.
This is an example of the difference, output from 'wc':
lines words chars
4376 16944 120763 jquery-1.3.2.js
15788 22446 1283779 jquery-1.3.2.out.js (old)
6336 20607 389524 jquery-1.3.2.out.js (new)
Using the minifier will be smaller, of course.
This change is about improving the debugging experience.
Patch Set 1 #
Total comments: 6
Patch Set 2 : compact js prettyprint indentation #MessagesTotal messages: 6
|