Loading ...
Sorry, an error occurred while loading the content.

Re: [jslint] Re: Bug? "Weird ternary" when picking between object literals.

Expand Messages
  • Will Palmer
    ... All working now, Thank you.
    Message 1 of 3 , Feb 14 7:38 AM
    • 0 Attachment
      On Mon, 2011-02-14 at 15:23 +0000, Douglas Crockford wrote:
      > --- In jslint_com@yahoogroups.com, Will Palmer <wmpalmer@...> wrote:
      > >
      > > This seems inconsistent enough that I assume it's a bug, or at least a
      > > less-specific-than-it-could-be warning message.
      > >
      > > The following code, checked on jslint.com
      > > (or using Rhino with the version from git @
      > > Feb 11 2011 / 588a6091349ffad861774cd16a942c29d924e03e)
      > > Produces three "Weird ternary" warnings, when I wouldn't expect any such
      > > warnings:
      > >
      > > var t = true;
      > >
      > > // I expect that all of these are normal syntax, yet each results in a
      > > // a "weird ternary" warning:
      > > var x = t ? {a: "foo", b: "bar"} : {a: "baz", b: "bam", c: "blamo"};
      > > var y = t ? {a: "foo"} : {a: "bar"};
      > > var z = t ? {a: "foo"} : {};
      >
      > Thanks. Please try it now.
      >

      All working now, Thank you.
    Your message has been successfully submitted and would be delivered to recipients shortly.