2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
using System ;
5
+ using System . Collections . Generic ;
5
6
using System . Xml . XPath ;
6
7
using ILLink . Shared ;
8
+ using Internal . TypeSystem ;
7
9
8
- namespace Mono . Linker
10
+ namespace ILCompiler
9
11
{
10
12
public static class FeatureSettings
11
13
{
12
- public static bool ShouldProcessElement ( XPathNavigator nav , LinkContext context , string documentLocation )
14
+ public static bool ShouldProcessElement ( XPathNavigator nav , IReadOnlyDictionary < string , bool > featureSwitchValues )
13
15
{
14
16
var feature = GetAttribute ( nav , "feature" ) ;
15
17
if ( string . IsNullOrEmpty ( feature ) )
@@ -18,25 +20,25 @@ public static bool ShouldProcessElement(XPathNavigator nav, LinkContext context,
18
20
var value = GetAttribute ( nav , "featurevalue" ) ;
19
21
if ( string . IsNullOrEmpty ( value ) )
20
22
{
21
- context . LogError ( null , DiagnosticId . XmlFeatureDoesNotSpecifyFeatureValue , documentLocation , feature ) ;
23
+ // context.LogError(null, DiagnosticId.XmlFeatureDoesNotSpecifyFeatureValue, documentLocation, feature);
22
24
return false ;
23
25
}
24
26
25
27
if ( ! bool . TryParse ( value , out bool bValue ) )
26
28
{
27
- context . LogError ( null , DiagnosticId . XmlUnsupportedNonBooleanValueForFeature , documentLocation , feature ) ;
29
+ // context.LogError(null, DiagnosticId.XmlUnsupportedNonBooleanValueForFeature, documentLocation, feature);
28
30
return false ;
29
31
}
30
32
31
33
var isDefault = GetAttribute ( nav , "featuredefault" ) ;
32
34
bool bIsDefault = false ;
33
35
if ( ! string . IsNullOrEmpty ( isDefault ) && ( ! bool . TryParse ( isDefault , out bIsDefault ) || ! bIsDefault ) )
34
36
{
35
- context . LogError ( null , DiagnosticId . XmlDocumentLocationHasInvalidFeatureDefault , documentLocation ) ;
37
+ // context.LogError(null, DiagnosticId.XmlDocumentLocationHasInvalidFeatureDefault, documentLocation);
36
38
return false ;
37
39
}
38
40
39
- if ( ! context . FeatureSettings . TryGetValue ( feature , out bool featureSetting ) )
41
+ if ( ! featureSwitchValues . TryGetValue ( feature , out bool featureSetting ) )
40
42
return bIsDefault ;
41
43
42
44
return bValue == featureSetting ;
0 commit comments