Makes sense. So the right solution is probably to make the type passed into the constructor Object for both platforms.
On Nov 20, 2016, at 5:03 PM, Alex Harui <aha...@adobe.com> wrote: > BinaryData is in Core. There is a Core.swc and CoreJS.swc with the > respective API signatures. > > In FlexJS, when an API has different signatures per-platform, the entire > subsystem is suppose to "not care" in that nobody ever checks the type > they get back (like the parent property of a display object) or what you > pass in is correct for the platform (that an Event inherits flash Event > for SWF and browser Event for JS). It is just supposed to work out. > > So you may need to compile against the CoreJS.swc instead of Core.swc. > > -Alex > > On 11/20/16, 3:19 AM, "Harbs" <harbs.li...@gmail.com> wrote: > >> I’m working on a js-only app. I’m trying to create a BinaryData object >> from an ArrayBuffer. The class has conditional compiling and takes either >> a ByteArray in SWF or an ArrayBuffer in JS. >> >> When I try to pass an ArrayBuffer to the constructor in my js app, I get >> the following error: >> Implicit coercion of a value of type ArrayBuffer to an unrelated type >> ByteArray. >> >> This is the only “javascript” problem I’m getting in my app. All other >> JS-only APIs are not causing errors. Any clues why this is not working? >> >> I can change BinaryData to accept a type of “Object”, but I’d like to >> understand why it’s not working as it currently stands. >> >> Harbs >