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 ?

Regards


On Sat, Jul 26, 2014 at 5:52 AM, Kevin Smith <zenpars...@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@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to