Strict mode recap

Jon Zeppieri jaz at bu.edu
Fri Apr 11 04:19:46 PDT 2008


On 4/11/08, Lars Hansen <lhansen at adobe.com> wrote:
>
> > On 4/10/08, Jon Zeppieri <jaz at bu.edu> wrote:
>  > >
>  > >     var o = { null var count = 100, ... };
>  >
>  > Sorry:  two syntactic mistakes, here, one of which is interesting.
>  > The boring one is my use of '=' rather than ':'.
>  >
>  > But after reading the object initializer draft, I see that,
>  > if the intent of the above were legal, the syntax would be:
>  >
>  > var o = { var null::count: 100 };
>
>
> I don't think null is a valid namespace (but I'm still waiting
>  for Jeff's spec on names to verify that) and it would in any
>  case be redundant; when we talked about it being legal, the
>  meaning was "the compatibility namespace", which is what you
>  get by just leaving it off.

This part of my (first) email was about the compatibility namespace
section of the names spec, which has a couple of 'fixme' paragraphs.
The first argues for a way to qualify references explicitly with the
compatibility namespace, and the second makes the case that while
local lexical bindings should be in the compatibility namespace,
unqualified object literal properties should be in the public
namespace.  The purpose of these, jointly, is to give people a
reliable way to avoid unintended name shadowing in a with statement.

>
>  Apart from that there's no problem.  "var" is used to indicate
>  a mutable fixture property, but it is just a flag (as is "const").
>  The primary form is just { ns::id: val }, which is a
>  straightforward evolution of the ES3 form { ns: val }.

Right, I get that, and Brendan's point was a good one.  I was just
thrown by the fact that I hadn't seen an example of

class A {
  var public::count = 10;
}

rather than

class A {
  public var count = 10;
}

But if the former is legal (and the grammar suggests that it is), then
there's no inconsistency.


-Jon



More information about the Es4-discuss mailing list