@@ -85,20 +85,21 @@ private bool IsValidManifest(Ast ast, string fileName)
85
85
}
86
86
87
87
/// <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.
89
89
/// </summary>
90
90
/// <param name="key"></param>
91
91
/// <param name="hast"></param>
92
92
/// <param name="scriptText"></param>
93
93
/// <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>
95
95
private bool HasAcceptableExportField ( string key , HashtableAst hast , string scriptText , out IScriptExtent extent )
96
96
{
97
97
extent = null ;
98
98
foreach ( var pair in hast . KeyValuePairs )
99
99
{
100
100
if ( key . Equals ( pair . Item1 . Extent . Text . Trim ( ) , StringComparison . OrdinalIgnoreCase ) )
101
101
{
102
+ // checks if the right hand side of the assignment is an array.
102
103
var arrayAst = pair . Item2 . Find ( x => x is ArrayLiteralAst || x is ArrayExpressionAst , true ) ;
103
104
if ( arrayAst == null )
104
105
{
@@ -107,6 +108,7 @@ private bool HasAcceptableExportField(string key, HashtableAst hast, string scri
107
108
}
108
109
else
109
110
{
111
+ //checks if any entry within the array has a wildcard.
110
112
var elementWithWildcard = arrayAst . Find ( x => x is StringConstantExpressionAst
111
113
&& x . Extent . Text . Contains ( "*" ) , false ) ;
112
114
if ( elementWithWildcard != null )
0 commit comments