Reserved word property access and line breaks

Jeff Walden jwalden+es at MIT.EDU
Sun Aug 29 19:03:41 PDT 2010


On 08/29/2010 03:28 PM, Douglas Crockford wrote:
> For what it's worth, JSLint does not tolerate any whitespace between . and a property name.

Tangential, but does JSLint then require either long sequences of property accesses and method calls to occur all on a single line or to always be broken with "." and subsequent property name starting new lines?  For example, if this example must include a line break, at that dot-location, is this the only way JSLint would permit it to be broken?

var b;
var a = b.c.d.e.f.g().h().i()
      .j().fdsfadsfdasfasdafds().basd();

(I actually prefer this to ending the line with ".", but the argument for dot-at-end seems reasonable enough to me that I'm surprised JSLint would mandate the other way.)

Jeff


More information about the es-discuss mailing list