@@ -36,19 +36,19 @@ function Add-PrivateMember {
3636 function NewPropertyCacheEntry ([MemberInfo ] $property ) {
3737 $cacheEntry = [ref ].Assembly.
3838 GetType(' System.Management.Automation.DotNetAdapter+PropertyCacheEntry' ).
39- GetConstructor(60 , $null , @ ($property.GetType ()), 1 ).
39+ GetConstructor($FLAG_MAP .Instance , $null , @ ($property.GetType ()), 1 ).
4040 Invoke($property )
4141
4242 # The cache entry uses these fields to determine if the properties for the
4343 # Getter/Setter delegates should create the delegate. They are set to false during
4444 # construction if the method isn't public.
45- $cacheEntry.GetType ().GetField(' writeOnly' , 60 ).SetValue($cacheEntry , $false )
45+ $cacheEntry.GetType ().GetField($ script :FIELD_REFERENCE . writeOnly, 60 ).SetValue($cacheEntry , $false )
4646 $isWritable = $property.SetMethod -or
4747 (' Field' -eq $property.MemberType -and
4848 -not $property.IsInitOnly )
4949
5050 if ($isWritable ) {
51- $cacheEntry.GetType ().GetField(' readOnly' , 60 ).SetValue($cacheEntry , $false )
51+ $cacheEntry.GetType ().GetField($ script :FIELD_REFERENCE . readOnly, 60 ).SetValue($cacheEntry , $false )
5252 }
5353 return $cacheEntry
5454 }
@@ -128,7 +128,7 @@ function Add-PrivateMember {
128128 Type = $target.psobject.BaseObject
129129 Flags = $FLAG_MAP.Static
130130 Adapter = [psobject ].
131- GetField(' dotNetStaticAdapter' , $FLAG_MAP.Static ).
131+ GetField($ script :FIELD_REFERENCE . dotNetStaticAdapter, $FLAG_MAP.Static ).
132132 GetValue($null )
133133 }
134134 }
@@ -137,7 +137,7 @@ function Add-PrivateMember {
137137 Type = $target.GetType ()
138138 Flags = $FLAG_MAP.Instance
139139 Adapter = [PSMethod ].
140- GetField(' adapter' , $FLAG_MAP.Instance ).
140+ GetField($ script :FIELD_REFERENCE . adapter, $FLAG_MAP.Instance ).
141141 GetValue($target.psobject.Methods.Item (' GetType' ))
142142 }
143143 }
@@ -173,7 +173,7 @@ function Add-PrivateMember {
173173
174174 $alreadyExists = $table .
175175 GetType().
176- GetField(' indexes' , $FLAG_MAP.Instance ).
176+ GetField($ script :FIELD_REFERENCE . indexes, $FLAG_MAP.Instance ).
177177 GetValue($table ).
178178 ContainsKey($memberName )
179179
0 commit comments