Reflect.hasOwn() ?

Axel Rauschmayer axel at
Fri Jul 25 21:13:04 PDT 2014

On Jul 26, 2014, at 6:02 , Peter van der Zee <ecma at> wrote:

> On Sat, Jul 26, 2014 at 5:43 AM, Axel Rauschmayer <axel at> wrote:
>> The only exception that comes to my mind is `{},
>> key)` (which is the only safe way to invoke this method). Would it make
>> sense to provide that as a tool function, e.g. as `Reflect.hasOwn()`?
> That would make it unsafe again. Not so much from random people
> polluting the global Object, but certainly unsafe from a security
> perspective.

With “safe”, I only meant w.r.t. overriding (e.g., `obj.hasOwnProperty('foo')` fails if `obj` has an own property whose name is `'hasOwnProperty'`).

Security-wise, how is `{}` safer than a hypothetical `Reflect.hasOwn()`?


Dr. Axel Rauschmayer
axel at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list