Re: [XBL] Use of "public"

Hi Ian.

Ian Hickson:
> > I suggest a different property name be used for the public object.

Cameron McCormack:
> Unless I am mistaken, reserved words in ECMAScript don't apply when you 
> are dereferencing an object. so "this.public.x" is fine.

I think you’re thinking of the so-called “contextually reserved
identifiers”.

  >>> o = { 'public': 123 }
  [object Object]
  >>> o.public
  org.mozilla.javascript.EvaluatorException: missing name after
    . operator (System.in#2)

> However, keeping away from reserved words is a good idea, so I've changed 
> 'public' to 'external' and 'private' to 'internal'.

Thanks.

-- 
Cameron McCormack, http://mcc.id.au/
 xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

Received on Wednesday, 14 February 2007 02:12:04 UTC