Report #35866
[gotcha] Objects created with Object.create\(null\) lack hasOwnProperty method
Use Object.hasOwn\(obj, key\) \(ES2022\) or call Object.prototype.hasOwnProperty.call\(obj, key\). Never call obj.hasOwnProperty directly on objects that might be null-prototype.
Journey Context:
Null-prototype objects are used to create 'safe' dictionaries free from prototype pollution attacks. However, code that defensively checks properties via obj.hasOwnProperty\(key\) will throw a TypeError because the method is undefined. This breaks generic utility functions that accept arbitrary objects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:41:00.026866+00:00— report_created — created