diff --git a/javascriptguide.xml b/javascriptguide.xml index 957a05b36..c6696bc04 100644 --- a/javascriptguide.xml +++ b/javascriptguide.xml @@ -2,10 +2,10 @@

- + Revision 2.93

- +
Aaron Whyte
Bob Jervis
@@ -35,23 +35,23 @@

JavaScript is the main client-side scripting language used - + by many of Google's open-source projects. This style guide is a list of dos and don'ts for JavaScript programs.

- - - - - + + + + +
- - + + @@ -100,7 +100,7 @@ considered immutable only if they do not demonstrate observable state change. This is not enforced by the compiler.

- + @@ -619,8 +619,7 @@

The whitespace at the beginning of each line can't be safely stripped at compile time; whitespace after the slash will result in tricky - errors; and while most script engines support this, it is not part - of ECMAScript.

+ errors.

Use string concatenation instead:

var myString = 'A rather long string of English text, an error message ' + @@ -759,7 +758,7 @@

Optional and variable arguments can also be specified in @param annotations. Although either convention is acceptable to the compiler, using both together is preferred.

- +
@@ -801,8 +800,8 @@ ... }; - - + +

Many JavaScript libraries, including the Closure Library @@ -826,7 +825,7 @@ parent namespace know what you are doing. If you start a project that creates hats for sloths, make sure that the Sloth team knows that you're using sloth.hats.

- +

"External code" is code that comes from outside your codebase, @@ -867,8 +866,8 @@ goog.exportSymbol('foo.hats.BowlerHat', googleyhats.BowlerHat); - - + +

Use local aliases for fully-qualified types if doing so improves @@ -937,7 +936,7 @@ and should contain no punctuation except for - or _ (prefer - to _).

- + @@ -1807,9 +1806,9 @@ - + null - + @@ -1821,9 +1820,9 @@ - + undefined - + @@ -2099,7 +2098,7 @@ MyClass is initialized with a null value, it will issue a warning.

- +

Optional parameters to functions may be undefined at runtime, so if they are assigned to class properties, those properties must be @@ -2329,7 +2328,7 @@

- + A copyright notice and author information are optional. File overviews are generally recommended whenever a file consists of more than a single class definition. The top level comment is @@ -2346,7 +2345,7 @@ */ - + @@ -2416,7 +2415,7 @@ @author - + @author username@google.com (first last) @@ -2431,11 +2430,11 @@ Document the author of a file or the owner of a test, generally only used in the @fileoverview comment. - + - + @code @@ -2728,11 +2727,11 @@

Declares an - + externs file.

- + @@ -2891,9 +2890,9 @@ - - + + @noalias @@ -3204,7 +3203,7 @@ Suppresses warnings from tools. Warning categories are separated by | or ,. - + @@ -3303,12 +3302,12 @@ - + - +

You may also see other types of JSDoc annotations in third-party @@ -3386,15 +3385,15 @@

Required - +

Use of JS compilers such as the Closure Compiler is required for all customer-facing code.

- - + + @@ -3584,7 +3583,7 @@ - +

@@ -3615,7 +3614,7 @@ Revision 2.93

- +
Aaron Whyte
Bob Jervis