Reviewers: Yang,
Message:
Yang, please take a look.
Description:
[V8] Reland https://codereview.chromium.org/1100993003/
Chromium tests were prepared in https://codereview.chromium.org/1118743003/
Blink tests in https://codereview.chromium.org/1115193002/
LOG=Y
BUG=chromium:480652
[email protected]
Please review this at https://codereview.chromium.org/1121833003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+16, -0 lines):
M src/scanner.cc
M test/cctest/test-api.cc
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index
aa5ae4a5e93c317dd804d92420b792fdf0707221..04b3dd1353d0030d8b1918755c25c4ea55895257
100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -225,6 +225,10 @@ static const byte one_char_tokens[] = {
Token::Value Scanner::Next() {
+ if (next_.token == Token::EOS) {
+ next_.location.beg_pos = current_.location.beg_pos;
+ next_.location.end_pos = current_.location.end_pos;
+ }
current_ = next_;
has_line_terminator_before_next_ = false;
has_multiline_comment_before_next_ = false;
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index
12f481019b05cfe2d87693b15354ac9f2514d519..c363f8843bc0e5205b21d769ad279e97db08cdf8
100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -12565,6 +12565,18 @@ THREADED_TEST(TryCatchSourceInfo) {
}
+THREADED_TEST(TryCatchSourceInfoForEOSError) {
+ LocalContext context;
+ v8::HandleScope scope(context->GetIsolate());
+ v8::TryCatch try_catch;
+ v8::Script::Compile(v8_str("!\n"));
+ CHECK(try_catch.HasCaught());
+ v8::Handle<v8::Message> message = try_catch.Message();
+ CHECK_EQ(1, message->GetLineNumber());
+ CHECK_EQ(0, message->GetStartColumn());
+}
+
+
THREADED_TEST(CompilationCache) {
LocalContext context;
v8::HandleScope scope(context->GetIsolate());
--
--
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.