Download PDFOpen PDF in browserTowards an amortized type system for JavaScript15 pages•Published: December 4, 2014AbstractJavaScript programs have access to a wide range of resources and many of those have security implications.Tight bounds on the consumption of those resources can give indication of the functionality provided by the program and minimize the security risks of mobile applications. Resource consumption is typically dependent on the input of the user. In this paper we introduce an amortized type system for a core of JavaScript. The resulting types certify bounds for the resource usage dependent on the input parameters. We define the amortized types and the corresponding typing rules. Furthermore we discuss how to fully automatically infer those resource bounds for arbitrary applications. In addition to the usual example of amortized resource, heap-space, our type system can be applied to many phone specific resources, which we demonstrate using the example of the GPS sensor and others. The main result of this paper is the soundness of the core type system, proving that a valid type for a program corresponds to a bound on the units used of the specified resource. Keyphrases: amortized analysis, javascript type system, mobile applications, resource bounds, resource usage, type system In: Temur Kutsia and Andrei Voronkov (editors). SCSS 2014. 6th International Symposium on Symbolic Computation in Software Science, vol 30, pages 12-26.
|