Transition `HashCodeCombiner` to use the `aspnet/Common` variation.
- Updated `LocationTagged<TValue>` to handle `null` implicit values. - Removed `InternalsVisibleTo` declaration on `Microsoft.AspNet.Razor` to the runtime test project. - Updated `TagHelperDescriptor` tests to utilize helper methods to construct `TagHelperDescriptor`s. This was needed since the `InternalsVisibleTo` declaration was removed. #449
This commit is contained in:
parent
b66da76c5c
commit
e722f90481
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
using Microsoft.AspNet.Razor.TagHelpers;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Test.Internal
|
namespace Microsoft.AspNet.Razor.Test.Internal
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
using Microsoft.AspNet.Razor.TagHelpers;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Test.Internal
|
namespace Microsoft.AspNet.Razor.Test.Internal
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
using Microsoft.AspNet.Razor.TagHelpers;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Test.Internal
|
namespace Microsoft.AspNet.Razor.Test.Internal
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
using Microsoft.AspNet.Razor.TagHelpers;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Test.Internal
|
namespace Microsoft.AspNet.Razor.Test.Internal
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Chunks.Generators
|
namespace Microsoft.AspNet.Razor.Chunks.Generators
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Chunks.Generators
|
namespace Microsoft.AspNet.Razor.Chunks.Generators
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.CodeGenerators
|
namespace Microsoft.AspNet.Razor.CodeGenerators
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.CodeGenerators
|
namespace Microsoft.AspNet.Razor.CodeGenerators
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.CodeGenerators
|
namespace Microsoft.AspNet.Razor.CodeGenerators
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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>(TValue value, IEqualityComparer<TValue> comparer)
|
|
||||||
{
|
|
||||||
var hashCode = value != null ? comparer.GetHashCode(value) : 0;
|
|
||||||
return Add(hashCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HashCodeCombiner Start()
|
|
||||||
{
|
|
||||||
return new HashCodeCombiner();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||||
using Microsoft.AspNet.Razor.Editor;
|
using Microsoft.AspNet.Razor.Editor;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Parser.SyntaxTree
|
namespace Microsoft.AspNet.Razor.Parser.SyntaxTree
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ using Microsoft.AspNet.Razor.Parser;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Editor
|
namespace Microsoft.AspNet.Razor.Editor
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.AspNet.Razor.Chunks.Generators;
|
using Microsoft.AspNet.Razor.Chunks.Generators;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Parser.SyntaxTree
|
namespace Microsoft.AspNet.Razor.Parser.SyntaxTree
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
using Microsoft.AspNet.Razor.TagHelpers;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor
|
namespace Microsoft.AspNet.Razor
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor
|
namespace Microsoft.AspNet.Razor
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.TagHelpers
|
namespace Microsoft.AspNet.Razor.TagHelpers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.TagHelpers
|
namespace Microsoft.AspNet.Razor.TagHelpers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Text
|
namespace Microsoft.AspNet.Razor.Text
|
||||||
{
|
{
|
||||||
|
|
@ -79,7 +78,7 @@ namespace Microsoft.AspNet.Razor.Text
|
||||||
|
|
||||||
public static implicit operator TValue(LocationTagged<TValue> value)
|
public static implicit operator TValue(LocationTagged<TValue> value)
|
||||||
{
|
{
|
||||||
return value.Value;
|
return value == null ? default(TValue) : value.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool operator ==(LocationTagged<TValue> left, LocationTagged<TValue> right)
|
public static bool operator ==(LocationTagged<TValue> left, LocationTagged<TValue> right)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Text
|
namespace Microsoft.AspNet.Razor.Text
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.Framework.Internal;
|
using Microsoft.Framework.Internal;
|
||||||
using Microsoft.Internal.Web.Utils;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Tokenizer.Symbols
|
namespace Microsoft.AspNet.Razor.Tokenizer.Symbols
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
"url": "git://github.com/aspnet/razor"
|
"url": "git://github.com/aspnet/razor"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"Microsoft.Framework.HashCodeCombiner.Sources": {
|
||||||
|
"type": "build",
|
||||||
|
"version": "1.0.0-*"
|
||||||
|
},
|
||||||
"Microsoft.Framework.NotNullAttribute.Sources": {
|
"Microsoft.Framework.NotNullAttribute.Sources": {
|
||||||
"type": "build",
|
"type": "build",
|
||||||
"version": "1.0.0-*"
|
"version": "1.0.0-*"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// 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.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Razor.Test.Generator
|
namespace Microsoft.AspNet.Razor.Test.Generator
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using Microsoft.AspNet.Razor.Parser;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
using Microsoft.AspNet.Razor.Parser.TagHelpers;
|
using Microsoft.AspNet.Razor.Parser.TagHelpers;
|
||||||
using Microsoft.AspNet.Razor.Test.Framework;
|
using Microsoft.AspNet.Razor.Test.Framework;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Framework.Internal;
|
||||||
#if !DNXCORE50
|
#if !DNXCORE50
|
||||||
using Moq;
|
using Moq;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue