Closed Bug 428021 Opened 17 years ago Closed 17 years ago

Can't define both a getter and a setter for a property of the global object

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9

People

(Reporter: ancestor.ak, Assigned: crowderbt)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files, 7 obsolete files)

It looks like the fix for bug 420585 wasn't complete. Defining either a getter or a setter works fine, but when attempting to define both of them, only the first one is registered. See the attached testcase - setting |x| throws an exception as if there was no setter.
Flags: blocking1.9?
Attached file testcase
Why should this stop ship?
I've nominated it, because it's very similar to bug 420585 which was marked as a blocker by Brendan. I guess it breaks a semi-major JS feature.
Yeah, we fixed half-duplex situations, we should fix the full thing. Blake, can you take this bug? /be
Blocking per Comment #4.
Flags: blocking1.9? → blocking1.9+
Assignee: nobody → crowder
Crowder? How are we doing here?
The "goto out" here was bogus, we still need to run the rest of the routine here so that the clasp->addProperty routine still happens. Without that, XOWs can't propagate to the wrapped object.
Attachment #317055 - Flags: review?(brendan)
Comment on attachment 317055 [details] [diff] [review] can't short-circuit as much as we once did Some muck-up with my test-rig caused ALL my tests to fail for both baseline and patched tests, so I missed some regressions caused by this patch. Needs more work.
Attachment #317055 - Flags: review?(brendan)
Attached patch closer to working (obsolete) — Splinter Review
Attachment #317055 - Attachment is obsolete: true
Attached patch passes js/tests suite (obsolete) — Splinter Review
Going to check this against sunspider, now.
Attachment #317099 - Attachment is obsolete: true
Comment on attachment 317118 [details] [diff] [review] passes js/tests suite I think that this will slightly regress sunspider (by fractions of a percent), perhaps moreso on browser-builds, but it is needed for correctness.
Attachment #317118 - Flags: review?(brendan)
Assignee: crowder → general
Component: XPConnect → JavaScript Engine
OS: Windows XP → All
QA Contact: xpconnect → general
Hardware: PC → All
Assignee: general → crowder
Attachment #317118 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #317327 - Flags: review?(shaver)
Attachment #317118 - Flags: review?(brendan)
Comment on attachment 317327 [details] [diff] [review] addressing shaver's review from IRC r+a=shaver
Attachment #317327 - Flags: review?(shaver)
Attachment #317327 - Flags: review+
Attachment #317327 - Flags: approval1.9+
Attached patch a mochitest for this bug (obsolete) — Splinter Review
The testcase (plus a couple additional checks) from attachment 314615 [details] as a mochitest.
Attachment #317339 - Flags: review?(shaver)
Without the patch from comment 12, two of the three checks added in this mochitest fail (the getter still runs).
Would it make sense to stick the new mochitest in js/src/xpconnect/tests/mochitest next to test_wrappers.html?
Blake, works for me; I really wasn't entirely sure -where- to put this. New patch with the relocated test coming right up.
Attached patch relocated (obsolete) — Splinter Review
Attachment #317339 - Attachment is obsolete: true
Attachment #317358 - Flags: review?(mrbkap)
Attachment #317339 - Flags: review?(shaver)
Attachment #317358 - Attachment is patch: true
Attachment #317358 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 317358 [details] [diff] [review] relocated >+ var exn = false; >+ var e; >+ try { >+ e = x; >+ x = false; >+ } catch (e) { >+ exn = true; >+ } >+ ok(!exn, "Exception caught: " + e); Er, this |e| isn't the exception. Why not just fail inside the catch block (you don't even need |exn| then)? r=mrbkap with that fixed.
Attachment #317358 - Flags: review?(mrbkap) → review+
Attached patch patch to land (obsolete) — Splinter Review
Rolling up the patch and the testcase together. mrbkap, please r? the testcase again -- feel free to eyeball the code, too, if you like.
Attachment #317327 - Attachment is obsolete: true
Attachment #317358 - Attachment is obsolete: true
Attachment #317383 - Flags: review?(mrbkap)
Attachment #317383 - Flags: review?(mrbkap)
Comment on attachment 317383 [details] [diff] [review] patch to land >+ ok(0, "Exception caught: " + e); Just use |fail("Exception caught: " + e);|?
closer to what mrbkap likes, but with a consistent test count.
Attachment #317383 - Attachment is obsolete: true
Attachment #317386 - Flags: review?(mrbkap)
Attachment #317386 - Flags: review?(mrbkap) → review+
"patch to land, for real" has r+/a+ on the parts that need approval, and r+ on the tests, please land with a note attributing review to shaver and mrbkap. If this doesn't land this afternoon, I will land it tonight.
Keywords: checkin-needed
mozilla/js/src/jsobj.c 3.468 mozilla/js/src/xpconnect/tests/mochitest/Makefile.in 1.8 mozilla/js/src/xpconnect/tests/mochitest/test_bug428021.html 1.1
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
Flags: in-testsuite+
v on centos,win2k3 tinderboxen
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: