TY - JOUR
T1 - Type checking for JavaScript
AU - Anderson, Christopher
AU - Giannini, Paola
N1 - Funding Information:
1 Work partly supported by DART, European Commission Research Directorates, IST-01-6-1A 2 MURST Cofin’02 project McTati 3 Email: [email protected] 4 Email: [email protected]
PY - 2005/11/23
Y1 - 2005/11/23
N2 - JavaScript is a powerful imperative object based language made popular by its use in web pages. It supports flexible program development by allowing dynamic addition of members to objects. Code is dynamically typed: a runtime access to a non-existing member causes an error. We suggest a static type system for JavaScript that will detect such type errors. Therefore, programmers can benefit from the flexible programming style offered by JavaScript and from the safety offered by a static type system. We demonstrate our type system with a formalism of JavaScript, JS0. Our types are structural. Members of an object type are classified into definite and potential. A potential member becomes definite upon assignment. We outline a proof that our type system is sound.
AB - JavaScript is a powerful imperative object based language made popular by its use in web pages. It supports flexible program development by allowing dynamic addition of members to objects. Code is dynamically typed: a runtime access to a non-existing member causes an error. We suggest a static type system for JavaScript that will detect such type errors. Therefore, programmers can benefit from the flexible programming style offered by JavaScript and from the safety offered by a static type system. We demonstrate our type system with a formalism of JavaScript, JS0. Our types are structural. Members of an object type are classified into definite and potential. A potential member becomes definite upon assignment. We outline a proof that our type system is sound.
KW - JavaScript
KW - Scripting Languages
KW - Structural Recursive Types
KW - Type Checking
UR - http://www.scopus.com/inward/record.url?scp=27744498729&partnerID=8YFLogxK
U2 - 10.1016/j.entcs.2005.09.010
DO - 10.1016/j.entcs.2005.09.010
M3 - Conference article
AN - SCOPUS:27744498729
SN - 1571-0661
VL - 138
SP - 37
EP - 58
JO - Electronic Notes in Theoretical Computer Science
JF - Electronic Notes in Theoretical Computer Science
IS - 2
T2 - Proceedings of the Second Workshop on Object Oriented Developments (WOOD 2004)
Y2 - 30 August 2004 through 30 August 2004
ER -