Smart argument management for javascript