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)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9
People
(Reporter: ancestor.ak, Assigned: crowderbt)
References
Details
(Keywords: regression, testcase)
Attachments
(2 files, 7 obsolete files)
228 bytes,
text/html
|
Details | |
5.78 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
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?
Reporter | ||
Comment 1•17 years ago
|
||
Comment 2•17 years ago
|
||
Why should this stop ship?
Reporter | ||
Comment 3•17 years ago
|
||
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.
Comment 4•17 years ago
|
||
Yeah, we fixed half-duplex situations, we should fix the full thing. Blake, can you take this bug?
/be
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → crowder
Comment 6•17 years ago
|
||
Crowder? How are we doing here?
Assignee | ||
Comment 7•17 years ago
|
||
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)
Assignee | ||
Comment 8•17 years ago
|
||
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)
Assignee | ||
Comment 9•17 years ago
|
||
Attachment #317055 -
Attachment is obsolete: true
Assignee | ||
Comment 10•17 years ago
|
||
Going to check this against sunspider, now.
Attachment #317099 -
Attachment is obsolete: true
Assignee | ||
Comment 11•17 years ago
|
||
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 | ||
Updated•17 years ago
|
Assignee: crowder → general
Component: XPConnect → JavaScript Engine
OS: Windows XP → All
QA Contact: xpconnect → general
Hardware: PC → All
Assignee | ||
Comment 12•17 years ago
|
||
Assignee: general → crowder
Attachment #317118 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #317327 -
Flags: review?(shaver)
Attachment #317118 -
Flags: review?(brendan)
Comment 13•17 years ago
|
||
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+
Assignee | ||
Comment 14•17 years ago
|
||
The testcase (plus a couple additional checks) from attachment 314615 [details] as a mochitest.
Attachment #317339 -
Flags: review?(shaver)
Assignee | ||
Comment 15•17 years ago
|
||
Without the patch from comment 12, two of the three checks added in this mochitest fail (the getter still runs).
Comment 16•17 years ago
|
||
Would it make sense to stick the new mochitest in js/src/xpconnect/tests/mochitest next to test_wrappers.html?
Assignee | ||
Comment 17•17 years ago
|
||
Blake, works for me; I really wasn't entirely sure -where- to put this. New patch with the relocated test coming right up.
Assignee | ||
Comment 18•17 years ago
|
||
Attachment #317339 -
Attachment is obsolete: true
Attachment #317358 -
Flags: review?(mrbkap)
Attachment #317339 -
Flags: review?(shaver)
Updated•17 years ago
|
Attachment #317358 -
Attachment is patch: true
Attachment #317358 -
Attachment mime type: application/octet-stream → text/plain
Comment 19•17 years ago
|
||
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+
Assignee | ||
Comment 20•17 years ago
|
||
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)
Assignee | ||
Updated•17 years ago
|
Attachment #317383 -
Flags: review?(mrbkap)
Comment 21•17 years ago
|
||
Comment on attachment 317383 [details] [diff] [review]
patch to land
>+ ok(0, "Exception caught: " + e);
Just use |fail("Exception caught: " + e);|?
Assignee | ||
Comment 22•17 years ago
|
||
closer to what mrbkap likes, but with a consistent test count.
Attachment #317383 -
Attachment is obsolete: true
Attachment #317386 -
Flags: review?(mrbkap)
Updated•17 years ago
|
Attachment #317386 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 23•17 years ago
|
||
"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
Comment 24•17 years ago
|
||
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
Updated•17 years ago
|
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•