I have to agree with Andy about issuing warnings.

We could make Date an exception and the compiler sees .hour and translates
that to .getHours() for the JS code as Alex suggests. That seems like its
pretty straightforward but anything not as obvious just get flagged.

My 2 cents,
Peter Ent
Adobe Systems/Apache Flex Project

On 2/23/16, 1:44 PM, "Andy Dufilie" <andy.dufi...@gmail.com> wrote:

>AS has getHours() and setHours() too.  If the code is updated to use those
>it should work.
>Date is not the only class that has differences - Array.sort() is not the
>same in AS and JS.
>I think the most the compiler should do is provide a warning when using
>known AS features that do not exist in JS, because some things can't
>easily
>be translated.
>
>Andy
>
>On Tue, Feb 23, 2016 at 12:16 PM, Alex Harui <aha...@adobe.com> wrote:
>
>> Hi,
>>
>> This bug [1] is about the Date class.
>>
>> It appears that JS uses, for example, getHour()/setHour() while AS uses
>> the .hour property.  How should we handle this?  Some options are:
>>
>> 1) Use Object.defineProperties to add get/set to Date
>> 2) Have the compiler detect Date and generate getHour/setHour calls.
>>
>> Thoughts?
>> -Alex
>>
>> [1] https://issues.apache.org/jira/browse/FLEX-35041
>>
>>

Reply via email to