Skip to main content

Weakly Sensitive Analysis for Unbounded Iteration over JavaScript Objects

  • Conference paper
  • First Online:
Programming Languages and Systems (APLAS 2017)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10695))

Included in the following conference series:

Abstract

JavaScript framework libraries like jQuery are widely used, but complicate program analyses. Indeed, they encode clean high-level constructions such as class inheritance via dynamic object copies and transformations that are harder to reason about. One common pattern used in them consists of loops that copy or transform part or all of the fields of an object. Such loops are challenging to analyze precisely, due to weak updates and as unrolling techniques do not always apply. In this paper, we observe that precise field correspondence relations are required for client analyses (e.g., for call-graph construction), and propose abstractions of objects and program executions that allow to reason separately about the effect of distinct iterations without resorting to full unrolling. We formalize and implement an analysis based on this technique. We assess the performance and precision on the computation of call-graph information on examples from jQuery tutorials.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://www.jquery-tutorial.net/.

  2. 2.

    https://github.com/xiemaisi/acg.js.

References

  1. Andreasen, E., Møller, A.: Determinacy in static analysis for jQuery. In: OOPLSA (2014)

    Google Scholar 

  2. Bae, S., Cho, H., Lim, I., Ryu, S.: \({\sf SAFE}_{\sf WAPI}\): web API misuse detector for web applications. In: ESEC/FSE (2014)

    Google Scholar 

  3. Balakrishnan, G., Reps, T.: Recency-abstraction for heap-allocated storage. In: Yi, K. (ed.) SAS 2006. LNCS, vol. 4134, pp. 221–239. Springer, Heidelberg (2006). https://doi.org/10.1007/11823230_15

    Chapter  Google Scholar 

  4. Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: POPL (1977)

    Google Scholar 

  5. Cousot, P., Cousot, R.: Systematic design of program analysis frameworks. In: POPL (1979)

    Google Scholar 

  6. Cox, A., Chang, B.-Y.E., Rival, X.: Automatic analysis of open objects in dynamic language programs. In: Müller-Olm, M., Seidl, H. (eds.) SAS 2014. LNCS, vol. 8723, pp. 134–150. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10936-7_9

    Google Scholar 

  7. Cox, A., Chang, B.-Y.E., Sankaranarayanan, S.: QUIC graphs: relational invariant generation for containers. In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 401–425. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39038-8_17

    Chapter  Google Scholar 

  8. Eshkevari, L., Mazinanian, D., Rostami, S., Tsantalis, N.: JSDeodorant: class-awareness for JavaScript programs. In: ICSE (2017)

    Google Scholar 

  9. European Association for Standardizing Information and Communication Systems (ECMA): ECMA-262: ECMAScript Language Specification. Edition 5.1 (2011)

    Google Scholar 

  10. Feldthaus, A., Schäfer, M., Sridharan, M., Dolby, J., Tip, F.: Efficient construction of approximate call graphs for JavaScript IDE services. In: ICSE (2013)

    Google Scholar 

  11. Hackett, B., Guo, S.: Fast and precise hybrid type inference for JavaScript. In: PLDI, New York, NY, USA (2012)

    Google Scholar 

  12. IBM Research: T.J. Watson Libraries for Analysis (WALA). http://wala.sf.net

  13. Jensen, S.H., Madsen, M., Møller, A.: Modeling the HTML DOM and browser API in static analysis of JavaScript web applications. In: ESEC/FSE (2011)

    Google Scholar 

  14. Jensen, S.H., Møller, A., Thiemann, P.: Type analysis for JavaScript. In: Palsberg, J., Su, Z. (eds.) SAS 2009. LNCS, vol. 5673, pp. 238–255. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03237-0_17

    Chapter  Google Scholar 

  15. Lee, H., Won, S., Jin, J., Cho, J., Ryu, S.: SAFE: formal specification and implementation of a scalable analysis framework for ECMAScript. In: FOOL (2012)

    Google Scholar 

  16. Park, C., Ryu, S.: Scalable and precise static analysis of JavaScript applications via loop-sensitivity. In: ECOOP (2015)

    Google Scholar 

  17. Park, C., Won, S., Jin, J., Ryu, S.: Static analysis of JavaScript web applications in the wild via practical DOM modeling. In: ASE (2015)

    Google Scholar 

  18. Schäfer, M., Sridharan, M., Dolby, J., Tip, F.: Dynamic determinacy analysis. In: PLDI (2013)

    Google Scholar 

  19. Sridharan, M., Dolby, J., Chandra, S., Schäfer, M., Tip, F.: Correlation tracking for points-to analysis of JavaScript. In: Noble, J. (ed.) ECOOP 2012. LNCS, vol. 7313, pp. 435–458. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31057-7_20

    Chapter  Google Scholar 

  20. Wei, S., Ryder, B.G.: Practical blended taint analysis for JavaScript. In: ISSTA (2013)

    Google Scholar 

Download references

Acknowledgment

The research leading to these results has received funding from Korea Ministry of Education, Science and Technology (MEST)/National Research Foundation of Korea (NRF) (Grants NRF-2017R1A2B3012020 and NRF-2014R1A2A2A01003235), Samsung Electronics, and the European Research Council under the EU FP 7, grant Agreement 278673, Project MemCAD.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Yoonseok Ko or Sukyoung Ryu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ko, Y., Rival, X., Ryu, S. (2017). Weakly Sensitive Analysis for Unbounded Iteration over JavaScript Objects. In: Chang, BY. (eds) Programming Languages and Systems. APLAS 2017. Lecture Notes in Computer Science(), vol 10695. Springer, Cham. https://doi.org/10.1007/978-3-319-71237-6_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-71237-6_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-71236-9

  • Online ISBN: 978-3-319-71237-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics