1. ActionScript / Говнокод #9691

    −112

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    public static function isDynamicObject(obj:Object):Boolean
        {
            try
            {
                // this test for checking whether an object is dynamic or not is 
                // pretty hacky, but it assumes that no-one actually has a 
                // property defined called "wootHackwoot"
                obj["wootHackwoot"];
            }
            catch (e:Error)
            {
                // our object isn't from a dynamic class
                return false;
            }
            return true;
        }

    http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

    Запостил: aquahawk, 16 Марта 2012

    Комментарии (6) RSS

    Добавить комментарий