Closed Bug 613706 Opened 14 years ago Closed 14 years ago

Object.watch breaks programs that test Object.hasOwnProperty

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 394964

People

(Reporter: johnjbarton, Unassigned)

Details

Try this in the Firebug console or a Web page var anObj = {}; anObj.watch("foo", function say(id, oldV, newV){}); if (anObj.hasOwnProperty('foo')) console.log("buggy"); else console.log("golden"); It's a shame because programs that logically know they never set properties to 'undefined' break when you add 'watch' to debug them. Similarly for (p in anObj) reports 'foo' but says it is 'undefined'.
Isn't that a duplicate of bug 394964? As soon as watch() doesn't add properties anymore, hasOwnProperty() should be false.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.