My first approach (patch set 2) was to add the reverse "is in class literal"
bit, but we concluded w/ dslomov@ that this makes more sense, since there are
less function types allowed in an object literal (those are a subset of the
function types allowed in a class literal).


https://codereview.chromium.org/994043003/diff/60001/src/preparser.h
File src/preparser.h (right):

https://codereview.chromium.org/994043003/diff/60001/src/preparser.h#newcode2185
src/preparser.h:2185: if (!in_class) kind = WithObjectLiteralBit(kind);
On 2015/03/10 16:49:06, arv wrote:
It is not clear to me that we need this extra bit. Why do we need to
distinguish
if the accessor is part of a ClassLiteral vs ObjectLiteral?

Scope-wise, a method (or an accessor) of an object literal inside a
computed property name will look the same as a method (or an accessor)
of the class - but only the latter is allowed to refer to the class
name.

https://codereview.chromium.org/994043003/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to