defineProperty(__proto__, "shenanigans")

Andrea Giammarchi andrea.giammarchi at gmail.com
Tue Nov 6 16:08:16 PST 2012


I understand the getter/setter logic, I don't get it when it comes to
value. Prototype could be used to pre-define shapes too where all
properties are described upfront but those with just a value cannot be
reused which is a limit if we think about securing prototypes.

Too bad I have missed that discussion

br


On Tue, Nov 6, 2012 at 4:03 PM, Axel Rauschmayer <axel at rauschma.de> wrote:

> This has been discussed a while back: it is similar to how a getter-only
> accessor works.
>
>
> [[[Sent from a mobile device. Please forgive brevity and typos.]]]
>
> Dr. Axel Rauschmayer
> axel at rauschma.de
> Home: http://rauschma.de
> Blog: http://2ality.com
>
> On 07.11.2012, at 00:31, Andrea Giammarchi <andrea.giammarchi at gmail.com>
> wrote:
>
> so this mean that freezing a Contructor.prototype to enforce/ensure nobody
> can change runtime that prototype will result in unusable code as we know,
> right? Or we should never pre define properties that should be changed
> runtime? Second one works and stink at the same time.
>
> I preferred the old V8 behavior ... if I freeze a __proto__ the object
> should not pass through that proto when a property is set unless the proto
> has a setter ... but this is another story I guess.
>
> Anyway, thanks for explaining this which is gold for a blog post.
>
> br
>
>
> On Tue, Nov 6, 2012 at 1:46 PM, Brandon Benvie <brandon at brandonbenvie.com>wrote:
>
>> Clarification: if an object has no own property, then it defers to the
>> writability from the prototype chain. If it has an own property then it
>> never checks the prototype chain.
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121106/54cbe80a/attachment-0001.html>


More information about the es-discuss mailing list