Eval begone!
Authors:
Open Access
- 19 October 2012
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 47 (10) , 607-620
Abstract
International audienceEval endows JavaScript developers with great power. It allows developers and end-users, by turning text into executable code, to seamlessly extend and customize the behavior of deployed applications as they are running. With great power comes great responsibility, though not in our experience. In previous work we demonstrated through a large corpus study that programmers wield that power in rather irresponsible and arbitrary ways. We showed that most calls to eval fall into a small number of very predictable patterns. We argued that those patterns could easily be recognized by an automated algorithm and that they could almost always be replaced with safer JavaScript idioms. In this paper we set out to validate our claim by designing and implementing a tool, which we call Evalorizer, that can assist programmers in getting rid of their unneeded evals. We use the tool to remove eval from a real-world website and validated our approach over logs taken from the top 100 websites with a success rate over 97% under an open world assumptionKeywords
This publication has 16 references indexed in Scilit:
- Evaluating the Design of the R Language2012
- Automated construction of JavaScript benchmarks2011
- Cujo2010
- Profile-guided static typing for dynamic scripting languages2009
- Defending Browsers against Drive-by Downloads: Mitigating Heap-Spraying Code Injection Attacks2009
- Type Analysis for JavaScript2009
- An Operational Semantics for JavaScript2008
- Type Checking for JavaScriptElectronic Notes in Theoretical Computer Science, 2005
- Towards a Type System for Analyzing JavaScript ProgramsLecture Notes in Computer Science, 2005
- BabyJElectronic Notes in Theoretical Computer Science, 2003