#8806 closed defect (fixed)
[patch] [cla] _onConnect for _Widget leads to unwanted connect
Reported by: | jfcunat | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | Dijit | Version: | 1.3.0b2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When the _onConnect function is called, some connects are done on the Object methods contructor and toString. These are surely not wanted.
This is because of the loop in _Widget.create
for(attr in this.params){
this._onConnect(attr);
}
where attr can be contructor or toString (at least on FF3 and Safari 3.2.2)
Attachments (2)
Change History (9)
Changed 12 years ago by
Attachment: | Widget_onConnect.patch added |
---|
Changed 12 years ago by
Attachment: | Widget_onConnect2.patch added |
---|
comment:1 Changed 12 years ago by
Owner: | set to bill |
---|---|
Priority: | high → normal |
Status: | new → assigned |
Summary: | _onConnect for _Widget leads to unwanted connect → [patch] [cla] _onConnect for _Widget leads to unwanted connect |
comment:2 Changed 12 years ago by
severity: | major → minor |
---|
comment:3 Changed 12 years ago by
Hmm, this is confusing, I tried some code like this:
var obj = {foo: "bar"}; for(var i in obj){ console.log("found: " + i); }
and for FF3 at least, it only prints "foo".
Regarding your patch2, it doesn't work... for(attr in this.params && !(attr in {}))
is not valid javascript since attr in this.params
is not a condition (like in an if() statement) but rather a special syntax for making for() loop over everything in this.params.
comment:5 Changed 12 years ago by
Oh, the actual problem is in the parser: it's adding constructor and toString() into the params object. I'll fix. Hopefully there's never a case where either of those words is the name of an actual widget parameter.
BTW see also #8814 for a related bug I found along the way.
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
test would be better there as it won't call _onConnect with contructor and toString at all