W3C home > Mailing lists > Public > public-appformats@w3.org > December 2006

Re: [XBL] ECMAScript Syntax

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 8 Dec 2006 05:59:58 +1000
To: "WAF WG (public)" <public-appformats@w3.org>
Message-ID: <20061207195957.GA10716@arc.mcc.id.au>

Marcos Caceres:
> Using ( ) in ({ ...}) is mostly convention (ie. evaluate all inside { },
> like you would with say x = (3 + (4 * 3)) ).

And more importantly, it distinguishes it from a code block, which is
what it would be parsed as otherwise since it is at the beginning of the
statement/expression.

  >>> { a: 1, b: 2}
  org.mozilla.javascript.EvaluatorException: missing ; before statement (System.in#2)
  >>> ({ a: 1, b: 2 })
  [object Object]

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au
Received on Thursday, 7 December 2006 19:52:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:20 GMT