Community
Participate
Working Groups
Build Identifier: 20110407183333 Enter the following code into a .js file: ----- // Create objects var foo = { bar : {} }; // Set some properties foo.bar.one = 1; foo.bar.two = 2; // Reset the object foo.bar = {}; ----- On the last line, I will get a javascript warning: Type mismatch: cannot convert from ___anonymous346782_346783 to ___anonymous346761_346762 There doesn't seem to be anything wrong with the code. I am simply overwriting an object with a new object. If, however, I do the following: ----- ... // Reset the object foo.bar = new Object(); ----- I do not get a warning. From my understanding of javascript, the two declarations are equivalent. Reproducible: Always Steps to Reproduce: In eclipse preferences go to: JavaScript > Validator > Error/Warnings and enable JavaScript semantic validation. This will enable display of warnings, such as described above.
Created attachment 198856 [details] patch Removes error reported for mis-matched types on assignment statements. Anything can be assigned to anything in JavaScript, no need for such checking.
Checked into 3.2.5 and HEAD.