You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/05/25 17:00:14 UTC

[royale-compiler] branch develop updated: FindRoyaleMXMLPropertyNamesToKeep: fix incorrect exception when name is not string

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new b3f8084  FindRoyaleMXMLPropertyNamesToKeep: fix incorrect exception when name is not string
b3f8084 is described below

commit b3f808432a915e742d5424267152b14cb4bf33c0
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue May 25 09:59:11 2021 -0700

    FindRoyaleMXMLPropertyNamesToKeep: fix incorrect exception when name is not string
    
    When using -mxml-reflect-object-property=true, the name might not be a string.
---
 .../javascript/jscomp/FindRoyaleMXMLPropertyNamesToKeep.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/compiler-jx/src/main/java/com/google/javascript/jscomp/FindRoyaleMXMLPropertyNamesToKeep.java b/compiler-jx/src/main/java/com/google/javascript/jscomp/FindRoyaleMXMLPropertyNamesToKeep.java
index 6b1a63d..e940f8f 100644
--- a/compiler-jx/src/main/java/com/google/javascript/jscomp/FindRoyaleMXMLPropertyNamesToKeep.java
+++ b/compiler-jx/src/main/java/com/google/javascript/jscomp/FindRoyaleMXMLPropertyNamesToKeep.java
@@ -155,11 +155,13 @@ public class FindRoyaleMXMLPropertyNamesToKeep extends AbstractPostOrderCallback
 			while(i < minNumPropsChildren) {
 				Node nameNode = arrayArg.getChildAtIndex(i);
 				i++;
-				if (!nameNode.isString()) {
-					throwParseException(nameNode);
+				String propName = null;
+				if (nameNode.isString()) {
+					//no parse exception if it's not a string because non-string
+					//values are allowed when using -mxml-reflect-object-property=true
+					propName = nameNode.getString();
+					propertyNamesToKeep.add(propName);
 				}
-				String propName = nameNode.getString();
-				propertyNamesToKeep.add(propName);
 				Node propTypeNode = arrayArg.getChildAtIndex(i);
 				i++;
 				if((IMXMLLanguageConstants.ATTRIBUTE_ID.equals(propName) || "_id".equals(propName)) && propTypeNode.isTrue()) {