Opened 7 years ago

Closed 7 years ago

#14535 closed defect (wontfix)

dojo.mixin generates inconsistent mixins

Reported by: haysmark Owned by: Rawld Gill
Priority: high Milestone: tbd
Component: Core Version: 1.7.1
Keywords: needsreview Cc:
Blocked By: Blocking:

Description

  1. Go to some test page like http://archive.dojotoolkit.org/nightly/checkout/dijit/tests/ProgressBar.html
  2. In the console (Firebug lite or the browser's native console), evaluate:
dojo.mixin({}, new Function()).constructor == Function

In IE6, the answer is true. In all other browsers, the answer is false. Who is right?

Technical details: dojo.mixin is defined in _base/lang.js. IE6 has("bug-for-in-skips-shadowed"). The first loop on line 23 is skipped by all browsers (empty lambdas have no iterable properties). In IE6 only, the has condition kicks in and forces a copy of some hard-coded properties from the function onto the empty object. The result is that the mixin gets the Function constructor in IE6. Again, I'm not sure who is right.

Change History (2)

comment:1 Changed 7 years ago by haysmark

Keywords: needsreview added
Owner: set to Rawld Gill
Status: newassigned

Can you think of anything really bad that would happen as a result of this ticket? If not, please mark as wontfix.

comment:2 Changed 7 years ago by Rawld Gill

Resolution: wontfix
Status: assignedclosed

I just did a quick study of the issue with the document

<html>
<head>
	<script type="text/javascript" src = "./dojo.js"></script>
	<script type="text/javascript">
		dojo.ready(function(){
		dojo.byId("result").innerHTML = "and the answer is " + (dojo.mixin({}, new Function()).constructor == Function);
		});
	 </script>
<head>
<body>
	<p id="result">loading</p>
</body>
</html>

I tested on IE 9, 8, 6, FF12, Chrome18 against trunk and version 1.5.2.

  • trunk and v1.5.2 behave identically
  • IE9, FF12, Chrome18 all return false
  • IE8 and IE6 both return true

Since the behavior is identical between 1.5.2 and trunk and since I think this should cause not problems, I'm marking wontfix.

Note: See TracTickets for help on using tickets.