as3hx icon indicating copy to clipboard operation
as3hx copied to clipboard

null comparison conversion

Open SmerkyG opened this issue 11 years ago • 1 comments

if(a) where a is an object type should convert to if(a != null)

SmerkyG avatar Oct 03 '14 20:10 SmerkyG

as3 code for example:

package {
    public class Issue34 {
        public function Issue34() {
            if(_o) {
                trace(o);
            }
        }

        private var _o:Object;
        private function test():void {
            if(_o) {
                trace(_o);
            }
        }        
    }
}

converted to:

class Issue35                     
{                                 
    public function new()         
    {                             
        if (_o)                   
        {                         
            trace(o);             
        }                         
    }                             

    private var _o : Dynamic;     
    private function test() : Void
    {                             
        if (_o != null)           
        {                         
            trace(_o);            
        }                         
    }                             
}                                 

SlavaRa avatar Aug 03 '16 08:08 SlavaRa