to signal usage from a compiler. On 2.0 profile, perform argument
check for access. Use AssemblyFlags passed in through AssemblyName
arguments. Modified SetCustomAttribute to only use the Assembly*
attribute for constructing the assembly name when used in compiler
context. Fixes corlib part of bug #354970.
* AppDomainTest.cs: Added DefineDynamicAssembly tests for invalid
AssemblyBuilderAccess argument. Enabled test for DefineDynamicAssembly
overload taking IEnumerable<CustomAttributeBuilder>. Fixed typo in
comments.
* AssemblyBuilderTest.cs: Enabled test for bug #354970.
svn path=/trunk/mcs/; revision=93490
* TypeBuilder.cs (GetConstructorImpl): Add back the code removed by the last
patch since it is needed when building mscorlib.
svn path=/trunk/mcs/; revision=93180
type. Original implementation did not take into account the binding
flags and failed with a NotSupportedException if the default binder
checked if a ParamArrayAttribute was defined. It also does not make
sense to return a ConstructorBuilder once the type is emitted.
(GetConstructors): When the type is emitted, use GetConstructors
on the created type.
(GetFields): Removed duplicate code.
(GetMethodsByName): Fixed matching of methods in the parent class
depending on their accessibility:
- Private: never include private methods of parent
- Public: ignore if Public flag is not set
- Assembly: ignore if NonPublic is not set or when on the 1.0 profile
- Rest (Family, FamANDAssem, FamORAssem): ignore if NonPublic flag is
not set
Static methods of the parent are ignored unless the FlattenHierarchy
flag is set.
(GetProperties): When the type is emitted, use GetProperties on the
created type as the TypeBuilder implementation itself does not include
properties from the parent class.
* TypeBuilderTest.cs: Enabled tests for bug #322762.
svn path=/trunk/mcs/; revision=93080
as well.
* AssemblyBuilderTest.cs: Improved existing AssemblyName related tests.
Enabled AssemblyName tests that previously failed.
* AssemblyNameCas.cs: Sync test methods with AssemblyNameTest.cs.
* AssemblyNameTest.cs: Removed AssertEqualsByteArrays method since
NUnit supports this out-of-the-box. Use more meaningful names for
some existing tests. Improved existing tests and added lots more.
Enabled tests that were previously failing. Fixed and improved
tests for public key; the original "public key" was actually a
key pair.
* AssemblyName.cs: Fixed default value for ProcessorArchitecture to
match MS. On 2.0 profile, return zero-length in FullName is no name
is set, and throw a SecurityException in FullName and GetPublicKeyToken
if a public key is set with no corresponding public key token.
Fixed FullName to also include PublicKeyToken spec with "null" value
if public key is empty byte array. Fixed corlib part of bug #351057.
In SetPublicKey, modify Flags accordingly. On the 2.0 profile, verify
the public key when the public key token is computed.
svn path=/trunk/mcs/; revision=92314
* MethodBuilder.cs : implemented ContainsGenericParameters().
* GenericTypeParameterBuilder.cs : removed most of extra members
and added missing members for 2.0 API.
svn path=/trunk/mcs/; revision=89964
* SignatureHelper.cs: Preparational tasks to support the
AddArgument overloads that allow the specification of modopts and
modreqs.
Refactor code, add new parameters.
svn path=/trunk/mcs/; revision=89871
* SignatureHelper.cs (AddArguments): Add new 2.0 API, used by
new versions of the DLR. Currently does not have support for
modreq, modopts. Just a simple wrapper as consumed by the DLR.
svn path=/trunk/mcs/; revision=89856
* AssemblyBuilderTest.cs: Added test for ManifestModule. Added missing
Test attributes. Avoid using ExpectedException, thereby improving lots
of existing tests. Uncomment test that checks max length of dynamic
module name and removed LAMESPEC, since MS implements the described
behavior (but we don't, so mark it NotWorking). Code formatting.
* TypeBuilderTest.cs: Removed unused variables.
* AssemblyBuilder.cs: Added missing paramname to ArgumentExceptions.
Use String.Length to check for zero-length string.
svn path=/trunk/mcs/; revision=86236
TestGetProperties(Flags)Incomplete and TestGetMethods(Flags)Incomplete
ests. Improved TestGetMethodsComplete test.
* TypeBuilder.cs: Do not include static methods of base class in
GetMethod(s). Fixes bug #327482.
svn path=/trunk/mcs/; revision=86211
2007-08-17 Rolf Bjarne Kvinge <[email protected]>
* ILGenerator.cs: Change BeginCatchBlock to end the current filter block if called with a null exceptionType. Added ILExceptionBlock.FILTER_START to be able to track if we're in a filter block or not. Renamed PatchLastClauseStart to PatchFilterClause to match better what it does, and make it update the handler's type to FILTER. Fixes#81431.
In Test/System.Reflection.Emit:
2007-08-17 Rolf Bjarne Kvinge <[email protected]>
* ILGeneratorTest.cs: Added FilterAndCatchBlock (bug #81431), InvalidFilterBlock1, ValidFilterBlock1, ValidFilterBlock2.
svn path=/trunk/mcs/; revision=84262
2007-07-11 Rodrigo Kumpera <[email protected]>
* TypeBuilder.cs (CreateType): method did not check for enum type with defined methods and fixed compatibility issue in case of calling CreateType again after the first one failed, it now returns null as well.
In Test/System.Reflection.Emit:
2007-07-11 Rodrigo Kumpera <[email protected]>
* TypeBuilderTest.cs: Added tests for enum creation. These tests are related to bugs #82018 and #82075
svn path=/trunk/mcs/; revision=81829
construct non-abstract interface without base type. Modified SetParent
to match MS: in 2.0 profile, throw InvalidOperationException when
parent is null and TypeBuilder is non-abstract interface. When
parent is null and TypeBuilder is not an interface, then set object
as parent. In 1.0 profile, throw ArgumentNullException when parent is
null.
* TypeBuilderTest.cs: Improved tests for SetParent.
* ModuleBuilderTest.cs: Added test for creating non-abstract
interface.
svn path=/trunk/mcs/; revision=81476
* TypeBuilderTest.cs: Enabled test for IsCOMObject. Improved test
for IsImport.
* TypeTest.cs: Added tests for IsAbstract, IsCOMObject, IsImport,
IsInterface, IsPrimitive and IsValueType.
svn path=/trunk/mcs/; revision=81465
* DynamicMethod.cs: Applied patch from Robert Jordan ([email protected]). Add
a destructor which frees the runtime data for the method.
svn path=/trunk/mcs/; revision=80498
the one for a baked type as NotWorking. Added test for
SetCustomAttribute with SuppressUnmanagedCodeSecurity attribute.
* TypeBuilderTest.cs: Split up HasElementType test and marked the
baked variant as NotWorking on the 1.0 profile. Enabled additional
test for bug #81640. Added test for SetCustomAttribute with
SuppressUnmanagedCodeSecurity attribute.
* TypeBuilder.cs: Changed HasElementTypeImpl to return false on 2.0
profile when type is not baked.
svn path=/trunk/mcs/; revision=77776
* TypeBuilder.cs
MethodBuilder.cs:
Tag methods and types as HasSecurity when adding a
SuppressUnmanagedCodeSecurityAttribute on them.
Makes peverify happy.
svn path=/trunk/mcs/; revision=77762
already created. Fixed other part of bug #81368.
* TypeBuilderTest.cs: Added GetFields test for bug #81368. Enabled
test for bug #81640.
svn path=/trunk/mcs/; revision=77508
* TypeBuilder.cs (GetFields): Return MonoField objects if the type is already
created.
* FieldBuilder.cs (SetValue): Make this not supported again.
svn path=/trunk/mcs/; revision=77505