@@ -85,20 +85,21 @@ private bool IsValidManifest(Ast ast, string fileName)
8585 }
8686
8787 /// <summary>
88- /// Checks if the *ToExport fields are explicitly set to lists, @(...)
88+ /// Checks if the *ToExport fields are explicitly set to arrays, eg. @(...), and the array entries do not contain any wildcard.
8989 /// </summary>
9090 /// <param name="key"></param>
9191 /// <param name="hast"></param>
9292 /// <param name="scriptText"></param>
9393 /// <param name="extent"></param>
94- /// <returns>A boolean value indicating if the the ToExport fields are explicitly set to lists or not.</returns>
94+ /// <returns>A boolean value indicating if the the ToExport fields are explicitly set to arrays or not.</returns>
9595 private bool HasAcceptableExportField ( string key , HashtableAst hast , string scriptText , out IScriptExtent extent )
9696 {
9797 extent = null ;
9898 foreach ( var pair in hast . KeyValuePairs )
9999 {
100100 if ( key . Equals ( pair . Item1 . Extent . Text . Trim ( ) , StringComparison . OrdinalIgnoreCase ) )
101101 {
102+ // checks if the right hand side of the assignment is an array.
102103 var arrayAst = pair . Item2 . Find ( x => x is ArrayLiteralAst || x is ArrayExpressionAst , true ) ;
103104 if ( arrayAst == null )
104105 {
@@ -107,6 +108,7 @@ private bool HasAcceptableExportField(string key, HashtableAst hast, string scri
107108 }
108109 else
109110 {
111+ //checks if any entry within the array has a wildcard.
110112 var elementWithWildcard = arrayAst . Find ( x => x is StringConstantExpressionAst
111113 && x . Extent . Text . Contains ( "*" ) , false ) ;
112114 if ( elementWithWildcard != null )
0 commit comments