sushihangover / as3-commons

Automatically exported from code.google.com/p/as3-commons
1 stars 0 forks source link

New Type property proposition: isInterface #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Right now there is no clear way of determining whether an arbitrary type is
a Class or an interface.
Therefore I propose a new property on the Type class called 'isInterface'
which will return true if the specified Type is an interface.

In the describeType() XML there's not really a clear way of determining
this, so far all I can figure out is to check for the existence of an
<extendsClass/> element under the <factory> element. Only in the case that
'Object' is passed in as the clazz argument will this not work, therefore
for this one class there needs to be an exception in the code.

I have attached a patch file for the Type.as file that implements
aforementioned property plus a patch file for the TypeTest.as file that
adds a few tests for the new property.

cheers,

Roland

Original issue reported on code.google.com by ihatelivelyids on 1 Sep 2009 at 4:09

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by christophe.herreman on 5 Oct 2009 at 4:01