EcmaScript Quasi-Literals

EcmaScript Quasi-Literals. http://wiki.ecmascript.org/doku.php?id=harmony:quasis, 2011. [doi]

Abstract

EcmaScript is frequently used as a glue language for dealing with content specified in other languages : HTML, CSS, JSON, XML, etc. Libraries have implemented query languages and content generation schemes for most of these : CSS selectors, XPath, various templating schemes. These tend to suffer from interpretation overhead, or from injection vulnerabilities, or both.

This scheme extends EcmaScript syntax with syntactic sugar to allow libraries to provide DSLs that easily produce, query, and manipulate content from other languages that are immune or resistant to injection attacks such as XSS, SQL Injection, etc.

This scheme aims to preserve ES5 strict mode’s static analyzability while allowing details of the DSL implementation to be dynamic.