In general, the code is dense and difficult to read. If you know what to look for, there are a few idioms scattered around that stand out as awkward, but save a few characters here and there. There are some pretty obvious examples right at the beginning, lines 2 and 4:
var COMPILED = !0
goog.DEBUG = !1
As you would expect in a weakly-typed C-style language, !0 == true, and !1 == false. JavaScript has first-class booleans, and there's not much to be gained by using one of these expressions instead of the literal it evaluates to. It only serves to save character count.
Here's another example. Starting at line 91, you get the following:
!COMPILED && goog.ENABLE_DEBUG_LOADER && (goog.included_ = {}, goog.dependencies_ = { // ... and so forth
The above code uses commas in a particular way that usually means it comes from a minifier. JavaScript has a comma operator, which is basically just a statement separator, but it has the interesting property that it joins two statements as a single expression. As in many C-style languages, control flow operators like if and while don't require curly braces, and apply to the immediately following statement if they are absent. The combination of these two means that
if(!foo){bar();baz();qux()}
is equivalent to
if(!foo)bar(),baz(),qux();
which is shorter by a single character. Because the line of code joined by commas is now an expression, this also lets us abuse the short-circuit property of boolean operators, re-writing the above like so:
foo&&(bar(),baz(),qux());
for a further savings of one more character.
You pretty much never see the comma operator in code written by humans, because it's not useful for anything. Seeing them in production code, especially the way shown above, almost always means the code came out of a minifier. That actually broke the Opera browser a few months back--apparently the parser ran out of stack space when handling a single expression consisting of over 1,400 comma-separated statements.
Here's another example. Starting at line 91, you get the following:
The above code uses commas in a particular way that usually means it comes from a minifier. JavaScript has a comma operator, which is basically just a statement separator, but it has the interesting property that it joins two statements as a single expression. As in many C-style languages, control flow operators like if and while don't require curly braces, and apply to the immediately following statement if they are absent. The combination of these two means that is equivalent to which is shorter by a single character. Because the line of code joined by commas is now an expression, this also lets us abuse the short-circuit property of boolean operators, re-writing the above like so: for a further savings of one more character.You pretty much never see the comma operator in code written by humans, because it's not useful for anything. Seeing them in production code, especially the way shown above, almost always means the code came out of a minifier. That actually broke the Opera browser a few months back--apparently the parser ran out of stack space when handling a single expression consisting of over 1,400 comma-separated statements.