I’ll ry to write something up when I have time, but simply:
@royaleemitcoercion causes Language.as to be called no matter what the compiler 
option specified is.
@royaleignorecoercion is the opposite. Language.as is not called (and the JS 
code is cleaner).

Basically @royaleignorecoercion should always be used unless there’s a specific 
reason to have a runtime coercion (i.e. you’d want a null var if the type check 
does not match or an RTE for function coercions). I’d think an assert is a 
better option than RTE for function coercions though…

@royaleemitcoercion is not technically needed because we’re compiling (most of) 
our swcs without the “skipAsCoercions” and “skipFunctionCoercions” options.

Harbs

> On Mar 30, 2018, at 10:55 AM, Carlos Rovira <[email protected]> wrote:
> 
> Harbs,
> 
> I'm getting various lines of the following kind after layout branch merge.
> Nothing is failing, is just a warning, but want to know the reason that now
> this shows up and how to solve it.
> Again, if you can give some words about ignore and emit cohercions it
> should be of help to me while developing Jewel components.
> thanks
> 
> ADVERTENCIA:
> /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/target/javascript/bin/js-debug/org/apache/royale/binding/DataBindingBase.js:62:
> WARNING - Parse error. illegal use of unknown JSDoc tag
> "royaleemitcoercion"; ignoring it
> * @royaleemitcoercion org.apache.royale.core.IStrand
> ^
> 
> 
> 2018-03-29 8:58 GMT+02:00 Piotr Zarzycki <[email protected]>:
> 
>> Harbs,
>> 
>> Put that information on Wiki please. Such questions may appear more often.
>> 
>> Thanks,
>> Piotr
>> 
>> On Thu, Mar 29, 2018, 08:05 Carlos Rovira <[email protected]> wrote:
>> 
>>> Hi Harbs,
>>> 
>>> thanks for the cleaning. I want to read about @royaleemitcoercion, since
>> I
>>> didn't know about it, as well I tried to find some info about @
>>> royaleignorecoercion
>>> but didn't find it. Could you put here a few words about what was this
>> use
>>> for. I remember I know that when I did MDL but I forgot that, and will
>> help
>>> me while creating Jewel components
>>> 
>>> thanks
>>> 
>>> 2018-03-29 0:41 GMT+02:00 Harbs <[email protected]>:
>>> 
>>>> FYI:
>>>> 
>>>> I’ve been spending a lot of time cleaning up the coercions in the
>>>> framework code. All the “as” calls add measurable time when combined.
>> To
>>>> make it clear when as coercions are really needed, I started adding
>>>> annotations to *every* use of coercions and I use either
>>>> @royaleignorecoercion or @royaleemitcoercion depending on the use case.
>>>> 
>>>> Harbs
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Carlos Rovira
>>> http://about.me/carlosrovira
>>> 
>> 
> 
> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira

Reply via email to