Closing the loop on this: this proposal is now stage 4, and will be
included in ES 2017. https://github.com/tc39/ecma262/pull/582
Polyfill: https://www.npmjs.com/package/object.getownpropertydescriptors
On Wed, Jan 20, 2016 at 9:26 PM, Jordan Harband <ljh...@gmail.com> wrote:
>
Giammarchi
Sent: Wednesday, January 20, 2016 14:50
To: Mathias Bynens <mathi...@opera.com>
Cc: es-discuss@mozilla.org
Subject: Re: Object.getOwnPropertyDescriptors still at stage 0
Dear all,
the current proposal is here
https://github.com/WebReflection/Object.getOwnPropertyDescr
Dear all,
the current proposal is here
https://github.com/WebReflection/Object.getOwnPropertyDescriptors#objectgetownpropertydescriptors-proposal
It has been mostly copied, as suggested, from
https://github.com/tc39/Array.prototype.includes
It has a reference implemntation:
https://github.com
ght not be necessary.)
>
>
>
> *From:* es-discuss [mailto:es-discuss-boun...@mozilla.org] *On Behalf Of
> *Andrea
> Giammarchi
> *Sent:* Wednesday, January 20, 2016 14:50
> *To:* Mathias Bynens <mathi...@opera.com>
> *Cc:* es-discuss@mozilla.org
> *S
ers, and proxies with throwing and inconsistent getOwnProperty and
>> ownPropertyKeys traps. (The proxies cases might not be necessary.)
>>
>>
>>
>> *From:* es-discuss [mailto:es-discuss-boun...@mozilla.org] *On Behalf Of
>> *Andrea Giammarchi
>> *Sent:*
Accordingly with this ecma262 stage 0 summary
https://github.com/tc39/ecma262/blob/master/stage0.md the (quite long time
ago) discussed `Object.getOwnPropertyDescriptors`
https://gist.github.com/WebReflection/9353781 hasn't move a bit from there.
However, there are already use cases
https
On Mon, Jan 18, 2016 at 6:50 PM, Andrea Giammarchi
<andrea.giammar...@gmail.com> wrote:
> Accordingly with this ecma262 stage 0 summary
> https://github.com/tc39/ecma262/blob/master/stage0.md the (quite long time
> ago) discussed `Object.getOwnPropertyDescriptors`
> https
iammarchi
> <andrea.giammar...@gmail.com> wrote:
> > Accordingly with this ecma262 stage 0 summary
> > https://github.com/tc39/ecma262/blob/master/stage0.md the (quite long
> time
> > ago) discussed `Object.getOwnPropertyDescriptors`
> > https://gist.github.com
On Mon, Jan 18, 2016 at 8:27 PM, Andrea Giammarchi
wrote:
> Do you (or anyone else) know if that should be filed as a PR to tc39/ecma262
> or if it should just be a repository eventually posted in here?
It should be a repository that can eventually move to the tc39
I have a use case for `Object.getOwnPropertyDescriptors` – it may or may
not be to your liking, but I have one. I'm currently implementing a library
to help with employing more pure functional programming techniques in
JavaScript environments. This includes such things as (mostly) forcing
Hi,
There has been request to add `Object.getOwnPropertyDescriptors` (plural) to
the standard. Reviewing use cases presented in thread [1] or in older thread
[2], it seems to me that all of them boil down to copy all own properties of
one object to another, e.g.,
Object.defineProperties
while I think that
Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject))
looks semantically better than
Object.mixin(
Object.create(Object.getPrototypeOf(originalObject)),
originalObject)
I also think that Object.mixin could be used
Le 22 avr. 2014 à 19:58, Andrea Giammarchi andrea.giammar...@gmail.com a
écrit :
while I think that
Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject)
)
looks semantically better than
Object.mixin(
Object.create
` ?
On Tue, Apr 22, 2014 at 11:59 AM, Claude Pache claude.pa...@gmail.comwrote:
Le 22 avr. 2014 à 19:58, Andrea Giammarchi andrea.giammar...@gmail.com
a écrit :
while I think that
Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject
,Symbol}` dichotomy of ES6, but that's another
question.) On the other hand `Object.getOwnPropertyDescriptors` and
`Object.mixin` are complex methods.
—Claude
On Tue, Apr 22, 2014 at 11:59 AM, Claude Pache claude.pa...@gmail.com wrote:
Le 22 avr. 2014 à 19:58, Andrea Giammarchi andrea.giammar
functionalities. (Not sure about the
`getOwnProperty{Names,Symbol}` dichotomy of ES6, but that's another
question.) On the other hand `Object.getOwnPropertyDescriptors` and
`Object.mixin` are complex methods.
—Claude
On Tue, Apr 22, 2014 at 11:59 AM, Claude Pache claude.pa...@gmail.com
wrote
On Tue, Apr 22, 2014 at 1:27 PM, Claude Pache claude.pa...@gmail.comwrote:
Hi,
There has been request to add `Object.getOwnPropertyDescriptors` (plural)
to the standard. Reviewing use cases presented in thread [1] or in older
thread [2], it seems to me that all of them boil down to copy all
2014-03-07 0:51 GMT+01:00 C. Scott Ananian ecmascr...@cscott.net:
On Thu, Mar 6, 2014 at 6:31 PM, André Bargull andre.barg...@udo.edu
wrote:
On 3/6/2014 11:35 PM, Andrea Giammarchi wrote:
The proposed [[GetOwnPropertyNames]] internal method is supposed to be a
more restrictive version of
I was also a bit puzzled by the iterator return value. I expected
that it would handle mutation (adding new properties) during traveral
the way that the `Map` and `Set` iterators do. I was surprised to see
that all the users turned the iterator into an array; none seemed to
handle concurrent
Tom Van Cutsem wrote:
Given that most of the functions that use [[OwnPropertyKeys]] need to
either construct an array anyway, or want reliable results, I wonder
whether we shouldn't just change [[OwnPropertyKeys]] to include the
checks and return an array instead of an iterable. That way we
, 2014 at 1:39 PM, Tom Van Cutsem tomvc...@gmail.com wrote:
Object.getOwnPropertyDescriptors(proxy) would trigger the
getOwnPropertyNames trap, followed by calls to the
getOwnPropertyDescriptor
trap for each individual property.
[[OwnPropertyKeys]], `ownKeys` trap.
Yes, according
-05 20:11 GMT+01:00 C. Scott Ananian ecmascr...@cscott.net:
On Wed, Mar 5, 2014 at 1:39 PM, Tom Van Cutsem tomvc...@gmail.com
wrote:
Object.getOwnPropertyDescriptors(proxy) would trigger the
getOwnPropertyNames trap, followed by calls to the
getOwnPropertyDescriptor
trap for each
tomvc.be at gmail.com
https://mail.mozilla.org/listinfo/es-discuss
// wrote:
//Object.getOwnPropertyDescriptors(proxy) would trigger the
//getOwnPropertyNames trap, followed by calls to the
//getOwnPropertyDescriptor
//trap for each individual property.
//
// [[OwnPropertyKeys
André Bargull mailto:andre.barg...@udo.edu
March 6, 2014 at 1:21 PM
I would rephrase into this:
if you need a getOwnPropertyNames trap, you might need for consistency a
getOwnPropertySymbols independently from getOwnPropertyDescriptors since
these methods are already available.
While it
https://mail.mozilla.org/listinfo/es-discuss
*
* wrote:
** Object.getOwnPropertyDescriptors(proxy) would trigger the
** getOwnPropertyNames trap, followed by calls to the
** getOwnPropertyDescriptor
** trap for each individual property.
**
** [[OwnPropertyKeys]], `ownKeys` trap
at cscott.net
https://mail.mozilla.org/listinfo/es-discuss:
**
** On Wed, Mar 5, 2014 at 1:39 PM, Tom Van Cutsem tomvc.be at gmail.com
https://mail.mozilla.org/listinfo/es-discuss
*
* wrote:
** Object.getOwnPropertyDescriptors(proxy) would trigger the
** getOwnPropertyNames trap, followed
On 3/6/2014 10:24 PM, Brendan Eich wrote:
André Bargull mailto:andre.barg...@udo.edu
March 6, 2014 at 1:21 PM
I would rephrase into this:
if you need a getOwnPropertyNames trap, you might need for consistency a
getOwnPropertySymbols independently from getOwnPropertyDescriptors since
these
/listinfo/es-discuss:
//
// On Wed, Mar 5, 2014 at 1:39 PM, Tom Van Cutsem tomvc.be at gmail.com
https://mail.mozilla.org/listinfo/es-discuss
/
/wrote: // Object.getOwnPropertyDescriptors(proxy) would
trigger the // getOwnPropertyNames trap, followed
/
/wrote: // Object.getOwnPropertyDescriptors(proxy) would
trigger the // getOwnPropertyNames trap, followed by
calls to the // getOwnPropertyDescriptor // trap for
each individual property. // // [[OwnPropertyKeys]],
`ownKeys` trap
On Thu, Mar 6, 2014 at 6:31 PM, André Bargull andre.barg...@udo.edu wrote:
On 3/6/2014 11:35 PM, Andrea Giammarchi wrote:
The proposed [[GetOwnPropertyNames]] internal method is supposed to be a
more restrictive version of [[OwnPropertyKeys]] to ensure Proxy objects
don't lie about their
2014-03-05 20:11 GMT+01:00 C. Scott Ananian ecmascr...@cscott.net:
On Wed, Mar 5, 2014 at 1:39 PM, Tom Van Cutsem tomvc...@gmail.com wrote:
Object.getOwnPropertyDescriptors(proxy) would trigger the
getOwnPropertyNames trap, followed by calls to the
getOwnPropertyDescriptor
trap for each
-discuss@mozilla.org list es-discuss@mozilla.org
Subject: Re: Object.getOwnPropertyDescriptors(O) ? // plural
Have you filed a bugzilla ticket for this? That seems the best way to
ensure it will get discussed at the next TC39 meeting and resolved one way
or the other.
--scott
On Mar 3, 2014 8:44 PM
Windows Phone
--
From: C. Scott Ananian csc...@cscott.net
Sent: 3/4/2014 6:16
To: Andrea Giammarchi andrea.giammar...@gmail.com
Cc: es-discuss@mozilla.org list es-discuss@mozilla.org
Subject: Re: Object.getOwnPropertyDescriptors(O) ? // plural
Have you filed
/2014 6:16
To: Andrea Giammarchi andrea.giammar...@gmail.com
Cc: es-discuss@mozilla.org list es-discuss@mozilla.org
Subject: Re: Object.getOwnPropertyDescriptors(O) ? // plural
Have you filed a bugzilla ticket for this? That seems the best way to
ensure it will get discussed at the next TC39
--
From: C. Scott Ananian csc...@cscott.net
Sent: 3/4/2014 6:16
To: Andrea Giammarchi andrea.giammar...@gmail.com
Cc: es-discuss@mozilla.org list es-discuss@mozilla.org
Subject: Re: Object.getOwnPropertyDescriptors(O) ? // plural
Have you filed a bugzilla ticket for this? That seems
On Tue, Mar 4, 2014 at 12:48 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
yes, because `Object.getOwnPropertyDescriptor(O, k)` accepts both
`propertyName` and `Symbol` as second argument. The plural, and to be
consistent with the shallowCopy example, should return a list of both.
On Mar 4, 2014, at 9:34 AM, Rick Waldron wrote:
On Tue, Mar 4, 2014 at 12:30 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
Apparently this triggered an @rwaldron which seems to be super-effective
In agenda for April's meeting.
Yep:
` of
descriptors the proposed plural `Object.getOwnPropertyDescriptors(O)`
should return is a collection that includes descriptors for both
`properties` and `Symbols`
I hope this makes sense.
Thanks again Rick for, at least, trying and helping out with this.
Cheers
On Tue, Mar 4, 2014 at 9:48 AM, Andrea
On Tue, Mar 4, 2014 at 1:03 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote:
On Mar 4, 2014, at 9:34 AM, Rick Waldron wrote:
On Tue, Mar 4, 2014 at 12:30 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
Apparently this triggered an @rwaldron which seems to be super-effective
this boilerplate is error prone and prolix plus it cannot be optimized in
core so it's also very slow.
With the introduction of classes, Symbols, and all ES6 new entries, I feel
like the `for(var key in object)` loop is dead but developers have no way
to clone objects in the right way and in one
On Mar 4, 2014, at 10:17 AM, Rick Waldron wrote:
I like this cloning idiom, but I don't see why we would consider this for
ES6, it isn't something that is critical or can't be implemented via ES code.
It would be much more appropriate to queue it up for the 2015 train.
ES6: let's
Allen, as developer, being unable to `shallow-copy` in JavaScript for other
*N* years is actually critical.
Luckily it's not so difficult to polyfill but if you have Rick presenting
[something like this](
https://gist.github.com/WebReflection/9353781#objectgetownpropertydescriptorso)
I really
On Tue, Mar 4, 2014 at 2:40 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
Allen, as developer, being unable to `shallow-copy` in JavaScript for
other *N* years is actually critical.
Luckily it's not so difficult to polyfill but if you have Rick presenting
[something like this](
,
Object.getOwnPropertyDescriptors(source)
);
```
So, in order of priority or what is needed the most, I think with
`Object.getOwnPropertyDescriptors(O)` we can solve more than
`Object.assign(target, source)` but bear in mind I am not pushing back the
latter one anyhow.
IMO this proposal is just very
Object.defineProperties(
target,
Object.getOwnPropertyDescriptors(source)
);
```
No. `Object.assign` (1) uses the semantics of the assignment operator `=` (for
example, it makes a difference in case of setters), and (2) copies only
enumerable properties. Did you think about `Object.mixin
You are right, I've realized it after posting ... `Object.assign(target,
source)` via `Get` and `Put` is basically the equivalent of a classic
`for/in` with `hasOwnProperty` check ... well, once again, in ES6
`Object.getOwnPropertyDescriptors(O)` seems to be a solution for other
cases too (shallow
will be definable through descriptors ... all this VS
```javascript
var shallowCopy = Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject)
);
```
which I believe is a win.
Thanks
On Sun, Mar 2, 2014 at 5:01 PM, Andrea Giammarchi
= Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject)
);
```
Today what we have to do this instead:
```javascript
var shallowCopy = Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyNames(originalObject).reduce
),
Object.getOwnPropertyDescriptors(originalObject)
);
```
Today what we have to do this instead:
```javascript
var shallowCopy = Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyNames(originalObject).reduce(
function (descriptors, name) {
descriptors[name
```javascript
var shallowCopy = Object.create(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject)
);
```
which I believe is a win.
Thanks
On Sun, Mar 2, 2014 at 5:01 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
I wonder if by any chance
(
Object.getPrototypeOf(originalObject),
Object.getOwnPropertyDescriptors(originalObject)
);
```
which I believe is a win.
Thanks
On Sun, Mar 2, 2014 at 5:01 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
I wonder if by any chance this could sneak into ES6 ... we have only
Hi,
I think adding Object.getOwnPropertyDescriptors would be great.
It could be implemented like this:
Object.getOwnPropertyDescriptors = function ( object ) {
var propertiesDescriptor = { };
Object.getOwnPropertyNames( object ).forEach( function ( key ) {
propertiesDescriptor
It has already been proposed, look here:
http://wiki.ecmascript.org/doku.php?id=strawman:extended_object_api
On Nov 11, 2011, at 20:30 , Xavier MONTILLET wrote:
Hi,
I think adding Object.getOwnPropertyDescriptors would be great.
It could be implemented like
53 matches
Mail list logo