fix missing var in js optimizer
initial porting of eliminator to native optimizer