On 2013/12/06 10:34:30, rossberg wrote:
On 2013/12/05 15:53:35, sof wrote:
> On 2013/12/03 18:06:23, rossberg wrote:
> > On 2013/12/03 17:57:17, Michael Starzinger wrote:
> > > The only kind-of-spec for the "name" property on function objects is the
> > > proposal on the Harmony wiki (please correct me if there is a more
precise
> > > specification that I am missing).
> > >
> > > http://wiki.ecmascript.org/doku.php?id=harmony:function_name_property
> > >
> > > This proposal actually specs the property to be writable (even for
strict
> > > functions). So while I agree that having different attributes for strict
and
> > > non-strict functions is weird, I am not sure this fix is going into the
> right
> > > direction.
> > >
> > > Adding Andreas as a reviewer for his opinion on the matter.
> >
> > Actually, in ES6, .name will be non-writable but configurable (that is
already
> > spec'ed in the draft). Could you modify the CL to do that?
>
> Done. (Apologies for not following up right away, other issues demanded my
> attention.)
>
> As you can see, this exposes a couple of issues:
>
> - the interaction with a function also having "name" on its proto chain and
> implemented
>    by a callback accessor, makes for quite interesting behavior if you
delete
> the property
> and then attempt to assign or redefine it. Spent quite some time making
> object-observe.js
> also handle such a property, but it became too ad-hoc, that I ended up
> blacklisting
>    it. Not ideal.
> - redefining "name" runs into unusual interactions upon re-definition, see
> regress-1530.js
>    A bug uncovered?

Yeah, these sounds like bugs. Can you reproduce both issues with ordinary JS
code? If so, can you please file them as bug reports?


Not readily (RO configurable properties implemented as foreign callback
accessors aren't easy to find), but will try some more.

These issues make me somewhat reluctant to land this change for now. We should
probably understand and fix the issues first.


Agreed; however, the original CL patchset had a straight bugfix (having
Function.name's [[Writable]] as true for stricts doesn't make much sense if
non-stricts has it as false.)

Another thought: ES6 also makes .length configurable. And for consistency, we
should probably apply the same change to the (non-official) .caller and
.arguments properties. It would be best to do that all in the same CL. (Sorry
for not pointing this out earlier.)

thanks, so it (length) does. Makes good sense; should I revert the
[[Configurable]] change here & file one or two bugs? I may have a go at the
[[Configurable]] change.



https://codereview.chromium.org/99203006/

--
--
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/groups/opt_out.

Reply via email to