Opened 9 years ago
Closed 5 years ago
#14275 closed defect (patchwelcome)
dojo.safeMixin can fail in IE
Reported by: | dhaber | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.13 |
Component: | Core | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
This applies to dojo 1.4 through 1.6 and IE 6, 7 & 8.
If you declare a new class that has a constructor which uses dojo.safeMixin but you pass no parameters to the constructor it will fail in IE. For example:
dojo.declare("a.b.c", null, { constructor: function(args) { dojo.safeMixin(this, args); }});
The above will fail in IE if you do this:
var d = new a.b.c();
Change History (7)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Techincally invalid by API docs. dojo.mixin({}, undefined) works fine. Ironic the mixin() with the word "safe" in it doesn't check presence like the seemingly "unsafe" mixin() (and private _mixin() functions) attached to the dojo object.
comment:3 Changed 9 years ago by
Milestone: | → tbd |
---|
comment:4 Changed 9 years ago by
I would really like to see a fix for this. This one just cost me a day and is very difficult to debug, but very easy to fix. If nothing else, it would be nice to have the behavior match across the browsers. Especially since IE bugs are much harder to debug.
comment:5 Changed 9 years ago by
Component: | General → Core |
---|---|
Owner: | set to Eugene Lazutkin |
Status: | new → assigned |
Giving to Eugene since safeMixin() is defined in declare.js.
comment:6 Changed 7 years ago by
a simple workaround is always pass {} to declare function
var jr = new JsonRest(); // cause exception var jr = new JsonRest({}); // it works
comment:7 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | assigned → closed |
Given that no one has shown interest in creating a patch in the past 4+ years, I'm closing this as patchwelcome.
Seems like this ticket is invalid. You are calling
whereas the API documentation says that you have to pass in an object as the second argument.