Closed
Bug 613706
Opened 14 years ago
Closed 14 years ago
Object.watch breaks programs that test Object.hasOwnProperty
Categories
(Core :: JavaScript Engine, defect)
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'.
Comment 1•14 years ago
|
||
Isn't that a duplicate of bug 394964? As soon as watch() doesn't add properties anymore, hasOwnProperty() should be false.
Reporter | ||
Updated•14 years ago
|
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.
Description
•