Fix misplaced directive prologues in rewriter output (issue181060)

0 views
Skip to first unread message

mikes...@gmail.com

unread,
Dec 24, 2009, 5:09:12 PM12/24/09
to ihab...@gmail.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com
Reviewers: ihab.awad,

Description:
Some Quasi Rewrite rules of the form
{ @ss* } -> { foo(); @ss* }
are problematic because when *ss; matches a directive prologue, the
output will include the prologue in a context where it is likely to be
misinterpreted.
E.g. if @ss* in the above matches "use strict"; bar(), then the output
would be
{ foo(); "use strict"; bar() }
and when rendered and reparsed, the "use strict"; is interpreted as a
string, not a directive prologue.

Please review this at http://codereview.appspot.com/181060

Affected files:
M src/com/google/caja/parser/js/Block.java
M src/com/google/caja/parser/quasiliteral/SimpleQuasiNode.java


Reply all
Reply to author
Forward
0 new messages