Commit 748a1469 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[torque] Only allow basic type expressions in class extends clause

Bug: v8:7793
Change-Id: If419ec5659e98ebeba454417d097a7981ac3da65
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1596729Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61238}
parent f534c933
...@@ -578,6 +578,9 @@ base::Optional<ParseResult> MakeClassDeclaration( ...@@ -578,6 +578,9 @@ base::Optional<ParseResult> MakeClassDeclaration(
NamingConventionError("Type", name->value, "UpperCamelCase"); NamingConventionError("Type", name->value, "UpperCamelCase");
} }
auto extends = child_results->NextAs<base::Optional<TypeExpression*>>(); auto extends = child_results->NextAs<base::Optional<TypeExpression*>>();
if (extends && !BasicTypeExpression::DynamicCast(*extends)) {
ReportError("Expected type name in extends clause.");
}
auto generates = child_results->NextAs<base::Optional<std::string>>(); auto generates = child_results->NextAs<base::Optional<std::string>>();
auto methods = child_results->NextAs<std::vector<Declaration*>>(); auto methods = child_results->NextAs<std::vector<Declaration*>>();
auto fields = child_results->NextAs<std::vector<ClassFieldExpression>>(); auto fields = child_results->NextAs<std::vector<ClassFieldExpression>>();
......
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