diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs index da3e577e57..7c15495152 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs @@ -332,6 +332,16 @@ namespace Microsoft.AspNetCore.Razor.Evolution tagHelperVariableName); } + internal override void VisitAddPreallocatedTagHelperHtmlAttribute(AddPreallocatedTagHelperHtmlAttributeIRNode node) + { + Context.Writer + .WriteStartInstanceMethodInvocation( + "__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */, + "AddHtmlAttribute" /* ORIGINAL: ExecutionContextAddHtmlAttributeMethodName */) + .Write(node.VariableName) + .WriteEndMethodInvocation(); + } + internal override void VisitAddTagHelperHtmlAttribute(AddTagHelperHtmlAttributeIRNode node) { var attributeValueStyleParameter = $"global::{typeof(HtmlAttributeValueStyle).FullName}.{node.ValueStyle}"; @@ -403,6 +413,23 @@ namespace Microsoft.AspNetCore.Razor.Evolution } } + internal override void VisitSetPreallocatedTagHelperProperty(SetPreallocatedTagHelperPropertyIRNode node) + { + var tagHelperVariableName = GetTagHelperVariableName(node.TagHelperTypeName); + var propertyValueAccessor = GetTagHelperPropertyAccessor(tagHelperVariableName, node.AttributeName, node.Descriptor); + var attributeValueAccessor = $"{node.VariableName}.Value" /* ORIGINAL: TagHelperAttributeValuePropertyName */; + Context.Writer + .WriteStartAssignment(propertyValueAccessor) + .Write("(string)") + .Write(attributeValueAccessor) + .WriteLine(";") + .WriteStartInstanceMethodInvocation( + "__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */, + "AddTagHelperAttribute" /* ORIGINAL: ExecutionContextAddTagHelperAttributeMethodName */) + .Write(node.VariableName) + .WriteEndMethodInvocation(); + } + internal override void VisitSetTagHelperProperty(SetTagHelperPropertyIRNode node) { var tagHelperVariableName = GetTagHelperVariableName(node.TagHelperTypeName); @@ -545,6 +572,51 @@ namespace Microsoft.AspNetCore.Razor.Evolution "End" /* ORIGINAL: ScopeManagerEndMethodName */); } + internal override void VisitDeclarePreallocatedTagHelperHtmlAttribute(DeclarePreallocatedTagHelperHtmlAttributeIRNode node) + { + Context.Writer + .Write("private static readonly global::") + .Write("Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute" /* ORIGINAL: TagHelperAttributeTypeName */) + .Write(" ") + .Write(node.VariableName) + .Write(" = ") + .WriteStartNewObject("global::" + "Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute" /* ORIGINAL: TagHelperAttributeTypeName */) + .WriteStringLiteral(node.Name); + + if (node.ValueStyle == HtmlAttributeValueStyle.Minimized) + { + Context.Writer.WriteEndMethodInvocation(); + } + else + { + Context.Writer + .WriteParameterSeparator() + .WriteStartNewObject("global::" + "Microsoft.AspNetCore.Html.HtmlString" /* ORIGINAL: EncodedHtmlStringTypeName */) + .WriteStringLiteral(node.Value) + .WriteEndMethodInvocation(endLine: false) + .WriteParameterSeparator() + .Write($"global::{typeof(HtmlAttributeValueStyle).FullName}.{node.ValueStyle}") + .WriteEndMethodInvocation(); + } + } + + internal override void VisitDeclarePreallocatedTagHelperAttribute(DeclarePreallocatedTagHelperAttributeIRNode node) + { + Context.Writer + .Write("private static readonly global::") + .Write("Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute" /* ORIGINAL: TagHelperAttributeTypeName */) + .Write(" ") + .Write(node.VariableName) + .Write(" = ") + .WriteStartNewObject("global::" + "Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute" /* ORIGINAL: TagHelperAttributeTypeName */) + .WriteStringLiteral(node.Name) + .WriteParameterSeparator() + .WriteStringLiteral(node.Value) + .WriteParameterSeparator() + .Write($"global::{typeof(HtmlAttributeValueStyle).FullName}.{node.ValueStyle}") + .WriteEndMethodInvocation(); + } + internal override void VisitDeclareTagHelperFields(DeclareTagHelperFieldsIRNode node) { Context.Writer.WriteLineHiddenDirective(); diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/AddPreallocatedTagHelperHtmlAttributeIRNode.cs b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/AddPreallocatedTagHelperHtmlAttributeIRNode.cs new file mode 100644 index 0000000000..99b36be4c9 --- /dev/null +++ b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/AddPreallocatedTagHelperHtmlAttributeIRNode.cs @@ -0,0 +1,29 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNetCore.Razor.Evolution.Legacy; + +namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate +{ + internal class AddPreallocatedTagHelperHtmlAttributeIRNode : RazorIRNode + { + public override IList Children { get; } = EmptyArray; + + public override RazorIRNode Parent { get; set; } + + internal override MappingLocation SourceRange { get; set; } + + public string VariableName { get; set; } + + public override void Accept(RazorIRNodeVisitor visitor) + { + visitor.VisitAddPreallocatedTagHelperHtmlAttribute(this); + } + + public override TResult Accept(RazorIRNodeVisitor visitor) + { + return visitor.VisitAddPreallocatedTagHelperHtmlAttribute(this); + } + } +} diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/DeclarePreallocatedTagHelperAttributeIRNode.cs b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/DeclarePreallocatedTagHelperAttributeIRNode.cs new file mode 100644 index 0000000000..d99b574e51 --- /dev/null +++ b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/DeclarePreallocatedTagHelperAttributeIRNode.cs @@ -0,0 +1,35 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNetCore.Razor.Evolution.Legacy; + +namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate +{ + internal class DeclarePreallocatedTagHelperAttributeIRNode : RazorIRNode + { + public override IList Children { get; } = EmptyArray; + + public override RazorIRNode Parent { get; set; } + + internal override MappingLocation SourceRange { get; set; } + + public string VariableName { get; set; } + + public string Name { get; set; } + + public string Value { get; set; } + + public HtmlAttributeValueStyle ValueStyle { get; set; } + + public override void Accept(RazorIRNodeVisitor visitor) + { + visitor.VisitDeclarePreallocatedTagHelperAttribute(this); + } + + public override TResult Accept(RazorIRNodeVisitor visitor) + { + return visitor.VisitDeclarePreallocatedTagHelperAttribute(this); + } + } +} diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/DeclarePreallocatedTagHelperHtmlAttributeIRNode.cs b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/DeclarePreallocatedTagHelperHtmlAttributeIRNode.cs new file mode 100644 index 0000000000..109b44a32f --- /dev/null +++ b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/DeclarePreallocatedTagHelperHtmlAttributeIRNode.cs @@ -0,0 +1,35 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNetCore.Razor.Evolution.Legacy; + +namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate +{ + internal class DeclarePreallocatedTagHelperHtmlAttributeIRNode : RazorIRNode + { + public override IList Children { get; } = EmptyArray; + + public override RazorIRNode Parent { get; set; } + + internal override MappingLocation SourceRange { get; set; } + + public string VariableName { get; set; } + + public string Name { get; set; } + + public string Value { get; set; } + + public HtmlAttributeValueStyle ValueStyle { get; set; } + + public override void Accept(RazorIRNodeVisitor visitor) + { + visitor.VisitDeclarePreallocatedTagHelperHtmlAttribute(this); + } + + public override TResult Accept(RazorIRNodeVisitor visitor) + { + return visitor.VisitDeclarePreallocatedTagHelperHtmlAttribute(this); + } + } +} diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitor.cs b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitor.cs index 23f88d6f77..91e520e3ef 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitor.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitor.cs @@ -128,5 +128,25 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate { VisitDefault(node); } + + internal virtual void VisitDeclarePreallocatedTagHelperHtmlAttribute(DeclarePreallocatedTagHelperHtmlAttributeIRNode node) + { + VisitDefault(node); + } + + internal virtual void VisitAddPreallocatedTagHelperHtmlAttribute(AddPreallocatedTagHelperHtmlAttributeIRNode node) + { + VisitDefault(node); + } + + internal virtual void VisitDeclarePreallocatedTagHelperAttribute(DeclarePreallocatedTagHelperAttributeIRNode node) + { + VisitDefault(node); + } + + internal virtual void VisitSetPreallocatedTagHelperProperty(SetPreallocatedTagHelperPropertyIRNode node) + { + VisitDefault(node); + } } } diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitorOfT.cs b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitorOfT.cs index b056f024a7..288601a20f 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitorOfT.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/RazorIRNodeVisitorOfT.cs @@ -129,5 +129,25 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate { return VisitDefault(node); } + + internal virtual TResult VisitDeclarePreallocatedTagHelperHtmlAttribute(DeclarePreallocatedTagHelperHtmlAttributeIRNode node) + { + return VisitDefault(node); + } + + internal virtual TResult VisitAddPreallocatedTagHelperHtmlAttribute(AddPreallocatedTagHelperHtmlAttributeIRNode node) + { + return VisitDefault(node); + } + + internal virtual TResult VisitDeclarePreallocatedTagHelperAttribute(DeclarePreallocatedTagHelperAttributeIRNode node) + { + return VisitDefault(node); + } + + internal virtual TResult VisitSetPreallocatedTagHelperProperty(SetPreallocatedTagHelperPropertyIRNode node) + { + return VisitDefault(node); + } } } diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/SetPreallocatedTagHelperPropertyIRNode.cs b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/SetPreallocatedTagHelperPropertyIRNode.cs new file mode 100644 index 0000000000..08c121470e --- /dev/null +++ b/src/Microsoft.AspNetCore.Razor.Evolution/Intermediate/SetPreallocatedTagHelperPropertyIRNode.cs @@ -0,0 +1,37 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNetCore.Razor.Evolution.Legacy; + +namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate +{ + internal class SetPreallocatedTagHelperPropertyIRNode : RazorIRNode + { + public override IList Children { get; } = EmptyArray; + + public override RazorIRNode Parent { get; set; } + + internal override MappingLocation SourceRange { get; set; } + + public string VariableName { get; set; } + + public string AttributeName { get; set; } + + public string TagHelperTypeName { get; set; } + + public string PropertyName { get; set; } + + public TagHelperAttributeDescriptor Descriptor { get; set; } + + public override void Accept(RazorIRNodeVisitor visitor) + { + visitor.VisitSetPreallocatedTagHelperProperty(this); + } + + public override TResult Accept(RazorIRNodeVisitor visitor) + { + return visitor.VisitSetPreallocatedTagHelperProperty(this); + } + } +} diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/RazorEngine.cs b/src/Microsoft.AspNetCore.Razor.Evolution/RazorEngine.cs index 852713750a..de2804d5a9 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/RazorEngine.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/RazorEngine.cs @@ -66,6 +66,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution internal static void AddRuntimeDefaults(IRazorEngineBuilder builder) { builder.Phases.Add(new DefaultRazorRuntimeCSharpLoweringPhase()); + + builder.Features.Add(new RazorPreallocatedTagHelperAttributeOptimizationPass()); } internal static void AddDesignTimeDefaults(IRazorEngineBuilder builder) diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/RazorPreallocatedTagHelperAttributePass.cs b/src/Microsoft.AspNetCore.Razor.Evolution/RazorPreallocatedTagHelperAttributePass.cs new file mode 100644 index 0000000000..01d5ecbf79 --- /dev/null +++ b/src/Microsoft.AspNetCore.Razor.Evolution/RazorPreallocatedTagHelperAttributePass.cs @@ -0,0 +1,152 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Linq; +using Microsoft.AspNetCore.Razor.Evolution.Intermediate; + +namespace Microsoft.AspNetCore.Razor.Evolution +{ + internal class RazorPreallocatedTagHelperAttributeOptimizationPass : RazorIRPassBase + { + public override int Order => RazorIRPass.DefaultLoweringOrder; + + public override DocumentIRNode ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument) + { + var walker = new PreallocatedTagHelperWalker(); + walker.VisitDocument(irDocument); + + return irDocument; + } + + internal class PreallocatedTagHelperWalker : RazorIRNodeWalker + { + private const string PreAllocatedAttributeVariablePrefix = "__tagHelperAttribute_"; + + private ClassDeclarationIRNode _classDeclaration; + private int _variableCountOffset; + private int _preallocatedDeclarationCount = 0; + + public override void VisitClass(ClassDeclarationIRNode node) + { + _classDeclaration = node; + _variableCountOffset = node.Children.Count; + + VisitDefault(node); + } + + internal override void VisitAddTagHelperHtmlAttribute(AddTagHelperHtmlAttributeIRNode node) + { + if (node.Children.Count != 1 || !(node.Children.First() is HtmlContentIRNode)) + { + return; + } + + var plainTextValue = (node.Children.First() as HtmlContentIRNode).Content; + DeclarePreallocatedTagHelperHtmlAttributeIRNode declaration = null; + + for (var i = 0; i < _classDeclaration.Children.Count; i++) + { + var current = _classDeclaration.Children[i]; + + if (current is DeclarePreallocatedTagHelperHtmlAttributeIRNode) + { + var existingDeclaration = (DeclarePreallocatedTagHelperHtmlAttributeIRNode)current; + + if (string.Equals(existingDeclaration.Name, node.Name, StringComparison.Ordinal) && + string.Equals(existingDeclaration.Value, plainTextValue, StringComparison.Ordinal) && + existingDeclaration.ValueStyle == node.ValueStyle) + { + declaration = existingDeclaration; + break; + } + } + } + + if (declaration == null) + { + var variableCount = _classDeclaration.Children.Count - _variableCountOffset; + var preAllocatedAttributeVariableName = PreAllocatedAttributeVariablePrefix + variableCount; + declaration = new DeclarePreallocatedTagHelperHtmlAttributeIRNode + { + VariableName = preAllocatedAttributeVariableName, + Name = node.Name, + Value = plainTextValue, + ValueStyle = node.ValueStyle, + Parent = _classDeclaration + }; + _classDeclaration.Children.Insert(_preallocatedDeclarationCount++, declaration); + } + + var addPreAllocatedAttribute = new AddPreallocatedTagHelperHtmlAttributeIRNode + { + VariableName = declaration.VariableName, + Parent = node.Parent + }; + + var nodeIndex = node.Parent.Children.IndexOf(node); + node.Parent.Children[nodeIndex] = addPreAllocatedAttribute; + } + + internal override void VisitSetTagHelperProperty(SetTagHelperPropertyIRNode node) + { + if (!node.Descriptor.IsStringProperty || + node.Children.Count != 1 || + !(node.Children.First() is HtmlContentIRNode)) + { + return; + } + + var plainTextValue = (node.Children.First() as HtmlContentIRNode).Content; + + DeclarePreallocatedTagHelperAttributeIRNode declaration = null; + + for (var i = 0; i < _classDeclaration.Children.Count; i++) + { + var current = _classDeclaration.Children[i]; + + if (current is DeclarePreallocatedTagHelperAttributeIRNode) + { + var existingDeclaration = (DeclarePreallocatedTagHelperAttributeIRNode)current; + + if (string.Equals(existingDeclaration.Name, node.AttributeName, StringComparison.Ordinal) && + string.Equals(existingDeclaration.Value, plainTextValue, StringComparison.Ordinal) && + existingDeclaration.ValueStyle == node.ValueStyle) + { + declaration = existingDeclaration; + break; + } + } + } + + if (declaration == null) + { + var variableCount = _classDeclaration.Children.Count - _variableCountOffset; + var preAllocatedAttributeVariableName = PreAllocatedAttributeVariablePrefix + variableCount; + declaration = new DeclarePreallocatedTagHelperAttributeIRNode + { + VariableName = preAllocatedAttributeVariableName, + Name = node.AttributeName, + Value = plainTextValue, + ValueStyle = node.ValueStyle, + Parent = _classDeclaration + }; + _classDeclaration.Children.Insert(_preallocatedDeclarationCount++, declaration); + } + + var setPreallocatedProperty = new SetPreallocatedTagHelperPropertyIRNode + { + VariableName = declaration.VariableName, + AttributeName = node.AttributeName, + TagHelperTypeName = node.TagHelperTypeName, + PropertyName = node.PropertyName, + Descriptor = node.Descriptor, + Parent = node.Parent + }; + + var nodeIndex = node.Parent.Children.IndexOf(node); + node.Parent.Children[nodeIndex] = setPreallocatedProperty; + } + } + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs index 4c52a9e768..8169ac1ca5 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs @@ -107,11 +107,31 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests WriteContentNode(node, node.AttributeName, node.PropertyName, string.Format("HtmlAttributeValueStyle.{0}", node.ValueStyle)); } + internal override void VisitDeclarePreallocatedTagHelperAttribute(DeclarePreallocatedTagHelperAttributeIRNode node) + { + WriteContentNode(node, node.VariableName, node.Name, node.Value, string.Format("HtmlAttributeValueStyle.{0}", node.ValueStyle)); + } + + internal override void VisitSetPreallocatedTagHelperProperty(SetPreallocatedTagHelperPropertyIRNode node) + { + WriteContentNode(node, node.VariableName, node.AttributeName, node.PropertyName); + } + internal override void VisitAddTagHelperHtmlAttribute(AddTagHelperHtmlAttributeIRNode node) { WriteContentNode(node, node.Name, string.Format("{0}.{1}", nameof(HtmlAttributeValueStyle), node.ValueStyle)); } + internal override void VisitDeclarePreallocatedTagHelperHtmlAttribute(DeclarePreallocatedTagHelperHtmlAttributeIRNode node) + { + WriteContentNode(node, node.VariableName, node.Name, node.Value, string.Format("{0}.{1}", nameof(HtmlAttributeValueStyle), node.ValueStyle)); + } + + internal override void VisitAddPreallocatedTagHelperHtmlAttribute(AddPreallocatedTagHelperHtmlAttributeIRNode node) + { + WriteContentNode(node, node.VariableName); + } + protected void WriteBasicNode(RazorIRNode node) { WriteIndent(); diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TagHelpersIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TagHelpersIntegrationTest.cs index 1c258a2ff2..1a236592aa 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TagHelpersIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TagHelpersIntegrationTest.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Razor.Evolution.Legacy; -using Microsoft.AspNetCore.Testing.xunit; using Xunit; namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs index 1ac61c217e..4857345b2c 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs @@ -203,6 +203,26 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate } } + internal static void DeclarePreallocatedTagHelperAttribute( + RazorIRNode node, + string attributeName, + string value, + HtmlAttributeValueStyle valueStyle) + { + var declarePreallocatedTagHelperAttribute = Assert.IsType(node); + + try + { + Assert.Equal(attributeName, declarePreallocatedTagHelperAttribute.Name); + Assert.Equal(value, declarePreallocatedTagHelperAttribute.Value); + Assert.Equal(valueStyle, declarePreallocatedTagHelperAttribute.ValueStyle); + } + catch (XunitException e) + { + throw new IRAssertException(declarePreallocatedTagHelperAttribute, e.Message); + } + } + internal static void TagHelperStructure(string tagName, TagMode tagMode, RazorIRNode node) { var tagHelperStructureNode = Assert.IsType(node); @@ -238,6 +258,21 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate } } + internal static void SetPreallocatedTagHelperProperty(RazorIRNode node, string attributeName, string propertyName) + { + var setPreallocatedTagHelperProperty = Assert.IsType(node); + + try + { + Assert.Equal(attributeName, setPreallocatedTagHelperProperty.AttributeName); + Assert.Equal(propertyName, setPreallocatedTagHelperProperty.PropertyName); + } + catch (XunitException e) + { + throw new IRAssertException(setPreallocatedTagHelperProperty, e.Message); + } + } + internal static void SetTagHelperProperty( string name, string propertyName, diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/RazorEngineTest.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/RazorEngineTest.cs index 9de42b74ff..15cf61467f 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/RazorEngineTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/RazorEngineTest.cs @@ -140,7 +140,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution feature => Assert.IsType(feature), feature => Assert.IsType(feature), feature => Assert.IsType(feature), - feature => Assert.IsType(feature)); + feature => Assert.IsType(feature), + feature => Assert.IsType(feature)); } private static void AssertDefaultRuntimePhases(IReadOnlyList phases) diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs index a9561ea6a2..0342773530 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs @@ -6,6 +6,9 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("catchAll", new global::Microsoft.AspNetCore.Html.HtmlString("hi"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("btn"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -40,10 +43,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("hi"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("catchAll", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -59,12 +59,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); #line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = true; @@ -88,22 +86,17 @@ __TestNamespace_InputTagHelper2.Checked = true; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); #line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = true; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("hi"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("catchAll", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -116,10 +109,7 @@ __TestNamespace_InputTagHelper2.Checked = true; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("btn"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs index 9af2c9118d..26238024fa 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs @@ -6,6 +6,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -40,12 +42,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); #line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml" __TestNamespace_InputTagHelper2.Checked = true; @@ -64,10 +64,7 @@ __TestNamespace_InputTagHelper2.Checked = true; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello World"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs index fdb535ffa6..07a78091b5 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs @@ -6,6 +6,11 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data", new global::Microsoft.AspNetCore.Html.HtmlString("-delay1000"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-delay", new global::Microsoft.AspNetCore.Html.HtmlString("1000"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -38,10 +43,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("-delay1000"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("data", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -67,12 +69,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles WriteLiteral(" + 1"); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("data-interval", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -88,12 +88,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_2.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_2.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); #line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = true; @@ -112,14 +110,8 @@ __TestNamespace_InputTagHelper2.Checked = true; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello World"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("1000"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("data-delay", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs index 668890e721..fab1b4e82f 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs @@ -6,6 +6,14 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("value", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("placeholder", new global::Microsoft.AspNetCore.Html.HtmlString("Enter in a new time..."), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("unbound", new global::Microsoft.AspNetCore.Html.HtmlString("first value"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("unbound", new global::Microsoft.AspNetCore.Html.HtmlString("second value"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("unbound", new global::Microsoft.AspNetCore.Html.HtmlString("hello"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("unbound", new global::Microsoft.AspNetCore.Html.HtmlString("world"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_7 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("hello"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -60,19 +68,12 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - BeginWriteTagHelperAttribute(); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("value", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("Enter in a new time..."); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("placeholder", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -268,20 +269,14 @@ __TestNamespace_InputTagHelper2.Checked = (@object); ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("first value"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); #line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" __TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("second value"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -299,14 +294,8 @@ __TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("hello"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("world"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); #line 26 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = (DateTimeOffset.Now.Year > 2014); @@ -454,10 +443,7 @@ __TestNamespace_PTagHelper.Age = 123; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("hello"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs index cb5727c4ad..228d0c80eb 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs @@ -6,6 +6,15 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "button", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("TYPE", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("checked", new global::Microsoft.AspNetCore.Html.HtmlString("false"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "button", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("checked", new global::Microsoft.AspNetCore.Html.HtmlString("true"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("checked", new global::Microsoft.AspNetCore.Html.HtmlString("true"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_7 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("AGE", new global::Microsoft.AspNetCore.Html.HtmlString("40"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_8 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("Age", new global::Microsoft.AspNetCore.Html.HtmlString("500"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -40,16 +49,11 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("button"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("TYPE", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -65,26 +69,18 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("button"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); #line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = true; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("false"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("checked", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -100,34 +96,20 @@ __TestNamespace_InputTagHelper2.Checked = true; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("button"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); #line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = true; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("true"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("checked", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("true"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("checked", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -146,14 +128,8 @@ __TestNamespace_PTagHelper.Age = 3; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("40"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("AGE", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("500"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("Age", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs index 236b4dc9b1..46106128f2 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs @@ -6,6 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -41,14 +42,14 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper.Type = __TestNamespace_InputTagHelper.Type; - __TestNamespace_CatchAllTagHelper.Type = __TestNamespace_InputTagHelper.Type; - __TestNamespace_CatchAllTagHelper.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_CatchAllTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_CatchAllTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml" __TestNamespace_InputTagHelper.Checked = true; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs index 54550f54bb..85f17c6913 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs @@ -6,6 +6,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -38,20 +40,17 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); #line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = ; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -69,20 +68,17 @@ __TestNamespace_InputTagHelper2.Checked = ; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); #line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = ; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs index 27b624dc55..de33e6a81c 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs @@ -6,6 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -34,9 +35,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs index d9df4a185a..f76603cc3c 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs @@ -6,6 +6,9 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-delay", new global::Microsoft.AspNetCore.Html.HtmlString("1000"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -57,12 +60,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles WriteLiteral(" + 1"); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("data-interval", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); #line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" __TestNamespace_InputTagHelper2.Checked = true; @@ -88,14 +89,8 @@ __TestNamespace_InputTagHelper2.Checked = true; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello World"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("1000"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("data-delay", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs index 7411074c14..74dfc62e5d 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs @@ -6,6 +6,9 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("value", "Hello", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("text"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("unbound", new global::Microsoft.AspNetCore.Html.HtmlString("foo"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -54,15 +57,9 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __InputTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __InputTagHelper.FooProp = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("value", __InputTagHelper.FooProp, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + __InputTagHelper.FooProp = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -75,10 +72,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __DivTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__DivTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("foo"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs index 2139ba7bf2..f46d4ae081 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs @@ -6,6 +6,13 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("password"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("radio"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("int-prefix-salt", new global::Microsoft.AspNetCore.Html.HtmlString("8"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("string-prefix-grabber", "string", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("string-prefix-paprika", "another string", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("string-prefix-thyme", "string", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -53,10 +60,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("checkbox"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary; @@ -86,10 +90,7 @@ __TestNamespace_InputTagHelper1.StringDictionaryProperty = stringDictionary; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("password"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); #line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary; @@ -130,10 +131,7 @@ __TestNamespace_InputTagHelper1.IntProperty = 42; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("radio"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); #line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" __TestNamespace_InputTagHelper1.IntProperty = 42; @@ -159,26 +157,19 @@ __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"] = 98; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-pepper", __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); __TestNamespace_InputTagHelper2.IntDictionaryProperty["pepper"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"]; - BeginWriteTagHelperAttribute(); - WriteLiteral("8"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("int-prefix-salt", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("string"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper1.StringProperty = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-grabber", __TestNamespace_InputTagHelper1.StringProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - if (__TestNamespace_InputTagHelper2.StringDictionaryProperty == null) + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); + __TestNamespace_InputTagHelper1.StringProperty = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); + __TestNamespace_InputTagHelper2.StringDictionaryProperty["grabber"] = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); + __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"] = (string)__tagHelperAttribute_5.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5); + __TestNamespace_InputTagHelper2.StringDictionaryProperty["paprika"] = (string)__tagHelperAttribute_5.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5); + if (__TestNamespace_InputTagHelper1.StringDictionaryProperty == null) { - throw new InvalidOperationException(FormatInvalidIndexerAssignment("string-prefix-grabber", "TestNamespace.InputTagHelper2", "StringDictionaryProperty")); + throw new InvalidOperationException(FormatInvalidIndexerAssignment("string-prefix-cumin", "TestNamespace.InputTagHelper1", "StringDictionaryProperty")); } - __TestNamespace_InputTagHelper2.StringDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.StringProperty; - BeginWriteTagHelperAttribute(); - WriteLiteral("another string"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"] = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-paprika", __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.StringDictionaryProperty["paprika"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"]; BeginWriteTagHelperAttribute(); WriteLiteral("literate "); #line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" @@ -217,16 +208,10 @@ __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"] = 37; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-value", __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); __TestNamespace_InputTagHelper2.IntDictionaryProperty["value"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"]; - if (__TestNamespace_InputTagHelper1.StringDictionaryProperty == null) - { - throw new InvalidOperationException(FormatInvalidIndexerAssignment("string-prefix-thyme", "TestNamespace.InputTagHelper1", "StringDictionaryProperty")); - } - BeginWriteTagHelperAttribute(); - WriteLiteral("string"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"] = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-thyme", __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"]; + __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"] = (string)__tagHelperAttribute_6.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); + __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"] = (string)__tagHelperAttribute_6.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs index 999de0002f..2a0968eba9 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs @@ -6,6 +6,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("value", "Hello", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("text"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -34,15 +36,9 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __InputTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __InputTagHelper.FooProp = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("value", __InputTagHelper.FooProp, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + __InputTagHelper.FooProp = (string)__tagHelperAttribute_0.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs index ca3dd015cc..636093f9e4 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs @@ -6,6 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -35,10 +36,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello World"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml" __TestNamespace_PTagHelper.Age = 1337; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs index 9613539d6e..e40d79a462 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs @@ -6,6 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -35,10 +36,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello World"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml" __TestNamespace_PTagHelper.Age = 1337; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs index 7a03ceea82..6aee1f4040 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs @@ -6,6 +6,14 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("[item]", new global::Microsoft.AspNetCore.Html.HtmlString("items"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("[(item)]", new global::Microsoft.AspNetCore.Html.HtmlString("items"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("(click)", new global::Microsoft.AspNetCore.Html.HtmlString("doSomething()"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("(^click)", new global::Microsoft.AspNetCore.Html.HtmlString("doSomething()"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("*something", "value", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("*something", new global::Microsoft.AspNetCore.Html.HtmlString("value"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("#local", "value", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_7 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("#local", new global::Microsoft.AspNetCore.Html.HtmlString("value"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -43,10 +51,7 @@ __TestNamespace_CatchAllTagHelper.ListItems = items; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("[item]", __TestNamespace_CatchAllTagHelper.ListItems, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("items"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("[item]", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -69,10 +74,7 @@ __TestNamespace_CatchAllTagHelper.ArrayItems = items; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("[(item)]", __TestNamespace_CatchAllTagHelper.ArrayItems, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("items"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("[(item)]", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -96,10 +98,7 @@ __TestNamespace_CatchAllTagHelper.Event1 = doSomething(); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("(click)", __TestNamespace_CatchAllTagHelper.Event1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("doSomething()"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("(click)", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -123,10 +122,7 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("(^click)", __TestNamespace_CatchAllTagHelper.Event2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("doSomething()"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("(^click)", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -144,15 +140,9 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized); - BeginWriteTagHelperAttribute(); - WriteLiteral("value"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_CatchAllTagHelper.StringProperty1 = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("*something", __TestNamespace_CatchAllTagHelper.StringProperty1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("value"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("*something", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __TestNamespace_CatchAllTagHelper.StringProperty1 = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -188,15 +178,9 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized); - BeginWriteTagHelperAttribute(); - WriteLiteral("value"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_CatchAllTagHelper.StringProperty2 = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("#local", __TestNamespace_CatchAllTagHelper.StringProperty2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("value"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("#local", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __TestNamespace_CatchAllTagHelper.StringProperty2 = (string)__tagHelperAttribute_6.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs index bcbab46182..766de5c51d 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs @@ -6,6 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("text"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -43,10 +44,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __InputTagHelper.BoundProp = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("bound", __InputTagHelper.BoundProp, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs index 8d5d3cc4cf..bf290afa21 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs @@ -6,6 +6,12 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-content", new global::Microsoft.AspNetCore.Html.HtmlString("hello"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-content", new global::Microsoft.AspNetCore.Html.HtmlString("hello2"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "password", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-content", new global::Microsoft.AspNetCore.Html.HtmlString("blah"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -37,10 +43,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("Hello World"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml" __TestNamespace_PTagHelper.Age = 1337; @@ -70,16 +73,11 @@ __TestNamespace_PTagHelper.Age = 1337; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("text"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - BeginWriteTagHelperAttribute(); - WriteLiteral("hello"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_1.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -99,10 +97,7 @@ __TestNamespace_PTagHelper.Age = 1234; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - BeginWriteTagHelperAttribute(); - WriteLiteral("hello2"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -118,16 +113,11 @@ __TestNamespace_PTagHelper.Age = 1234; __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper); __TestNamespace_InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2); - BeginWriteTagHelperAttribute(); - WriteLiteral("password"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer; - __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); - __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - BeginWriteTagHelperAttribute(); - WriteLiteral("blah"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __TestNamespace_InputTagHelper.Type = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); + __TestNamespace_InputTagHelper2.Type = (string)__tagHelperAttribute_4.Value; + __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs index 9794b94796..f83ca377cc 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs @@ -6,6 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles using System.Threading.Tasks; public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes_Runtime { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("test"), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0414 private string __tagHelperStringValueBuffer = null; @@ -93,10 +94,7 @@ __TestNamespace_PTagHelper.Age = 42; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("test"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" __TestNamespace_PTagHelper.Age = 42 + @int; @@ -116,10 +114,7 @@ __TestNamespace_PTagHelper.Age = 42 + @int; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("test"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" __TestNamespace_PTagHelper.Age = int; @@ -139,10 +134,7 @@ __TestNamespace_PTagHelper.Age = int; ); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - BeginWriteTagHelperAttribute(); - WriteLiteral("test"); - __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); - __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); #line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" __TestNamespace_PTagHelper.Age = (@int); diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/NestedTagHelpers.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/NestedTagHelpers.ir.txt index 6cd4ee8a98..ec627b5696 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/NestedTagHelpers.ir.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/NestedTagHelpers.ir.txt @@ -4,6 +4,9 @@ Document - UsingStatement - - System UsingStatement - - System.Threading.Tasks ClassDeclaration - - - - - + DeclarePreallocatedTagHelperAttribute - - __tagHelperAttribute_0 - value - Hello - HtmlAttributeValueStyle.DoubleQuotes + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 - type - text - HtmlAttributeValueStyle.SingleQuotes + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - unbound - foo - HtmlAttributeValueStyle.DoubleQuotes DeclareTagHelperFields - - PTagHelper - FormTagHelper - InputTagHelper RazorMethodDeclaration - - - - - TagHelper - @@ -19,13 +22,10 @@ Document - TagHelper - InitializeTagHelperStructure - - input - TagMode.SelfClosing CreateTagHelper - - InputTagHelper - SetTagHelperProperty - (92:3,17 [5] NestedTagHelpers.cshtml) - value - FooProp - HtmlAttributeValueStyle.DoubleQuotes - HtmlContent - (92:3,17 [5] NestedTagHelpers.cshtml) - Hello - AddTagHelperHtmlAttribute - - type - HtmlAttributeValueStyle.SingleQuotes - HtmlContent - (104:3,29 [4] NestedTagHelpers.cshtml) - text + SetPreallocatedTagHelperProperty - - __tagHelperAttribute_0 - value - FooProp + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 ExecuteTagHelpers - HtmlContent - (112:3,37 [2] NestedTagHelpers.cshtml) - \n CreateTagHelper - - FormTagHelper - AddTagHelperHtmlAttribute - - unbound - HtmlAttributeValueStyle.DoubleQuotes - HtmlContent - (68:2,15 [3] NestedTagHelpers.cshtml) - foo + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 ExecuteTagHelpers - diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/SimpleTagHelpers.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/SimpleTagHelpers.ir.txt index b44130b996..d919013777 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/SimpleTagHelpers.ir.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/SimpleTagHelpers.ir.txt @@ -4,15 +4,15 @@ Document - UsingStatement - - System UsingStatement - - System.Threading.Tasks ClassDeclaration - - - - - + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 - value - Hello - HtmlAttributeValueStyle.SingleQuotes + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 - type - text - HtmlAttributeValueStyle.SingleQuotes DeclareTagHelperFields - - InputTagHelper RazorMethodDeclaration - - - - - HtmlContent - (31:1,0 [25] SimpleTagHelpers.cshtml) -

Hola

\n
\n TagHelper - InitializeTagHelperStructure - - input - TagMode.SelfClosing CreateTagHelper - - InputTagHelper - AddTagHelperHtmlAttribute - - value - HtmlAttributeValueStyle.SingleQuotes - HtmlContent - (70:3,18 [5] SimpleTagHelpers.cshtml) - Hello - AddTagHelperHtmlAttribute - - type - HtmlAttributeValueStyle.SingleQuotes - HtmlContent - (83:3,31 [4] SimpleTagHelpers.cshtml) - text + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 ExecuteTagHelpers - HtmlContent - (91:3,39 [9] SimpleTagHelpers.cshtml) - \n
diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/TagHelpersWithBoundAttributes.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/TagHelpersWithBoundAttributes.ir.txt index 2d043cee49..1dc2ca0a3c 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/TagHelpersWithBoundAttributes.ir.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/TagHelpersIntegrationTest/TagHelpersWithBoundAttributes.ir.txt @@ -4,6 +4,7 @@ Document - UsingStatement - - System UsingStatement - - System.Threading.Tasks ClassDeclaration - - - - - + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 - type - text - HtmlAttributeValueStyle.SingleQuotes DeclareTagHelperFields - - InputTagHelper RazorMethodDeclaration - - - - - HtmlContent - (31:1,0 [12] TagHelpersWithBoundAttributes.cshtml) -
\n @@ -13,7 +14,6 @@ Document - SetTagHelperProperty - (56:2,17 [6] TagHelpersWithBoundAttributes.cshtml) - bound - FooProp - HtmlAttributeValueStyle.DoubleQuotes CSharpExpression - (57:2,18 [5] TagHelpersWithBoundAttributes.cshtml) CSharpToken - (57:2,18 [5] TagHelpersWithBoundAttributes.cshtml) - Hello - AddTagHelperHtmlAttribute - - type - HtmlAttributeValueStyle.SingleQuotes - HtmlContent - (69:2,30 [4] TagHelpersWithBoundAttributes.cshtml) - text + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 ExecuteTagHelpers - HtmlContent - (77:2,38 [9] TagHelpersWithBoundAttributes.cshtml) - \n