Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(411)

Issue 181060: Fix misplaced directive prologues in rewriter output (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 5 months ago by MikeSamuel
Modified:
16 years, 4 months ago
Reviewers:
ihab.awad
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

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. Submitted @3962

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -8 lines) Patch
M src/com/google/caja/parser/js/Block.java View 2 chunks +7 lines, -2 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/SimpleQuasiNode.java View 2 chunks +39 lines, -6 lines 2 comments Download

Messages

Total messages: 5
MikeSamuel
16 years, 5 months ago (2009-12-24 22:09:12 UTC) #1
MikeSamuel
ping
16 years, 5 months ago (2010-01-08 17:09:48 UTC) #2
MikeSamuel
ping
16 years, 4 months ago (2010-01-22 19:01:44 UTC) #3
ihab.awad
LGTM++ http://codereview.appspot.com/181060/diff/1/2 File src/com/google/caja/parser/quasiliteral/SimpleQuasiNode.java (right): http://codereview.appspot.com/181060/diff/1/2#newcode120 src/com/google/caja/parser/quasiliteral/SimpleQuasiNode.java:120: // assumption here that everything is an AbstractParseTreeNode. ...
16 years, 4 months ago (2010-02-01 06:08:37 UTC) #4
MikeSamuel
16 years, 4 months ago (2010-02-01 09:22:30 UTC) #5
http://codereview.appspot.com/181060/diff/1/2
File src/com/google/caja/parser/quasiliteral/SimpleQuasiNode.java (right):

http://codereview.appspot.com/181060/diff/1/2#newcode120
src/com/google/caja/parser/quasiliteral/SimpleQuasiNode.java:120: // assumption
here that everything is an AbstractParseTreeNode.
On 2010/02/01 06:08:37, ihab.awad wrote:
> While you're at it, could you please delete the above comment since it's no
> longer applicable? Tx.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b