Removing Activator.CreateInstance call from CodeTreeBuilder
This commit is contained in:
parent
489caed17c
commit
658eed4c0f
|
|
@ -125,14 +125,14 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
|
||||||
}, association, topLevel: true);
|
}, association, topLevel: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T StartChunkBlock<T>(SyntaxTreeNode association) where T : ChunkBlock
|
public T StartChunkBlock<T>(SyntaxTreeNode association) where T : ChunkBlock, new()
|
||||||
{
|
{
|
||||||
return StartChunkBlock<T>(association, topLevel: false);
|
return StartChunkBlock<T>(association, topLevel: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T StartChunkBlock<T>(SyntaxTreeNode association, bool topLevel) where T : ChunkBlock
|
public T StartChunkBlock<T>(SyntaxTreeNode association, bool topLevel) where T : ChunkBlock, new()
|
||||||
{
|
{
|
||||||
T chunk = (T)Activator.CreateInstance(typeof(T));
|
var chunk = new T();
|
||||||
|
|
||||||
AddChunk(chunk, association, topLevel);
|
AddChunk(chunk, association, topLevel);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue