From 9584c7e34f18d8aed968c5e03a6f160e0f921cf6 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 14 Aug 2019 12:49:01 -0700 Subject: [PATCH] Revert "Fix a bug with ref and declaration phase" This reverts commit dotnet/aspnetcore-tooling@09b50151ef3f15ed05f5e8efc68e540a6781704e. # Conflicts: # src/Razor/test/RazorLanguage.Test/IntegrationTests/ComponentDeclarationIntegrationTest.cs \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/c0e934ed7c0ee90f78f1966c8f40d34af5e54900 --- .../src/Extensions/EliminateMethodBodyPass.cs | 4 ++-- .../ComponentDeclarationIntegrationTest.cs | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs index c14950aae5..96d336ca72 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs @@ -8,8 +8,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions { internal sealed class EliminateMethodBodyPass : IntermediateNodePassBase, IRazorOptimizationPass { - // Run late in the optimization phase - public override int Order => int.MaxValue; + // Run early in the optimization phase + public override int Order => int.MinValue; protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs index 2e2d33795b..e9b8583cd4 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs @@ -70,21 +70,6 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests Assert.Same(typeof(StringBuilder), property.PropertyType); } - [Fact] - public void DeclarationConfiguration_IncludesRef() - { - // Arrange & Act - var component = CompileToComponent(@" -@using System.Text -
-"); - - // Assert - var field = component.GetType().GetField("myDiv", BindingFlags.NonPublic | BindingFlags.Instance); - Assert.NotNull(field); - Assert.Same(typeof(ElementReference), field.FieldType); - } - [Fact] public void DeclarationConfiguration_IncludesInherits() {