FWIW, I don't know why an Application project would have different behavior 
than a Library project unless the relevant code in the Library project was in 
an AS file but the same code was in an MXML file in an Application project.  
Any MXML file has a set of default imports.  I'd have to look to see if 
org.apache.royale.events.Event is one of them, but there is also a chance that 
some other part of an MXML forced the import of Royale's Event, maybe to handle 
an event in an MXML tag.

Issue #51 is about whether the Browser's Event should be available by default 
or not.

Once you import Royale's Event, it will always win over the Browser's Event.  
The compiler special cases the handling of what would otherwise be an ambiguous 
definition error.  The compiler always ignores a global class if a packaged 
class has been imported.  And if you want to reference the global class, you 
can specify the fully qualified name window.Event

I'm not a fan of special case code in the compiler to deal with issue #51, but 
I wouldn't be opposed to screwing around with the typedefs so there isn't a 
global Event and only a window.Event.

My 2 cents,
-Alex

On 10/21/18, 1:54 PM, "Harbs" <[email protected]> wrote:

    There’s already an issue:
    
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-compiler%2Fissues%2F51&amp;data=02%7C01%7Caharui%40adobe.com%7Cbaaa04573e5b40b48c5108d637976321%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636757520711024552&amp;sdata=7psR4ndXvG3FSOOHzdG8TuojSou0h0HYMakswDHYMaQ%3D&amp;reserved=0
    
    > On Oct 21, 2018, at 9:20 PM, Carlos Rovira <[email protected]> 
wrote:
    > 
    > Hi
    > 
    > I found something similar today, I remember this thread.
    > 
    > What is happening to me is that I create code in Application project, but
    > then refactor to its own library.
    > In Application code nothing makes me add "import
    > org.apache.royale.events.Event"
    > But when moved to library, compilation failed with "Error: Call to a
    > possibly undefined method Event."
    > So I think the problem is that compiling to an Application differs to
    > compile to library in some way.
    > I suppose we always want "org.apache.royale.events.Event" right?
    > 
    > If this doesn't sound strange I can fill an issue in GitHub
    > 
    > Thanks
    > 
    > Carlos
    > 
    > 
    > 
    > El jue., 20 sept. 2018 a las 9:52, Harbs (<[email protected]>) 
escribió:
    > 
    >> Good idea.
    >> 
    >>> On Sep 20, 2018, at 10:46 AM, Alex Harui <[email protected]>
    >> wrote:
    >>> 
    >>> Feel free to add a warning to the compiler.
    >>> 
    >>> On 9/20/18, 12:41 AM, "Harbs" <[email protected]> wrote:
    >>> 
    >>>   I was just hit by a strange error in IE. It turns out that I was
    >> using “new Event” without importing org.apache.royale.events.Event. This
    >> became a browser Event instead of a Royale event and you can’t “new” 
events
    >> in IE…
    >>> 
    >>>   I’m not sure if there’s something we can do about this, but it’s not
    >> a bad idea to at least document the potential problem.
    >>> 
    >>>   Harbs
    >>> 
    >> 
    >> 
    > 
    > -- 
    > Carlos Rovira
    > 
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Cbaaa04573e5b40b48c5108d637976321%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636757520711024552&amp;sdata=LFOB7mXYHtLgYsk3hPVOj8Eku9b43Nx82BE6ym0k6w4%3D&amp;reserved=0
    
    

Reply via email to