Commit 65ab5bb6 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Cook invalid template literals if we've thrown

Otherwise we may look into the invalid string literal later.

Bug: chromium:903527
Change-Id: Ieeb3807bd05e532224e04a59878f5dac24e19579
Reviewed-on: https://chromium-review.googlesource.com/c/1329691
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57423}
parent c357d22c
......@@ -3084,6 +3084,7 @@ class AstNodeFactory final {
}
Literal* NewStringLiteral(const AstRawString* string, int pos) {
DCHECK_NOT_NULL(string);
return new (zone_) Literal(string, pos);
}
......
......@@ -782,7 +782,7 @@ class ParserBase {
impl()->ReportMessageAt(scanner()->invalid_template_escape_location(),
scanner()->invalid_template_escape_message());
}
return false;
return should_throw;
}
void CheckDestructuringElement(ExpressionT element, int beg_pos, int end_pos);
......
// Copyright 2018 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.
assertThrows("e*!`\\2`", SyntaxError)
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