You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2022/01/04 02:59:58 UTC

[GitHub] [royale-compiler] greg-dove commented on issue #191: Internal Error NPE thrown for try-catch declaration in mxml

greg-dove commented on issue #191:
URL: https://github.com/apache/royale-compiler/issues/191#issuecomment-1004492432


   @joshtynjala @Laturine I believe this is fixed now. Please let me know if you see any problems. I think it will be slightly more strict than the original falcon compiler in some cases now to report naming conflicts as well.
   I added an extra test here:  https://github.com/apache/royale-asjs/blob/3e133c3450a99b58835810df63c9bb7ae7b9c8cd/frameworks/projects/Core/src/test/royale/flexUnitTests/language/LanguageTesterTestTryCatch.as#L129
   
   @joshtynjala fyi the issue was somewhat like I expected, but as is often the case, was a little trickier than I'd hoped. CatchScope is a strange creature. The local scope is only intended for storing the catch parameter definition and all other name declarations are supposed to be hoisted to the enclosing scope. That part was working, but in this case the name lookups were attempting to find the definition by name in the non-hoisting scope, which only contains the catch parameter definition. That is why it was coming back as null when doing the definition lookup by name. As to why it was only doing that from mxml and not regular actionscript, that was less evident, although there seems to be more repetitive passes over the same code block from mxml, as parsing the mxml file has more 'stages'.
   I did test the changes with a String declaration inside a catch block which you can see in the unit test above. And I did test very similar code separately, inside an mxml script block (after repro'ing the original issue in that case).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org