UWSpace is currently experiencing technical difficulties resulting from its recent migration to a new version of its software. These technical issues are not affecting the submission and browse features of the site. UWaterloo community members may continue submitting items to UWSpace. We apologize for the inconvenience, and are actively working to resolve these technical issues.
 

A study of object creators in JavaScript

dc.contributor.authorYuning, Yu
dc.date.accessioned2017-08-23T20:46:41Z
dc.date.available2017-08-23T20:46:41Z
dc.date.issued2017-08-23
dc.date.submitted2017-08-15
dc.description.abstractTraditional object-oriented languages use typed classes to specify the shape and behaviour of objects. In JavaScript, object behaviour is less constrained. Learning how JavaScript programmers create objects can help us understand whether the programmers employ the notion of ``classes'', like those in Java, in JavaScript. In other words, we are trying to compare the creation of objects in JavaScript with Java classes, which create objects and describe the state and behaviour that the type of the object support. Our results have the potential to improve the performance of JavaScript and generality of typed extensions to JavaScript. An access site is the JavaScript code that accesses the properties of objects. We studied the access site to determine whether objects at the access site arise from different ``creators'', which are functions creating the objects, and to discover how prevalent multiple-creator access sites are. Moreover, whether the types of properties ever change is noteworthy: in classes, types of properties may not change. To answer the questions, we executed, recorded, and analyzed many JavaScript applications to obtain real-world data. We collected and analyzed logs from 7,753 web sites. The logs consist of nearly 390 GB of JSON strings. We collected these data through dynamically running modern JavaScript applications, or web sites, in our tool with the browser Firefox. Our results show that for half of selected web sites, there exists only one creator at every access site. And in fewer than 50\% of web sites, there exists more than one creator, though the total number of access sites with multiple creators is extremely small. Although creators with distinct names are considered as different by our definition, different creators may create same objects. Therefore, most object accesses in JavaScript do not come from different creators. As a result, we could employ type annotations for objects. However, our results show that the types of the properties in objects do sometimes change, especially in objects generated from user-defined functions. Thus, even if objects are mostly from one creator, that creator may not correspond neatly to a type. This may limit the advantages of using types for better performance. Combining these results, we conclude that while we can apply Java-like types to JavaScript, these types are far more fluid in JavaScript applications, and so there may be limited benefit.en
dc.identifier.urihttp://hdl.handle.net/10012/12185
dc.language.isoenen
dc.pendingfalse
dc.publisherUniversity of Waterlooen
dc.titleA study of object creators in JavaScripten
dc.typeMaster Thesisen
uws-etd.degreeMaster of Mathematicsen
uws-etd.degree.departmentDavid R. Cheriton School of Computer Scienceen
uws-etd.degree.disciplineComputer Scienceen
uws-etd.degree.grantorUniversity of Waterlooen
uws.contributor.advisorGregor, Richards
uws.contributor.affiliation1Faculty of Mathematicsen
uws.peerReviewStatusUnrevieweden
uws.published.cityWaterlooen
uws.published.countryCanadaen
uws.published.provinceOntarioen
uws.scholarLevelGraduateen
uws.typeOfResourceTexten

Files

Original bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Yu_Yuning.pdf
Size:
391.53 KB
Format:
Adobe Portable Document Format
Description:
License bundle
Now showing 1 - 1 of 1
No Thumbnail Available
Name:
license.txt
Size:
6.08 KB
Format:
Item-specific license agreed upon to submission
Description: