andrea.giammarchi at gmail.com
Sat Jul 26 08:51:04 PDT 2014
why would you drop the specificity of the name?
would a Symbol be a valid second argument ?
and what if one day we'd like to introduce a hasOwnValue instead, as
similar to Array#contains but for generic objects ?
On Sat, Jul 26, 2014 at 5:52 AM, Kevin Smith <zenparsing at gmail.com> wrote:
>> The rationale to remove Reflect.hasOwn was that it could easily be
>> simulated via (Reflect.getOwnPropertyDescriptor(obj,name) !== undefined).
>> While this conses a throw-away property descriptor object, the overhead was
>> deemed insignificant.
> Sounds good.
> Still, hanging "hasOwnProperty" off of Object.prototype was a mistake and
> a is constant source of irritation. Perhaps the mistake could be rectified
> by hanging the same functionality directly off of Object?
> if (Object.hasOwn(obj, "foo")) doSomething();
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss