I see, so in this case I agree it would be preferable to support
configurable name property rather than non-standard displayName even though
the latter is de-facto mechanism used for providing function custom names
in other browsers. How hard would it be to implement configurable
Function.name? What are the current plans of V8 team on supporting this?
Can we bump priority of this feature?


On Thu, Feb 12, 2015 at 7:37 PM, Andrey Adaykin <[email protected]> wrote:

> Right.
>
> Object.getOwnPropertyDescriptor(function(){}, "name")   =>   Object
> {value: "", writable: false, enumerable: false, configurable: false}
>
>
> On Thu, Feb 12, 2015 at 7:29 PM, Yury Semikhatsky <[email protected]>
> wrote:
>
>> OK, I was confused by getting "TypeError: Cannot redefine property: name"
>> when executing such code but I assume that is because it is not implemented
>> yet, right?
>>
>> On Thu, Feb 12, 2015 at 7:25 PM, Erik Arvidsson <[email protected]> wrote:
>>
>>> non-writable configurable means you can change the value.
>>>
>>> function f() {}
>>> Object.defineProperty(f, 'name', {value: 'fff'});
>>>
>>> On Thu, Feb 12, 2015 at 11:21 AM, Yury Semikhatsky <[email protected]>
>>> wrote:
>>> > If its read-only it doesn't seem to be addressing use cases described
>>> in the
>>> > bug and we still need displayName.
>>> >
>>> > On Thu, Feb 12, 2015 at 7:09 PM, Erik Arvidsson <[email protected]>
>>> wrote:
>>> >>
>>> >> On Feb 12, 2015 11:00 AM, "Yury Semikhatsky" <[email protected]>
>>> wrote:
>>> >>>
>>> >>> Is Function.name going to writable in ES6? MDN says that the
>>> property is
>>> >>> read-only.
>>> >>
>>> >>
>>> >> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-name
>>> >>
>>> >> Correction, it is configurable, non writable, which in practice means
>>> you
>>> >> can change the value.
>>> >>
>>> >>
>>> >>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Thu, Feb 12, 2015 at 6:53 PM, Erik Arvidsson <[email protected]>
>>> wrote:
>>> >>>>
>>> >>>> With ES6 and writable function name property the motivation for
>>> this is
>>> >>>> as low as ever.
>>> >>>>
>>> >>>> Maybe we should just work on implementing ES6 logic for function
>>> name
>>> >>>> instead?
>>> >>>>
>>> >>>> On Feb 12, 2015 9:59 AM, <[email protected]> wrote:
>>> >>>>>
>>> >>>>> Our stack getter is lazy, isn't it? I suppose if user want to
>>> receive
>>> >>>>> stack
>>> >>>>> trace and set for some functions displayName then we can spend one
>>> more
>>> >>>>> moment
>>> >>>>> for return more useful stack trace.
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> https://codereview.chromium.org/919653002/diff/20001/src/messages.js
>>> >>>>> File src/messages.js (right):
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> https://codereview.chromium.org/919653002/diff/20001/src/messages.js#newcode829
>>> >>>>> src/messages.js:829: if (name && IS_STRING(name)) {
>>> >>>>> On 2015/02/12 14:15:29, Yang wrote:
>>> >>>>>>
>>> >>>>>> I think a single IS_STRING(name) would suffice, as undefined is
>>> not a
>>> >>>>>
>>> >>>>> String.
>>> >>>>>
>>> >>>>>> Unless you want to filter out the empty string, since it
>>> evaluates to
>>> >>>>>
>>> >>>>> false. In
>>> >>>>>>
>>> >>>>>> which case it would be better to explicitly do a string length
>>> >>>>>
>>> >>>>> comparison.
>>> >>>>>
>>> >>>>> Done.
>>> >>>>>
>>> >>>>> https://codereview.chromium.org/919653002/
>>> >>>>>
>>> >>>>> --
>>> >>>>> --
>>> >>>>> 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.
>>> >>>
>>> >>>
>>> >
>>>
>>>
>>>
>>> --
>>> erik
>>>
>>
>>
>

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