1. A method comprising: by one or more computing devices, constructing a lambda object-oriented scripting language (“λ JS ”) model for a software program written in object-oriented scripting language; converting the λ JS model to a continuation-passing style (CPS) model for the software program; constructing a control flow graph (CFG) for the software program based on the CPS model; and optimizing the CPS model of the software program, comprising merging a sequence of two or more “let” operations, the two or more “let” operations in the CPS model and generated based on the λ JS model, so that they are represented by a single node in the CFG.