Reviewers: Kevin Millikin,
Message:
On 2009/10/01 12:11:15, Kevin Millikin wrote:
> Please note that this doesn't do what you think it does. Because addition
> associates to the left, your example will be parsed as:
> ((("<div>" + "<span>") + myvar) + "</span>") + "</div>"
> and folded to
> "<div><span>" + myvar + "</span>" + "</div>"
you're absolutely right! holy shit man, good call... I've updated the diff
to
account for BinaryOperations as well. I don't know if that part of the code
is
very clear / optimized, if you could take a look at it. I couldn't find a
way to
do it easily without duplicating code.
Description:
the idea is that often times in code, you will see something like this:
lala = "<div>" +
"<span>" +
myvar +
"</span>" +
"</div>";
this patch transforms that code during the parse phase to be:
lala = "<div><span>" + myvar + "</div></span>";
I will attach a testcase to demonstrate :) ... I had to learn about the
different garbage
collector spaces for this one to work. please review that I'm doing it
correctly. I've modified
the Heap::AllocateConsString function to provide for non-high space
allocation
Please review this at http://codereview.chromium.org/243051
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/heap.h
M src/heap.cc
M src/parser.cc
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---