flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: how remove numcheck
Date Fri, 23 Sep 2016 15:13:06 GMT


On 9/22/16, 11:56 PM, "lizhi" <sliz@qq.com> wrote:

>the float32array also has this issue.
>and the Number() are slow in loop

I could be wrong, but I'm pretty sure the compiler should try to insert a
coercion there, because otherwise the JS code would behave differently
than the AS code if there were strings in the array.

The FalconJX compiler allows certain "directives" like
@flexjsignorecoercion to control coercions since they can be wasteful.
The following:

/**
 * @flexjsignorecoercion Number
 */
	public function numberarr():void
	{
  var arr:Array;
  var n:Number;
  n = arr[0] as Number;
		
	}

was cross-compiled to:

/**
 * @flexjsignorecoercion Number
 * @export
 */
VectorObject.prototype.numberarr = function() {
  var /** @type {Array} */ arr;
  var /** @type {number} */ n;
  n = arr[0];
};

Isn't that what you want?


-Alex


Mime
View raw message