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

Issue 5820071: fix bug with side-effects in method calls (Closed)

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

Description

this fixes issue 1452 http://code.google.com/p/google-caja/issues/detail?id=1452 the method reuse() creates a temporary var for an expression, so that the value can be used multiple times. When reuse() notices the expression is simple enough, it doesn't create a temporary. The method reuseAll() is reuse() applied to an argument list. Currently it just calls reuse() on each argument, which is wrong. When an argument list is something like this: o.m(i, i++) the result is something like this: var x1___ = i++; o.m(i, x1___); This change ensures reuseAll() creates temporaries for all its args if any of its args needs a temporary.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -24 lines) Patch
M src/com/google/caja/parser/quasiliteral/Rule.java View 3 chunks +41 lines, -8 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/ES53RewriterTest.java View 3 chunks +31 lines, -16 lines 0 comments Download

Messages

Total messages: 3
felix8a
14 years, 3 months ago (2012-03-16 00:10:39 UTC) #1
metaweta
lgtm
14 years, 3 months ago (2012-03-16 00:24:31 UTC) #2
felix8a
14 years, 3 months ago (2012-03-16 09:09:21 UTC) #3
@r4808
Sign in to reply to this message.

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