Defining setters for properties of the global object doesn't work

RESOLVED FIXED in mozilla1.9beta5

Status

()

P2
normal
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: ancestor.ak, Assigned: mrbkap)

Tracking

({regression, testcase})

Trunk
mozilla1.9beta5
regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
Created attachment 306884 [details]
testcase

The following works as expected in the shell:

< var y;
< __defineSetter__('x', function(val) { y = val });
< x = 3;
< y
> 3

However, it fails in an apparently identical testcase, the setter never gets called.

Regressed between 2008-03-01 00:16 and 2008-03-01 03:10:
http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=1204359360&maxdate=1204369859

Updated

11 years ago
Flags: blocking1.9?
This is *so* mine.
Assignee: general → nobody
Component: JavaScript Engine → XPConnect
OS: Windows XP → All
Priority: -- → P2
QA Contact: general → xpconnect
Hardware: PC → All
Target Milestone: --- → mozilla1.9beta4
Assignee: nobody → mrbkap
Created attachment 306951 [details] [diff] [review]
Fix

We need to propagate the getters and setters onto the inner object. There is now some code duplication between XPCWrapper::AddProperty and XPCWrapper::NewResolve, which I can fix if you think it's worth it.
Attachment #306951 - Flags: superreview?(jst)
Attachment #306951 - Flags: review?(jst)

Updated

11 years ago
Flags: blocking1.9? → blocking1.9+

Updated

11 years ago
Attachment #306951 - Flags: superreview?(jst)
Attachment #306951 - Flags: superreview+
Attachment #306951 - Flags: review?(jst)
Attachment #306951 - Flags: review+
Brendan: blocking1.9 with a target milestone of beta4 means that this blocks shipment of beta4. If you don't think that's necessary, please change the TM to "mozilla1.9".
Oops, that's my fault.
Target Milestone: mozilla1.9beta4 → mozilla1.9
Attachment #306951 - Flags: approval1.9?
(Reporter)

Comment 5

11 years ago
Comment on attachment 306951 [details] [diff] [review]
Fix

This bug is blocking1.9+, approval is not needed.
Attachment #306951 - Flags: approval1.9?
Fix checked into trunk.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.9 → mozilla1.9beta5

Comment 7

11 years ago
The if (!isXOW) sequence in XPCWrapper::AddProperty() seems to allow a situation where |v| is used in OBJ_DEFINE_PROPERTY uninitialized.  I am hitting this case while using firebug 1.2 with a recent nightly build.

Updated

11 years ago
Blocks: 422825
(In reply to comment #7)
> The if (!isXOW) sequence in XPCWrapper::AddProperty() seems to allow a
> situation where |v| is used in OBJ_DEFINE_PROPERTY uninitialized.

Obvious bug, sorry I missed it -- please file new and cite it here?

/be
Crowder: I missed your setting the new bug as blocked by this one, but that is backwards. The reason is that if one were cherry-picking fixes onto a release branch, one would not want just this bug -- one would want to see that it was blocked by a newer bug, and consider taking that bug's patch too.

/be
No longer blocks: 422825
Depends on: 422825

Comment 10

11 years ago
Sorry, assumed "Clone This Bug" would do the right thing, and did not examine dependencies closely enough.
(Reporter)

Updated

11 years ago
Depends on: 428021
You need to log in before you can comment on or make changes to this bug.