This was standardized in ECMAscript, fifth edition. In particular, it is not supported (for non-DOM objects) until IE 9.
defineProperty is definitely what we want when available. It can be used to set an immutable property (like _digId) on an object that does not show up as an enumerable field. When it is not available, the best we can do is provide a mutable, enumerable field. We could make the property immutable by using a function instead of a field to store _digId, but an inconsistent API is worse than the original problem.
This was standardized in ECMAscript, fifth edition. In particular, it is not supported (for non-DOM objects) until IE 9.
defineProperty is definitely what we want when available. It can be used to set an immutable property (like _digId) on an object that does not show up as an enumerable field. When it is not available, the best we can do is provide a mutable, enumerable field. We could make the property immutable by using a function instead of a field to store _digId, but an inconsistent API is worse than the original problem.