| 1 |
// Licensed to the .NET Foundation under one or more agreements. |
| 2 |
// The .NET Foundation licenses this file to you under the MIT license. |
| 3 |
// See the LICENSE file in the project root for more information. |
| 4 |
|
| 5 |
using Xunit; |
| 6 |
|
| 7 |
namespace System.Reflection.Emit.Tests |
| 8 |
{ |
| 9 |
public class ConstructorBuilderInitLocals |
| 10 |
{ |
| 11 |
[Fact] |
| 12 |
public void InitLocals() |
| 13 |
{ |
| 14 |
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); |
| 15 |
Type[] parameterTypes = new Type[] { typeof(int), typeof(double) }; |
| 16 |
|
| 17 |
ConstructorBuilder constructor = type.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, parameterTypes, null, null); |
| 18 |
Assert.True(constructor.InitLocals); |
| 19 |
|
| 20 |
constructor.InitLocals = false; |
| 21 |
Assert.False(constructor.InitLocals); |
| 22 |
} |
| 23 |
} |
| 24 |
} |