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

Issue 7230046: Fix var declarations inside for loops at the top level (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 2 months ago by Jasvir
Modified:
13 years, 2 months ago
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Var declarations were always rewritten to assignment statements, however, in a for loop, the initializer can be either a var decl or an expression but not an arbitrary statement. This change rewrites a var declaration to a statement iff it occurs outside a for-loop (according to the SpiderMonkey parser api) @5234

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix var declarations inside for loops at the top level #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -18 lines) Patch
M src/com/google/caja/ses/mitigateGotchas.js View 1 5 chunks +28 lines, -15 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-language-guest.html View 3 chunks +33 lines, -3 lines 0 comments Download

Messages

Total messages: 6
Jasvir
13 years, 2 months ago (2013-01-27 08:50:32 UTC) #1
MarkM
https://codereview.appspot.com/7230046/diff/1/src/com/google/caja/ses/mitigateGotchas.js File src/com/google/caja/ses/mitigateGotchas.js (right): https://codereview.appspot.com/7230046/diff/1/src/com/google/caja/ses/mitigateGotchas.js#newcode58 src/com/google/caja/ses/mitigateGotchas.js:58: node.type == 'ForOfStatement' || I'm surprised this has ForOfStatement. ...
13 years, 2 months ago (2013-01-27 18:53:07 UTC) #2
Jasvir
Var declarations were always rewritten to assignment statements, however, in a for loop, the initializer ...
13 years, 2 months ago (2013-01-27 19:52:52 UTC) #3
Jasvir Nagra
https://codereview.appspot.com/7230046/diff/1/src/com/google/caja/ses/mitigateGotchas.js File src/com/google/caja/ses/mitigateGotchas.js (right): https://codereview.appspot.com/7230046/diff/1/src/com/google/caja/ses/mitigateGotchas.js#newcode58 src/com/google/caja/ses/mitigateGotchas.js:58: node.type == 'ForOfStatement' || Actually the parser does not ...
13 years, 2 months ago (2013-01-27 19:53:09 UTC) #4
MarkM
LGTM
13 years, 2 months ago (2013-01-27 20:50:24 UTC) #5
ihab.awad
13 years, 2 months ago (2013-01-28 05:30:30 UTC) #6
Message was sent while issue was closed.
lgtm2
Sign in to reply to this message.

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