diff --git a/src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs index 27667fb473..39998465c9 100644 --- a/src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs @@ -4,7 +4,7 @@ using System; using System.Linq; using Microsoft.AspNet.Razor.TagHelpers; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Test.Internal { diff --git a/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs index 0e98a78b88..3c1d4e077f 100644 --- a/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Razor.TagHelpers; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Test.Internal { diff --git a/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs index 3620410619..bad86ef822 100644 --- a/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Razor.TagHelpers; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Test.Internal { diff --git a/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs index 2dd58ba12d..3de87a6ead 100644 --- a/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Razor.TagHelpers; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Test.Internal { diff --git a/src/Microsoft.AspNet.Razor/Chunks/Generators/AttributeBlockChunkGenerator.cs b/src/Microsoft.AspNet.Razor/Chunks/Generators/AttributeBlockChunkGenerator.cs index 16fd47b249..5ee0e242e3 100644 --- a/src/Microsoft.AspNet.Razor/Chunks/Generators/AttributeBlockChunkGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Chunks/Generators/AttributeBlockChunkGenerator.cs @@ -5,7 +5,7 @@ using System; using System.Globalization; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Text; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Chunks.Generators { diff --git a/src/Microsoft.AspNet.Razor/Chunks/Generators/LiteralAttributeChunkGenerator.cs b/src/Microsoft.AspNet.Razor/Chunks/Generators/LiteralAttributeChunkGenerator.cs index 4dd9ad81e0..343b25dd51 100644 --- a/src/Microsoft.AspNet.Razor/Chunks/Generators/LiteralAttributeChunkGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Chunks/Generators/LiteralAttributeChunkGenerator.cs @@ -4,7 +4,7 @@ using System.Globalization; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Text; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Chunks.Generators { diff --git a/src/Microsoft.AspNet.Razor/CodeGenerators/GeneratedClassContext.cs b/src/Microsoft.AspNet.Razor/CodeGenerators/GeneratedClassContext.cs index f0cc2a3c0b..ab3d4be31b 100644 --- a/src/Microsoft.AspNet.Razor/CodeGenerators/GeneratedClassContext.cs +++ b/src/Microsoft.AspNet.Razor/CodeGenerators/GeneratedClassContext.cs @@ -4,7 +4,6 @@ using System; using System.Diagnostics.CodeAnalysis; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor.CodeGenerators { diff --git a/src/Microsoft.AspNet.Razor/CodeGenerators/LineMapping.cs b/src/Microsoft.AspNet.Razor/CodeGenerators/LineMapping.cs index 011d0fdd51..120c1fca12 100644 --- a/src/Microsoft.AspNet.Razor/CodeGenerators/LineMapping.cs +++ b/src/Microsoft.AspNet.Razor/CodeGenerators/LineMapping.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Globalization; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.CodeGenerators { diff --git a/src/Microsoft.AspNet.Razor/CodeGenerators/MappingLocation.cs b/src/Microsoft.AspNet.Razor/CodeGenerators/MappingLocation.cs index 3150f45d72..a8c6a561d8 100644 --- a/src/Microsoft.AspNet.Razor/CodeGenerators/MappingLocation.cs +++ b/src/Microsoft.AspNet.Razor/CodeGenerators/MappingLocation.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Globalization; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.CodeGenerators { diff --git a/src/Microsoft.AspNet.Razor/Common/HashCodeCombiner.cs b/src/Microsoft.AspNet.Razor/Common/HashCodeCombiner.cs deleted file mode 100644 index 224dddc4e1..0000000000 --- a/src/Microsoft.AspNet.Razor/Common/HashCodeCombiner.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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; -using System.Collections.Generic; - -namespace Microsoft.Internal.Web.Utils -{ - public class HashCodeCombiner - { - private long _combinedHash64 = 0x1505L; - - public int CombinedHash - { - get { return _combinedHash64.GetHashCode(); } - } - - public HashCodeCombiner Add(IEnumerable e) - { - if (e == null) - { - Add(0); - } - else - { - var count = 0; - foreach (object o in e) - { - Add(o); - count++; - } - Add(count); - } - return this; - } - - public HashCodeCombiner Add(int i) - { - _combinedHash64 = ((_combinedHash64 << 5) + _combinedHash64) ^ i; - return this; - } - - public HashCodeCombiner Add(object o) - { - var hashCode = (o != null) ? o.GetHashCode() : 0; - Add(hashCode); - return this; - } - - public HashCodeCombiner Add(TValue value, IEqualityComparer comparer) - { - var hashCode = value != null ? comparer.GetHashCode(value) : 0; - return Add(hashCode); - } - - public static HashCodeCombiner Start() - { - return new HashCodeCombiner(); - } - } -} diff --git a/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs index 2ed49e0136..252f43db8c 100644 --- a/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs @@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Parser.SyntaxTree { diff --git a/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs index e9e4f1345c..d979ee0329 100644 --- a/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs @@ -12,7 +12,7 @@ using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Editor { diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs index a03f359187..894dd246b1 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs @@ -8,7 +8,7 @@ using System.Globalization; using System.Linq; using Microsoft.AspNet.Razor.Chunks.Generators; using Microsoft.AspNet.Razor.Text; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Parser.SyntaxTree { diff --git a/src/Microsoft.AspNet.Razor/Parser/TagHelpers/TagHelperBlock.cs b/src/Microsoft.AspNet.Razor/Parser/TagHelpers/TagHelperBlock.cs index 5a43a26d04..feacf85a53 100644 --- a/src/Microsoft.AspNet.Razor/Parser/TagHelpers/TagHelperBlock.cs +++ b/src/Microsoft.AspNet.Razor/Parser/TagHelpers/TagHelperBlock.cs @@ -7,7 +7,7 @@ using System.Globalization; using System.Linq; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.TagHelpers; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Parser.TagHelpers { diff --git a/src/Microsoft.AspNet.Razor/RazorError.cs b/src/Microsoft.AspNet.Razor/RazorError.cs index 6f5118e4d6..2032aa9264 100644 --- a/src/Microsoft.AspNet.Razor/RazorError.cs +++ b/src/Microsoft.AspNet.Razor/RazorError.cs @@ -3,7 +3,7 @@ using System; using System.Globalization; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor { diff --git a/src/Microsoft.AspNet.Razor/SourceLocation.cs b/src/Microsoft.AspNet.Razor/SourceLocation.cs index ffeff0d04e..d779dfc3c7 100644 --- a/src/Microsoft.AspNet.Razor/SourceLocation.cs +++ b/src/Microsoft.AspNet.Razor/SourceLocation.cs @@ -5,7 +5,6 @@ using System; using System.Globalization; using Microsoft.AspNet.Razor.Text; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor { diff --git a/src/Microsoft.AspNet.Razor/TagHelpers/TagHelperDescriptorComparer.cs b/src/Microsoft.AspNet.Razor/TagHelpers/TagHelperDescriptorComparer.cs index 3cee0606b9..3c8092decd 100644 --- a/src/Microsoft.AspNet.Razor/TagHelpers/TagHelperDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor/TagHelpers/TagHelperDescriptorComparer.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor.TagHelpers { diff --git a/src/Microsoft.AspNet.Razor/TagHelpers/TypeBasedTagHelperDescriptorComparer.cs b/src/Microsoft.AspNet.Razor/TagHelpers/TypeBasedTagHelperDescriptorComparer.cs index bd0efdc0fa..6de545ac14 100644 --- a/src/Microsoft.AspNet.Razor/TagHelpers/TypeBasedTagHelperDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor/TagHelpers/TypeBasedTagHelperDescriptorComparer.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor.TagHelpers { diff --git a/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs b/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs index 8e02084175..4bb3d3ee4d 100644 --- a/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs +++ b/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs @@ -5,7 +5,6 @@ using System; using System.Diagnostics; using System.Globalization; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor.Text { @@ -79,7 +78,7 @@ namespace Microsoft.AspNet.Razor.Text public static implicit operator TValue(LocationTagged value) { - return value.Value; + return value == null ? default(TValue) : value.Value; } public static bool operator ==(LocationTagged left, LocationTagged right) diff --git a/src/Microsoft.AspNet.Razor/Text/TextChange.cs b/src/Microsoft.AspNet.Razor/Text/TextChange.cs index 1571fd46b5..59444192e5 100644 --- a/src/Microsoft.AspNet.Razor/Text/TextChange.cs +++ b/src/Microsoft.AspNet.Razor/Text/TextChange.cs @@ -7,7 +7,6 @@ using System.Globalization; using System.Text; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor.Text { diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs index cc96f199f1..6d24a81f2a 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.Framework.Internal; -using Microsoft.Internal.Web.Utils; namespace Microsoft.AspNet.Razor.Tokenizer.Symbols { diff --git a/src/Microsoft.AspNet.Razor/project.json b/src/Microsoft.AspNet.Razor/project.json index 14e5ed37c3..0b5da8fdbd 100644 --- a/src/Microsoft.AspNet.Razor/project.json +++ b/src/Microsoft.AspNet.Razor/project.json @@ -6,6 +6,10 @@ "url": "git://github.com/aspnet/razor" }, "dependencies": { + "Microsoft.Framework.HashCodeCombiner.Sources": { + "type": "build", + "version": "1.0.0-*" + }, "Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" diff --git a/test/Microsoft.AspNet.Razor.Test/CodeGenerators/TestSpan.cs b/test/Microsoft.AspNet.Razor.Test/CodeGenerators/TestSpan.cs index abfaa669bb..49e932fc15 100644 --- a/test/Microsoft.AspNet.Razor.Test/CodeGenerators/TestSpan.cs +++ b/test/Microsoft.AspNet.Razor.Test/CodeGenerators/TestSpan.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Razor.Test.Generator { diff --git a/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs b/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs index 462928c08f..4f678da209 100644 --- a/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs @@ -8,7 +8,7 @@ using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.TagHelpers; using Microsoft.AspNet.Razor.Test.Framework; -using Microsoft.Internal.Web.Utils; +using Microsoft.Framework.Internal; #if !DNXCORE50 using Moq; #endif