Another place where things differ is member variables: public var a:String;
On the SWF side, this variable defaults to null. On the JS side, it defaults to undefined right now. In the case of a member variable, we could set it to null by default on the JS side to make it more consistent. For your case, it's a little more tricky, though. Maybe something like this, if the type on the left side is anything except *? (Numbers and boolean would need special behavior too, though) var propA:Object = a.prop || null; That could have memory or performance implications. Sometimes, trying to achieve perfect behavior parity can be too expensive. Needs benchmarking and careful analysis to see if it's worth it, I guess! - Josh On Jun 2, 2017 5:20 PM, "Justin Mclean" <jus...@classsoftware.com> wrote: Hi, OK the issue is that we getting different results for AS and JS. For code like this: var a:Object = {}; var propA:Object = a.prop; var propB:* = a.prop; if (propA === undefined) { trace("A undefined"); } if (propA === null) { trace("A null"); } if (propB === undefined) { trace("B undefined"); } if (propB === null) { trace("B null"); } On AS we get: A null B undefined On JS we get: A undefined B undefined Which is obvious when you look at the generated code: var /** @type {Object} */ a = {}; var /** @type {Object} */ propA = a.prop; var /** @type {*} */ propB = a.prop; So I’m guessing the compiler should be doing something different with this line? var /** @type {Object} */ propA = a.prop; So it returns null rather than undefined? Thanks, Justin