Polymorphic type inference for scripting languages with object extensions
-
Published:2012-03-18
Issue:2
Volume:47
Page:37-50
-
ISSN:0362-1340
-
Container-title:ACM SIGPLAN Notices
-
language:en
-
Short-container-title:SIGPLAN Not.
Affiliation:
1. University of Wisconsin - Milwaukee, Milwaukee, WI, USA
Abstract
This paper presents a polymorphic type inference algorithm for a small subset of JavaScript. The goal is to prevent accessing undefined members of objects. We define a type system that allows explicit extension of objects through add operation and implicit extension through method calls. The type system also permits strong updates and unrestricted extensions to new objects. The type inference algorithm is modular so that each function definition is only analyzed once and larger programs can be checked incrementally.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software