Object.getPrototypeOf vs. Reflect.getPrototypeOf
O.p.__proto__
cannot substitute Object.setPrototypeOf
ad latter one
already shipped and it's already used.
Why are we here again, if I might ask? Truth is that I'd like to know that answer too but without going through all things that already landed for more than a year now.
I also would like to know if freezing or sealing an object should block the
operation so that Reflect.setPrototypeOf
could return false.
Le 6 déc. 2014 à 12:13, Andrea Giammarchi <andrea.giammarchi at gmail.com> a écrit :
I also would like to know if freezing or sealing an object should block the operation so that
Reflect.setPrototypeOf
could return false.
Successfully freezing, sealing, or preventing extensions makes the prototype immutable, without regard to what API is used to attempt to change it. More generally, see:
Does the following rationale still stand? Source: esdiscuss/2013-June/030958
O.p.__proto__
do we want Object.setPrototypeOf or just Reflect.setPrototypeOf?It doesn’t seem like the question “where do we draw the line” has been answered satisfactorily. I’d drop
Object.setPrototypeOf
and only useReflect.setPrototypeOf
andReflect.getPrototypeOf
.