@@ -16,10 +16,10 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
1616 /// </summary>
1717 public class CSharpTagHelperCodeRenderer
1818 {
19- internal static readonly string TagHelperExecutionContextVariableName = "__executionContext " ;
20- internal static readonly string BufferedStringValueVariableName = "__tagHelperBufferedStringValue " ;
21- internal static readonly string TagHelperScopeManagerVariableName = "__tagHelperScopeManager" ;
22- internal static readonly string TagHelperRunnerVariableName = "__tagHelperRunner" ;
19+ internal static readonly string ExecutionContextVariableName = "__tagHelperExecutionContext " ;
20+ internal static readonly string StringValueBufferVariableName = "__tagHelperStringValueBuffer " ;
21+ internal static readonly string ScopeManagerVariableName = "__tagHelperScopeManager" ;
22+ internal static readonly string RunnerVariableName = "__tagHelperRunner" ;
2323
2424 private static readonly TagHelperAttributeDescriptorComparer AttributeDescriptorComparer =
2525 new TagHelperAttributeDescriptorComparer ( ) ;
@@ -130,9 +130,9 @@ private void RenderBeginTagHelperScope(string tagName, ContentBehavior contentBe
130130 {
131131 // Call into the tag helper scope manager to start a new tag helper scope.
132132 // Also capture the value as the current execution context.
133- _writer . WriteStartAssignment ( TagHelperExecutionContextVariableName )
134- . WriteStartInstanceMethodInvocation ( TagHelperScopeManagerVariableName ,
135- _tagHelperContext . TagHelperScopeManagerBeginMethodName ) ;
133+ _writer . WriteStartAssignment ( ExecutionContextVariableName )
134+ . WriteStartInstanceMethodInvocation ( ScopeManagerVariableName ,
135+ _tagHelperContext . ScopeManagerBeginMethodName ) ;
136136 _writer . WriteStringLiteral ( tagName )
137137 . WriteEndMethodInvocation ( ) ;
138138 }
@@ -157,7 +157,7 @@ private void RenderTagHelpersCreation(TagHelperChunk chunk)
157157 tagHelperDescriptor . TagHelperName )
158158 . WriteEndMethodInvocation ( ) ;
159159
160- _writer . WriteInstanceMethodInvocation ( TagHelperExecutionContextVariableName ,
160+ _writer . WriteInstanceMethodInvocation ( ExecutionContextVariableName ,
161161 _tagHelperContext . ExecutionContextAddMethodName ,
162162 tagHelperVariableName ) ;
163163
@@ -243,7 +243,7 @@ private void RenderBoundHTMLAttributes(IDictionary<string, Chunk> chunkAttribute
243243
244244 // We need to inform the context of the attribute value.
245245 _writer . WriteStartInstanceMethodInvocation (
246- TagHelperExecutionContextVariableName ,
246+ ExecutionContextVariableName ,
247247 _tagHelperContext . ExecutionContextAddTagHelperAttributeMethodName ) ;
248248
249249 _writer . WriteStringLiteral ( attributeDescriptor . AttributeName )
@@ -277,7 +277,7 @@ private void RenderUnboundHTMLAttributes(IEnumerable<KeyValuePair<string, Chunk>
277277 BuildBufferedAttributeValue ( attributeValue ) ;
278278 }
279279
280- _writer . WriteStartInstanceMethodInvocation ( TagHelperExecutionContextVariableName ,
280+ _writer . WriteStartInstanceMethodInvocation ( ExecutionContextVariableName ,
281281 _tagHelperContext . ExecutionContextAddHtmlAttributeMethodName ) ;
282282 _writer . WriteStringLiteral ( htmlAttribute . Key )
283283 . WriteParameterSeparator ( ) ;
@@ -316,45 +316,45 @@ private void RenderTagHelperBody(IList<Chunk> children, ContentBehavior contentB
316316
317317 private void RenderEndTagHelpersScope ( )
318318 {
319- _writer . WriteStartAssignment ( TagHelperExecutionContextVariableName )
320- . WriteInstanceMethodInvocation ( TagHelperScopeManagerVariableName ,
321- _tagHelperContext . TagHelperScopeManagerEndMethodName ) ;
319+ _writer . WriteStartAssignment ( ExecutionContextVariableName )
320+ . WriteInstanceMethodInvocation ( ScopeManagerVariableName ,
321+ _tagHelperContext . ScopeManagerEndMethodName ) ;
322322 }
323323
324324 private void RenderTagOutput ( string tagOutputMethodName )
325325 {
326326 CSharpCodeVisitor . RenderPreWriteStart ( _writer , _context ) ;
327327
328- _writer . Write ( TagHelperExecutionContextVariableName )
328+ _writer . Write ( ExecutionContextVariableName )
329329 . Write ( "." )
330330 . Write ( _tagHelperContext . ExecutionContextOutputPropertyName )
331331 . Write ( "." )
332332 . WriteMethodInvocation ( tagOutputMethodName , endLine : false )
333- . WriteEndMethodInvocation ( ) ; ;
333+ . WriteEndMethodInvocation ( ) ;
334334 }
335335
336336 private void RenderRunTagHelpers ( bool bufferedBody )
337337 {
338- _writer . Write ( TagHelperExecutionContextVariableName )
338+ _writer . Write ( ExecutionContextVariableName )
339339 . Write ( "." )
340340 . Write ( _tagHelperContext . ExecutionContextOutputPropertyName )
341341 . Write ( " = await " )
342- . WriteStartInstanceMethodInvocation ( TagHelperRunnerVariableName ,
343- _tagHelperContext . TagHelperRunnerRunAsyncMethodName ) ;
344- _writer . Write ( TagHelperExecutionContextVariableName ) ;
342+ . WriteStartInstanceMethodInvocation ( RunnerVariableName ,
343+ _tagHelperContext . RunnerRunAsyncMethodName ) ;
344+ _writer . Write ( ExecutionContextVariableName ) ;
345345
346346 if ( bufferedBody )
347347 {
348348 _writer . WriteParameterSeparator ( )
349- . Write ( BufferedStringValueVariableName ) ;
349+ . Write ( StringValueBufferVariableName ) ;
350350 }
351351
352352 _writer . WriteEndMethodInvocation ( ) ;
353353 }
354354
355355 private void RenderBufferedAttributeValueAccessor ( )
356356 {
357- _writer . WriteInstanceMethodInvocation ( BufferedStringValueVariableName ,
357+ _writer . WriteInstanceMethodInvocation ( StringValueBufferVariableName ,
358358 "ToString" ,
359359 endLine : false ) ;
360360 }
@@ -404,7 +404,7 @@ private void BuildBufferedWritingScope(Action renderCode)
404404
405405 renderCode ( ) ;
406406
407- _writer . WriteStartAssignment ( BufferedStringValueVariableName )
407+ _writer . WriteStartAssignment ( StringValueBufferVariableName )
408408 . WriteMethodInvocation ( _tagHelperContext . EndWritingScopeMethodName ) ;
409409 }
410410
@@ -416,7 +416,7 @@ private void RenderAttributeValue(TagHelperAttributeDescriptor attributeDescript
416416
417417 private static bool IsStringAttribute ( TagHelperAttributeDescriptor attributeDescriptor )
418418 {
419- return typeof ( string ) == attributeDescriptor . PropertyInfo . PropertyType ;
419+ return attributeDescriptor . PropertyInfo . PropertyType == typeof ( string ) ;
420420 }
421421
422422 private static bool TryGetPlainTextValue ( Chunk chunk , out string plainText )
0 commit comments