Thanks for those details Yishay, I added your example to the testing and got that working again. The stringified output is standardized on swf, but because of variation in the supporting DOMParsers between browsers, attribute and namespaces order can vary in javascript, so I simply used string length as an expected common value in these new assertions for stringified output.
Note that processing instructions are ignored outside a root tag in as3, even when ignoreProcessingInstructions is false, I think because there is no 'Document' specific XML class in as3. I have in the past sometimes needed to write 'Document'-level XML support to handle some of the things that as3 XML does not cover (but that it does it need to in the majority of cases). I would be surprised if there are not more issues uncovered with XML over time. If you notice more issues I am happy to look into them. The more tests we can add the better... On Thu, Jun 20, 2019 at 8:19 PM Yishay Weiss <[email protected]> wrote: > Try this [1] simple app with the following [2] xml. > > > > If you look at the console you'll notice that toString() outputs "", but > after reverting 722f16599441be4fd0243d6fe9f2cd856f1a6b0b it outputs the xml. > > > > [1] https://paste.apache.org/pndA > > [2] https://paste.apache.org/u0Ji > > > > ________________________________ > From: Greg Dove <[email protected]> > Sent: Thursday, June 20, 2019 9:37:28 AM > To: [email protected] > Subject: Re: Implicit casts and skipAsCercions > > Thanks Yishay. > fyi, you can see the XML tests I already added in these classes: > > > https://github.com/apache/royale-asjs/tree/develop/manualtests/UnitTests/src/main/royale/flexUnitTests/xml > > > If you provide a minimal example I will add a new test tomorrow and fix > whatever is required to make sure it passes in both swf and javascript. Or > if you feel adventurous, feel free to build manualtests/UnitTests and add > the failing test yourself, then I can instantly see what I need to fix. > > You can build that with ant or maven. > And if you use the top level UnitTests/testsview/index.html to view the > build ouput, you can look at the results side by side with both javascript > and flash (assuming you sort out the latest flash plugin hurdles in > whatever browser you use). > > I have already ported some of the other tests to Josh's RoyaleUnit, but I > plan to swap the manualtest assertion format to be the same setup as > RoyaleUnit and will add the other remaining tests to RoyaleUnit next week. > > > > > > > > On Thu, Jun 20, 2019 at 5:32 PM Yishay Weiss <[email protected]> > wrote: > > > Hi Greg, > > > > > > > > Thanks for outlining the options again. I’ll try to create a test case > for > > XML today. > > > > > > > > ________________________________ > > From: Greg Dove <[email protected]> > > Sent: Wednesday, June 19, 2019 11:57:22 PM > > To: [email protected] > > Subject: Re: Implicit casts and skipAsCercions > > > > Harbs, > > > > js-complex-implicit-coercions is on by default. The default behavior is > > therefore now the same as swf. It is an optimization to turn it off. > > You need to switch it off if you want to avoid it. But if you are seeing > > runtime errors, then it is likely indicating something that would not > work > > at runtime in swf, so you may also want to review that first. > > > > If you want code to work as before, you need to do this: > > > > -js-complex-implicit-coercions=false; > > -js-vector-index-checks=false; > > -js-resolve-uncertain=false; > > > > or to add them to the -config.xml > > > > There is also the option to output Vector as Array, if you want the > legacy > > approach for Vectors. I outlined these in an earlier post, but I will add > > something more detailed to docs this week. > > > > For XML, I'm sorry if something is not working right now. I did port a > lot > > of your adhoc tests to the manualtests project. And added quite a few > more > > new tests. The implementation was not working correctly for quite a few > > things. So while I addressed some new issues,there is still a lot more to > > do. It's entirely possible that I broke something that did not have a > test > > yet. Unless we focus more on test coverage, it will be easy to break > things > > as other things get fixed, particularly with something like XML, which is > > reasonably complex. With inadequate test coverage, it can even be > possible > > to start relying on an implementation that does not work as it should. > > Yishay: can you please give me a simple test case for the XML issue you > are > > seeing? I will look into it today. > > > > > > > > > > > > On Thu, Jun 20, 2019 at 8:33 AM Harbs <[email protected]> wrote: > > > > > The code has /* implicit cast */ and we do not have the > > > complex-implicit-coresions set. > > > > > > FYI, XML is also broken due to empty nodes which did not used to be > > there, > > > but I’ll let Yishay comment on the details. > > > > > > > On Jun 19, 2019, at 11:29 PM, Greg Dove <[email protected]> wrote: > > > > > > > > Hi Yishay, > > > > > > > > If there's a problem with this I will address it asap. > > > > The setting was not working correctly before. I think it is now, so > > that > > > > may have affected the output, but perhaps there are some test cases I > > did > > > > not cover. > > > > > > > > skipAsCoercions only relates to explicit coercions, and should not > have > > > an > > > > effect on the implicit coercions > > > > > > > > (But it does make me wonder if I have implemented the new config > level > > > > option correctly, maybe it should be added as one of the > > > > -js-output-optimization options instead of being another top level > > > option. > > > > I can revisit this in another thread.) > > > > > > > > For now, the equivalent is > > > > <js-complex-implicit-coercions>false</js-complex-implicit-coercions> > > > > > > > > or > > > > -js-complex-implicit-coercions=false > > > > > > > > Do you have either of those set? If so then you should not see the > > > implicit > > > > coercions unless they are toggled on locally and therefore it is an > > error > > > > > > > > Can you please also use 'find in files' with your js-debug output, > > > > searching for the text: > > > > /* implicit cast */ > > > > and inspect the site of the runtime error? > > > > > > > > Is it generating the right cast on the right for the expected type on > > the > > > > left if it is assignment? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Jun 20, 2019 at 2:00 AM Yishay Weiss <[email protected] > > > > > wrote: > > > > > > > >> After updating the compiler we’re getting a runtime type coercion > > > failure > > > >> which didn’t exist before. > > > >> > > > >> A quick question: should ‘skipAsCoercions’ suppress implicit casts? > > > Could > > > >> the latest commit [1] have changed that? > > > >> > > > >> [1] > > > >> > > > > > > https://github.com/apache/royale-compiler/commit/73caf20e03b72bb9e1717f2339c14cb79c6082b9 > > > >> > > > >> Thanks. > > > >> > > > > > > > > >
