Skip to content

Commit 0dd75c4

Browse files
committed
Target netstandard 2.0
1 parent 341f126 commit 0dd75c4

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

SourceMaps.StackTraces/SourceMaps.StackTraces.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

SourceMaps.StackTraces/StackTrace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal void Append(StackFrame frame)
1212

1313
public override string ToString()
1414
{
15-
return string.Join('\n', Frames.Select(frame => frame.ToString()));
15+
return string.Join("\n", Frames.Select(frame => frame.ToString()));
1616
}
1717
}
1818
}

SourceMaps/SourceMapMappingEntry.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ public SourceMapMappingEntry(SourcePosition generatedSourcePosition, SourcePosit
1919

2020
public bool Equals(SourceMapMappingEntry other)
2121
{
22-
return GeneratedSourcePosition.Equals(other.GeneratedSourcePosition) &&
23-
OriginalSourcePosition.Equals(other.OriginalSourcePosition) &&
24-
OriginalName == other.OriginalName &&
25-
OriginalFileName == other.OriginalFileName;
22+
return GeneratedSourcePosition.Equals(other.GeneratedSourcePosition) && OriginalSourcePosition.Equals(other.OriginalSourcePosition) && OriginalName == other.OriginalName && OriginalFileName == other.OriginalFileName;
2623
}
2724

2825
public override bool Equals(object obj)
@@ -32,7 +29,14 @@ public override bool Equals(object obj)
3229

3330
public override int GetHashCode()
3431
{
35-
return HashCode.Combine(GeneratedSourcePosition, OriginalSourcePosition, OriginalName, OriginalFileName);
32+
unchecked
33+
{
34+
var hashCode = GeneratedSourcePosition.GetHashCode();
35+
hashCode = (hashCode * 397) ^ OriginalSourcePosition.GetHashCode();
36+
hashCode = (hashCode * 397) ^ (OriginalName != null ? OriginalName.GetHashCode() : 0);
37+
hashCode = (hashCode * 397) ^ (OriginalFileName != null ? OriginalFileName.GetHashCode() : 0);
38+
return hashCode;
39+
}
3640
}
3741
}
3842
}

SourceMaps/SourceMapParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static SourceMap Parse(string sourceMapString)
1212
{
1313
var sourceMap = JsonSerializer.Deserialize<SourceMap>(sourceMapString);
1414
if (!string.IsNullOrEmpty(sourceMap.SourceRoot))
15-
sourceMap.Sources = sourceMap.Sources.Select(source => Path.Join(sourceMap.SourceRoot, source)).ToList();
15+
sourceMap.Sources = sourceMap.Sources.Select(source => Path.Combine(sourceMap.SourceRoot, source)).ToList();
1616
sourceMap.ParsedMappings = ParseMappings(sourceMap.Mappings, sourceMap.Names, sourceMap.Sources);
1717
return sourceMap;
1818
}
@@ -28,7 +28,7 @@ internal static List<SourceMapMappingEntry> ParseMappings(string mappings, List<
2828
state.GeneratedLineNumber = lineNumber;
2929
state.GeneratedColumnNumber = 0;
3030

31-
var segments = lines[lineNumber].Split(',', StringSplitOptions.RemoveEmptyEntries);
31+
var segments = lines[lineNumber].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
3232
foreach (var segment in segments)
3333
{
3434
ApplyMappingSegment(Base64Vlq.Decode(segment), ref state);

SourceMaps/SourceMaps.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

SourceMaps/SourcePosition.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public override bool Equals(object obj)
3232

3333
public override int GetHashCode()
3434
{
35-
return HashCode.Combine(LineNumber, ColumnNumber);
35+
unchecked
36+
{
37+
return (LineNumber * 397) ^ ColumnNumber;
38+
}
3639
}
3740
}
3841
}

0 commit comments

Comments
 (0)