Strict mode recap

Jon Zeppieri jaz at bu.edu
Wed Apr 2 18:06:20 PDT 2008


On 4/2/08, Lars Hansen <lhansen at adobe.com> wrote:
>  >
>  > Lars, does this mean that expr::[expr] can't introduce
>  > lexical bindings?  Or:  in strict mode, it can't, but in
>  > standard it can?
>
>
> It can't introduce bindings; it's just a name.

I meant something like:

var foo::[bar] = baz;

My objection to expr::[expr] in earlier messages was based on the
assumption that these computed names could be used on the left-hand
side of an assignment expression -- which, I'm pretty sure, is
syntactically valid.

So, for example:

var foo = "hello";
null::["foo"] = "goodbye";
print(foo); // prints "goodbye"

But I guess there are two cases: one where a new binding would be
introduced and another where the expression would evaluate to an
already bound name (as in the previous example).

So... are either of those cases legal?



More information about the Es4-discuss mailing list