Add throw statements to JavaScript AST