As to "why" it was implemented this way, there's probably no answer from the outside. A good example is when former IE developer, the inventor of innerHTML, faces problems with innerHTML itself.
Asking why is also unnecessary because
Another thing to note is that your analogy is too specific. The issue is not restricted to the assignment expression
, you can reproduce it with other types of expressions
:
undefined === elem.onclick( true )
typeof elem.onclick( true )
elem.onclick( true ) - 1
alert(elem.onclick( true ))
Try some function that actually has one parameter and actually returns something. See if it produces an error too. It may have something to do with parameters and a function default return value. Try it and post the results back, please.
EDIT
If the function does not get called, the problem could be in the resolution of the property onclick. It may be somehow you are not actually calling your defined function, but the code finds some other build in IE object when you pass true as parameter. In any case this behavior is out of any specifications and so we may call it bug. Of those IE has plenty as you can see from my own questions.
IE 8 absolute positioned element outside its parent clipping problem
IE8 bottom:0 in position:absolute behaves like position:fixed
Have you tried using the instructions found here? He suggests using code like this:
var fireOnThis = document.getElementById('someID');
var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent( 'click', true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null );
fireOnThis.dispatchEvent(evObj);