Supporting Dynamic, Third-Party Code Customizations in JavaScript Using Aspects

Benjamin S. Lerner, Herman Venter, and Dan Grossman


Web sites and web browsers have recently evolved into platforms

on top of which entire applications are delivered dynamically,

mostly as JavaScript source code. This delivery format

has sparked extremely enthusiastic efforts to customize

both individual web sites and entire browsers in ways the

original authors never expected or accommodated. Such customizations

take the form of yet more script dynamically

injected into the application, and the current idioms to do so

exploit arcane JavaScript features and are extremely brittle.

In this work, we accept the popularity of extensions and seek

better linguistic mechanisms to support them.

We suggest adding to JavaScript aspect-oriented features

that allow straightforward and declarative ways for customization

code to modify the targeted application. Compared to

most prior aspect-related research, our work has a different

motivation and a different target programming environment,

both of which lead to novel design and implementation techniques.

Our aspect weaving is entirely integrated into a new

dynamic JIT compiler, which lets us properly handle advice

to first-class functions in the presence of arbitrary aliasing,

without resorting to whole-program code transformations.

Our prototype demonstrates that an aspect-oriented approach

to web-application customization is often more efficient than

current idioms while simplifying the entire process.


Publication typeProceedings
Published inOOPSLA 2010
PublisherAssociation for Computing Machinery, Inc.
> Publications > Supporting Dynamic, Third-Party Code Customizations in JavaScript Using Aspects