On 2014/11/11 15:01:56, marja wrote:
https://codereview.chromium.org/663683006/diff/260001/src/scanner.cc
File src/scanner.cc (right):


https://codereview.chromium.org/663683006/diff/260001/src/scanner.cc#newcode819
src/scanner.cc:819: PushBack('}');
On 2014/11/11 13:59:29, caitp wrote:
> On 2014/11/11 09:47:24, marja wrote:
> > Hmm, when does this happen and why do we PushBack?
>
> After parsing an expression, the scanner ends up with a peeked RBRACE and
we're
> at the wrong position in source, I'm not sure if this is the right way to
deal
> with that but it seems to work.
>
> Without this, it if you have a template like `${a}`, it misses the ending
> backtick and breaks, which is bad

But after this, we anyway do Advance() right away. Would the code be clearer
if
it was restructured to be PushBack-free?

It looks simpler to me to just PushBack() --- as it's used, it looks like it
should be safe to do it this way, and it means it's safe to make assertions
about the conditions the function is called with, just my opinion though :)

I've changed the code to pull raw strings out of Script::source(), but it's a bit more complicated this way, and I'm not positive if this would work correctly
(or efficiently) in all cases.

https://codereview.chromium.org/663683006/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to