This behavior is because the native HTML classes aren't in a package. The
compiler treats everything that's not in a package the same as classes like
Number, Boolean, and String, which you don't need to import.

It seems potentially tricky to change this behavior, unless you have a
whitelist. You wouldn't want to be forced to import Number, for instance.
That would be a pretty drastic change from existing behavior.

If you do happen to require imports for native HTML classes in the JSFlex
target, I'd like to see the JS target keep treating them normally. The HTML
classes should not need to be imported with the JS target.

- Josh

On Mon, Jul 10, 2017 at 8:40 AM, Alex Harui <aha...@adobe.com.invalid>
wrote:

> Yes, good catch.
>
> I'm wondering if the compiler should not auto-import native HTML classes.
>
> -Alex
>
> On 7/10/17, 1:16 AM, "Harbs" <harbs.li...@gmail.com> wrote:
>
> >Good catch.
> >
> >Without looking at them, I’d guess that they are bugs. Clipboard was my
> >error and I just committed a fix for that.
> >
> >Thanks,
> >Harbs
> >
> >> On Jul 10, 2017, at 11:06 AM, Greg Dove <greg.d...@gmail.com> wrote:
> >>
> >> I noticed a problem with VerticalFlexLayout in IE11 (and presumably
> >>older
> >> IE browsers).
> >>
> >> The JS output causing problems has
> >>
> >> child.dispatchEvent(new Event("layoutNeeded"));
> >>
> >> The reason is that the org.apache.flex.events.Event import is missing
> >>from
> >> the
> >> COMPILE::JS build scope
> >> So it is falling back to what I assume is the native html Event class
> >>(via
> >> externs)
> >>
> >> This works fine in Chrome, but not so in IE11.
> >> Changing the actionscript source for VerticalFlexLayout to add
> >> import  org.apache.flex.events.Event;
> >>
> >> to cover  javascript as welll as SWF, fixes the issue.
> >>
> >> I then unzipped all the JS swcs and file-searched in the js output for
> >>'new
> >> Event'
> >>
> >> It looks like there are a total of 14 cases of output in the js which
> >>are
> >> new Event('something') instead of new
> >> org.apache.flex.events.Event('something')
> >>
> >> These are in
> >> org.apache.flex.core.ApplicationBase (x6)
> >> org.apache.flex.svg.GraphicContainer (x3)
> >> org.apache.flex.html.beads.layouts.VerticalFlexLayout (x1)
> >> org.apache.flex.html.beads.layouts.HorizontalFlexLayout (x1)
> >> org.apache.flex.textLayout.edit.Clipboard (x3)
> >>
> >> I suspect these are import omissions that may cause bugs (perhaps only
> >>in
> >> certain older browsers).
> >> But thought I would check before doing any changes in case I am missing
> >> something that I don't understand about the events in js....
> >>
> >> What do others think?
> >
>
>

Reply via email to