Re: Re: descriptors and not only own properties gotcha

2014-12-20 Thread Gary Guo
On Wed Dec 17 10:30:03 PST 2014, Andrea Giammarchi wrote: >This would already fix the `Object.prototype.get` or `.set` case since I >believe nobody ever used an inherited `value` property on purpose for >descriptors ... or is it? I agree that nobody will use an inherited 'value' property, however

Re: descriptors and not only own properties gotcha

2014-12-18 Thread Andrea Giammarchi
Yeah, that fails anyway and if you loop through a for/in and attach as own property you are moving the problem instead of actually solving it in the current state of the specs. This is probably closer to what I meant by `Descriptor` solution to improve reliability of descriptors in possibly hostil

Re: descriptors and not only own properties gotcha

2014-12-18 Thread Andy Earnshaw
*sigh* ignore me I completely misread the initial email. Serves me right for skim reading and speed replying during lunch. On Thu, Dec 18, 2014 at 1:31 PM, Andy Earnshaw wrote: > > Oops, misfire. The rest of that: > > function shadow(obj, props) { > var ret = Object.create(obj); > >

Re: descriptors and not only own properties gotcha

2014-12-18 Thread Andy Earnshaw
Oops, misfire. The rest of that: function shadow(obj, props) { var ret = Object.create(obj); for (var k in props) ret[k] = props[k] return ret; } // Elsewhere... function defineSomeProps (obj) { var defaults = { enumerable: true, writ

Re: descriptors and not only own properties gotcha

2014-12-18 Thread Andy Earnshaw
Can we be sure nobody's ever written something like this: function shadow(obj, props) { var ret = Object.create(obj); } On Thu, Dec 18, 2014 at 10:08 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > > My main point is that everything you get from > `Object.getOwnPrope

Re: descriptors and not only own properties gotcha

2014-12-18 Thread Andrea Giammarchi
My main point is that everything you get from `Object.getOwnPropertyDescriptor`, beside undefined or possible abrupt errors, will have own properties. Even es5-shim/sham has been checking own properties for years [1] so I am pretty confident nothing will break 'cause own properties is what develop

Re: descriptors and not only own properties gotcha

2014-12-17 Thread Allen Wirfs-Brock
On Dec 17, 2014, at 10:30 AM, Andrea Giammarchi wrote: > Actually simplifying as proposal: does everyone agree that if a > descriptor.[[Value]] is own property no further checks on inherited [[Get]] > and [[Set]], or generally speaking Accessor Property related checks, should > be made ? > >

Re: descriptors and not only own properties gotcha

2014-12-17 Thread Andrea Giammarchi
Actually simplifying as proposal: does everyone agree that if a descriptor.[[Value]] is own property no further checks on inherited [[Get]] and [[Set]], or generally speaking Accessor Property related checks, should be made ? This would already fix the `Object.prototype.get` or `.set` case since I