Nuking misleading properties in `Object.getOwnPropertyDescriptor`

Nathan Wall nathan.wall at live.com
Sat Mar 9 20:23:05 PST 2013


> (1) "Nuke" the special properties (`get`, `set`, and `value` when any of them is not defined) on a descriptor returned by `getOwnPropertyDescriptor` which shouldn't be inherited through the descriptor's prototype. By "nuke" them, I mean specify that they be defined as `undefined`, much like `callee` and `caller` in strict mode. (I don't think strict mode is required in this case, though, since I highly doubt anyone could be relying on this behavior.)

Naturally, `defineProperty` would also have to be rewritten a little to ignore properties set to `undefined`. If `get`, `set`, and `value` are all set to `undefined`, then `value` would be assumed to be `undefined`. In addition, `writable` would also have to be nuked for accessor descriptors.  I think it's workable?

Nathan 		 	   		  


More information about the es-discuss mailing list