Closed Bug 240577 Opened 20 years ago Closed 20 years ago

obj.watch code predates cloned function objects, uses fun->object wrongly

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.7final

People

(Reporter: brendan, Assigned: brendan)

References

()

Details

(Keywords: fixed1.7, js1.5)

Attachments

(3 files, 2 obsolete files)

leading to the complaint at the news: URL by Jens Thiele.  Patch next.

/be
Testcase:

var f=function(text){ return (function(id,o,n){print(text);return n;}); }
var w=f("Hello");
w();
foo={x:1}
foo.watch("x",w);
foo.x=10;

/be
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.7final
Attached patch proposed fixSplinter Review
This is good for the 1.7 branch as well as the trunk.

/be
Attachment #146167 - Flags: review?(shaver)
Flags: blocking1.7+
Attachment #146199 - Flags: review?(shaver)
Comment on attachment 146167 [details] [diff] [review]
proposed fix

r=shaver.
Attachment #146167 - Flags: review?(shaver) → review+
Comment on attachment 146199 [details] [diff] [review]
further fixing for other ValueToFunction|fun->object abuses

r=shaver
Attachment #146199 - Flags: review?(shaver) → review+
Fixed on the trunk.  Going for 1.7 approval.

/be
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 146167 [details] [diff] [review]
proposed fix

Safe fix, get the right one of N objects instead of converting it via an N:1
mapping, then backing up via the "primary" parent link.

/be
Attachment #146167 - Flags: approval1.7?
Attachment #146199 - Flags: approval1.7?
Attachment #146167 - Flags: approval1.7? → approval1.7+
Attachment #146199 - Flags: approval1.7? → approval1.7+
Fixed on brnach.

/be
Flags: blocking1.7+
Keywords: fixed1.7
Attached file js1_5/Regress/regress-240577.js (obsolete) —
I'll write to Jens.
Attached file js1_5/Regress/regress-240577.js (obsolete) —
Attachment #174966 - Attachment is obsolete: true
could not get a response from Jens, rewrote
js/tests/js1_5/Regress/regress-240577.js to not require permission. checked in.
Attachment #174968 - Attachment is obsolete: true
Flags: testcase+
verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: