flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Re: [7/7] git commit: [flex-asjs] [refs/heads/develop] - make getValue a lot faster - 30ms down to 5ms in a complex app for JS in Chrome
Date Sat, 03 Jun 2017 00:20:00 GMT
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
Mime
View raw message