On 2015/04/07 18:22:03, arv wrote:
https://codereview.chromium.org/1027283004/diff/530001/src/contexts.h
File src/contexts.h (right):


https://codereview.chromium.org/1027283004/diff/530001/src/contexts.h#newcode594
src/contexts.h:594: : is_strict(language_mode) | | !IsAccessorFunction(kind)
On 2015/04/07 17:10:36, caitp wrote:
> On 2015/04/07 17:00:11, arv wrote:
> > On 2015/04/07 16:29:57, caitp wrote:
> > > On 2015/04/07 16:18:39, arv wrote:
> > > > I don't understand why accessor functions are special cased here?
> > > >
> > > > Maybe restructure this code to make it clearer what is going on.
> > >
> > > It was to avoid breaking the old behaviour.
> > >
> > > But I'm not sure, it looks like lexically declared accessors are always > > > MethodDefinitions now, so maybe that's a break from ES5? I'm not really
sure
> > if
> > > they should be considered "new syntactic forms" or what
> >
> > Accessors are considered Methods in ES6 so they have no prototype
property.
> >
> > I just don't understand why we would use a sloppy map for a strict mode
> accessor
> > function?
>
> Oh I see what you're saying. So I guess I was trying to keep compat, and
wound
> up breaking it, my bad.
>
> But my question is, should this be treated as a new syntactic form (like
other
> methods), or should the legacy behaviour be kept (where caller/arguments are
> added in sloppy mode)

I think sloppy accessors should be treated as sloppy FunctionExpressions but
it
is not clear to me if this is specified.

Maybe file a bug on ES6 and hope that Andre Bargul answers you :-)

you know what, I think the spec is actually pretty clear on this. " Such own
properties also must not be created for function objects defined using an
ArrowFunction, **MethodDefinition**, GeneratorDeclaration, GeneratorExpression,
ClassDeclaration, or ClassExpression regardless of whether the definition is
contained in strict mode code. "

This is a break from ES5, but so is strict functions not having own "caller" / "arguments" properties, so it's a break either way. I guess the thing to do is just take out the extra condition. Still want the if statement instead of the
ternary?

https://codereview.chromium.org/1027283004/

--
--
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