Re: [FLEXJS][FALCONJX] The Date class

2016-02-24 Thread Andy Dufilie
On Feb 23, 2016 19:34, "Alex Harui" wrote: > OK, so I'll get the compiler to map Date's properties to getX/setX calls. > > For Array.sort, I guess we should map it to some other function in some > other class. Should we generalize such a mapping or is that the only one? > > -Alex > > These cons

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Alex Harui
OK, so I'll get the compiler to map Date's properties to getX/setX calls. For Array.sort, I guess we should map it to some other function in some other class. Should we generalize such a mapping or is that the only one? -Alex On 2/23/16, 1:31 PM, "Andy Dufilie" wrote: >You're right, it would

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Andy Dufilie
You're right, it would be great to have these things fixed automatically. I wouldn't want built-in types to be modified, though. My team recently passed up one library for another because it was modifying the Date prototype. Andy On Tue, Feb 23, 2016 at 3:53 PM, Alex Harui wrote: > A warning fo

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Alex Harui
A warning for Array.sort() might be the right answer, although I would be tempted to cross-compile it to something like Array.ActionScriptSort() and actually implement what it does in AS. For Date, I think folks will expect properties like .hour to work. The feedback I think I'm hearing is that f

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Peter Ent
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 S

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Andy Dufilie
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,

[FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Alex Harui
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