Commit e5cf8e37 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[scanner] Don't muck with positions of EOS in Next

They are properly initialized upon creation.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I10ac441580bf957e97ce663c9c3ad268ddeae935
Reviewed-on: https://chromium-review.googlesource.com/1188573
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55492}
parent 9d493179
...@@ -233,7 +233,6 @@ uc32 Scanner::ScanUnlimitedLengthHexNumber(int max_value, int beg_pos) { ...@@ -233,7 +233,6 @@ uc32 Scanner::ScanUnlimitedLengthHexNumber(int max_value, int beg_pos) {
} }
Token::Value Scanner::Next() { Token::Value Scanner::Next() {
if (next().token == Token::EOS) next().location = current().location;
// Rotate through tokens. // Rotate through tokens.
TokenDesc* previous = current_; TokenDesc* previous = current_;
current_ = next_; current_ = next_;
......
...@@ -15154,7 +15154,7 @@ THREADED_TEST(TryCatchSourceInfoForEOSError) { ...@@ -15154,7 +15154,7 @@ THREADED_TEST(TryCatchSourceInfoForEOSError) {
CHECK(v8::Script::Compile(context.local(), v8_str("!\n")).IsEmpty()); CHECK(v8::Script::Compile(context.local(), v8_str("!\n")).IsEmpty());
CHECK(try_catch.HasCaught()); CHECK(try_catch.HasCaught());
v8::Local<v8::Message> message = try_catch.Message(); v8::Local<v8::Message> message = try_catch.Message();
CHECK_EQ(1, message->GetLineNumber(context.local()).FromJust()); CHECK_EQ(2, message->GetLineNumber(context.local()).FromJust());
CHECK_EQ(0, message->GetStartColumn(context.local()).FromJust()); CHECK_EQ(0, message->GetStartColumn(context.local()).FromJust());
} }
......
...@@ -4,7 +4,7 @@ Running test: testUnexpectedEndOfInput ...@@ -4,7 +4,7 @@ Running test: testUnexpectedEndOfInput
Runs '+++' Runs '+++'
Runtime.evaluate exceptionDetails: Runtime.evaluate exceptionDetails:
{ {
columnNumber : 2 columnNumber : 3
exception : { exception : {
className : SyntaxError className : SyntaxError
description : SyntaxError: Unexpected end of input description : SyntaxError: Unexpected end of input
...@@ -49,7 +49,7 @@ paused on exception: ...@@ -49,7 +49,7 @@ paused on exception:
} }
Runtime.evaluate exceptionDetails: Runtime.evaluate exceptionDetails:
{ {
columnNumber : 2 columnNumber : 3
exception : { exception : {
className : SyntaxError className : SyntaxError
description : SyntaxError: Unexpected end of input at <anonymous>:1:1 description : SyntaxError: Unexpected end of input at <anonymous>:1:1
......
...@@ -6,7 +6,7 @@ compilation result: ...@@ -6,7 +6,7 @@ compilation result:
id : <messageId> id : <messageId>
result : { result : {
exceptionDetails : { exceptionDetails : {
columnNumber : 2 columnNumber : 3
exception : { exception : {
className : SyntaxError className : SyntaxError
description : SyntaxError: Unexpected end of input description : SyntaxError: Unexpected end of input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment