Commit 704fa7ad authored by Joshua Litt's avatar Joshua Litt Committed by Commit Bot

[scanner] fix bug with reporting invalid numeric separator

Bug: v8:9603
Change-Id: I7a36c97feedaccf81509aae579f1594a0e7b1019
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1743527Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63129}
parent 26de9a25
......@@ -635,6 +635,11 @@ bool Scanner::ScanDecimalDigits(bool allow_numeric_separator) {
while (IsDecimalDigit(c0_)) {
AddLiteralCharAdvance();
}
if (c0_ == '_') {
ReportScannerError(Location(source_pos(), source_pos() + 1),
MessageTemplate::kInvalidOrUnexpectedToken);
return false;
}
return true;
}
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let x = 09_9.0;
# Copyright 2019 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
*%(basename)s:5: SyntaxError: Invalid or unexpected token
let x = 09_9.0;
^
SyntaxError: Invalid or unexpected token
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