Given a Javascript function, is it possible to verify that the function has no side effects; i.e., that the function does not change the value of any variables that are declared outside the function’s scope?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would need to write an effect analysis for JavaScript, which would require an effect semantics for JavaScript. Some of the things to consider:
People have written type systems for impure languages to statically determine if side effects are present. Ben Lippmeier’s thesis covers a lot of the ground.