Closed Bug 558950 Opened 14 years ago Closed 14 years ago

setting watchpoint on readonly property returns callee

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Assigned: luke)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch fixSplinter Review
The bug is simply that *vp = JSVAL_VOID is done after an early exit for readonly properties so Object.watch (safely) returns the callee, not void.  Fix and test attached.
Attachment #438622 - Flags: review?(jwalden+bmo)
Comment on attachment 438622 [details] [diff] [review]
fix

>+
>+    /* Set return value before first successful return. */
>+    *vp = JSVAL_VOID;
>+

Comment not necessary here, this is more than obvious to any semi-seasoned JS hacker.


>diff --git a/js/src/trace-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js b/js/src/trace-

Technically this would be better as a standard JS test (js/src/tests), but it's extensionland already so I don't really care.
Attachment #438622 - Flags: review?(jwalden+bmo) → review+
http://hg.mozilla.org/tracemonkey/rev/75928f966ea2
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/75928f966ea2
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: