Update codegen to be compatible with MVC
This commit is contained in:
parent
25831260f7
commit
93981ab13e
|
|
@ -28,8 +28,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
|
||||
private static void AddInstrumentation(InstrumentationItem item)
|
||||
{
|
||||
var beginContextMethodName = "Instrumentation.BeginContext"; /* ORIGINAL: BeginContextMethodName */
|
||||
var endContextMethodName = "Instrumentation.EndContext"; /* ORIGINAL: EndContextMethodName */
|
||||
var beginContextMethodName = "BeginContext"; /* ORIGINAL: BeginContextMethodName */
|
||||
var endContextMethodName = "EndContext"; /* ORIGINAL: EndContextMethodName */
|
||||
|
||||
var beginNode = new CSharpStatementIRNode()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
try
|
||||
{
|
||||
var beginNode = Assert.IsType<CSharpStatementIRNode>(node);
|
||||
Assert.Equal($"Instrumentation.BeginContext({expected});", beginNode.Content);
|
||||
Assert.Equal($"BeginContext({expected});", beginNode.Content);
|
||||
}
|
||||
catch (XunitException e)
|
||||
{
|
||||
|
|
@ -232,7 +232,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
try
|
||||
{
|
||||
var endNode = Assert.IsType<CSharpStatementIRNode>(node);
|
||||
Assert.Equal("Instrumentation.EndContext();", endNode.Content);
|
||||
Assert.Equal("EndContext();", endNode.Content);
|
||||
}
|
||||
catch (XunitException e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,23 +32,23 @@ namespace
|
|||
#pragma warning disable 1998
|
||||
()
|
||||
{
|
||||
Instrumentation.BeginContext(31, 28, true);
|
||||
BeginContext(31, 28, true);
|
||||
WriteLiteral("<span someattr>Hola</span>\r\n");
|
||||
Instrumentation.EndContext();
|
||||
Instrumentation.BeginContext(61, 7, false);
|
||||
EndContext();
|
||||
BeginContext(61, 7, false);
|
||||
#line 3 "TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.cshtml"
|
||||
Write("Hello");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
Instrumentation.EndContext();
|
||||
Instrumentation.BeginContext(69, 2, true);
|
||||
EndContext();
|
||||
BeginContext(69, 2, true);
|
||||
WriteLiteral("\r\n");
|
||||
Instrumentation.EndContext();
|
||||
EndContext();
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
Instrumentation.BeginContext(91, 6, true);
|
||||
BeginContext(91, 6, true);
|
||||
WriteLiteral("\r\n ");
|
||||
Instrumentation.EndContext();
|
||||
EndContext();
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
|
|
@ -57,7 +57,7 @@ Write("Hello");
|
|||
__InputTagHelper.FooProp = (string)__tagHelperAttribute_0.Value;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
|
||||
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
|
||||
Instrumentation.BeginContext(97, 33, false);
|
||||
BeginContext(97, 33, false);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
|
|
@ -65,16 +65,16 @@ Write("Hello");
|
|||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
Instrumentation.EndContext();
|
||||
Instrumentation.BeginContext(130, 2, true);
|
||||
EndContext();
|
||||
BeginContext(130, 2, true);
|
||||
WriteLiteral("\r\n");
|
||||
Instrumentation.EndContext();
|
||||
EndContext();
|
||||
}
|
||||
);
|
||||
__FormTagHelper = CreateTagHelper<global::FormTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__FormTagHelper);
|
||||
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
|
||||
Instrumentation.BeginContext(71, 68, false);
|
||||
BeginContext(71, 68, false);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
|
|
@ -82,7 +82,7 @@ Write("Hello");
|
|||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
Instrumentation.EndContext();
|
||||
EndContext();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,34 +9,34 @@ Document -
|
|||
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - unbound - foo - HtmlAttributeValueStyle.DoubleQuotes
|
||||
DeclareTagHelperFields - - FormTagHelper - InputTagHelper
|
||||
RazorMethodDeclaration - - - - -
|
||||
CSharpStatement - - Instrumentation.BeginContext(31, 28, true);
|
||||
CSharpStatement - - BeginContext(31, 28, true);
|
||||
HtmlContent - (31:1,0 [28] BasicTest.cshtml) - <span someattr>Hola</span>\n
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - Instrumentation.BeginContext(61, 7, false);
|
||||
CSharpStatement - - EndContext();
|
||||
CSharpStatement - - BeginContext(61, 7, false);
|
||||
CSharpExpression - (61:2,2 [7] BasicTest.cshtml)
|
||||
CSharpToken - (61:2,2 [7] BasicTest.cshtml) - "Hello"
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - Instrumentation.BeginContext(69, 2, true);
|
||||
CSharpStatement - - EndContext();
|
||||
CSharpStatement - - BeginContext(69, 2, true);
|
||||
HtmlContent - (69:2,10 [2] BasicTest.cshtml) - \n
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - EndContext();
|
||||
TagHelper - (71:3,0 [68] BasicTest.cshtml)
|
||||
InitializeTagHelperStructure - - form - TagMode.StartTagAndEndTag
|
||||
CSharpStatement - - Instrumentation.BeginContext(91, 6, true);
|
||||
CSharpStatement - - BeginContext(91, 6, true);
|
||||
HtmlContent - (91:3,20 [6] BasicTest.cshtml) - \n
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - EndContext();
|
||||
TagHelper - (97:4,4 [33] BasicTest.cshtml)
|
||||
InitializeTagHelperStructure - - input - TagMode.SelfClosing
|
||||
CreateTagHelper - - InputTagHelper
|
||||
SetPreallocatedTagHelperProperty - - __tagHelperAttribute_0 - value - FooProp
|
||||
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1
|
||||
CSharpStatement - - Instrumentation.BeginContext(97, 33, false);
|
||||
CSharpStatement - - BeginContext(97, 33, false);
|
||||
ExecuteTagHelpers -
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - Instrumentation.BeginContext(130, 2, true);
|
||||
CSharpStatement - - EndContext();
|
||||
CSharpStatement - - BeginContext(130, 2, true);
|
||||
HtmlContent - (130:4,37 [2] BasicTest.cshtml) - \n
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - EndContext();
|
||||
CreateTagHelper - - FormTagHelper
|
||||
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2
|
||||
CSharpStatement - - Instrumentation.BeginContext(71, 68, false);
|
||||
CSharpStatement - - BeginContext(71, 68, false);
|
||||
ExecuteTagHelpers -
|
||||
CSharpStatement - - Instrumentation.EndContext();
|
||||
CSharpStatement - - EndContext();
|
||||
|
|
|
|||
Loading…
Reference in New Issue