[torque] Add linter rule for 'label' naming convention
R=tebbi@chromium.org Bug: v8:7793 Change-Id: I6690ae59743054e8171bffbf722eb486f468ac48 Reviewed-on: https://chromium-review.googlesource.com/1228062 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Simon Zünd <szuend@google.com> Cr-Commit-Position: refs/heads/master@{#55985}
This commit is contained in:
parent
9c702f4d3d
commit
d898fa3ec1
@ -711,6 +711,9 @@ base::Optional<ParseResult> MakeForLoopStatement(
|
||||
|
||||
base::Optional<ParseResult> MakeLabelBlock(ParseResultIterator* child_results) {
|
||||
auto label = child_results->NextAs<std::string>();
|
||||
if (!IsUpperCamelCase(label)) {
|
||||
NamingConventionError("Label", label, "UpperCamelCase");
|
||||
}
|
||||
auto parameters = child_results->NextAs<ParameterList>();
|
||||
auto body = child_results->NextAs<Statement*>();
|
||||
LabelBlock* result =
|
||||
@ -840,6 +843,9 @@ base::Optional<ParseResult> MakeConditionalExpression(
|
||||
base::Optional<ParseResult> MakeLabelAndTypes(
|
||||
ParseResultIterator* child_results) {
|
||||
auto name = child_results->NextAs<std::string>();
|
||||
if (!IsUpperCamelCase(name)) {
|
||||
NamingConventionError("Label", name, "UpperCamelCase");
|
||||
}
|
||||
auto types = child_results->NextAs<std::vector<TypeExpression*>>();
|
||||
return ParseResult{LabelAndTypes{std::move(name), std::move(types)}};
|
||||
}
|
||||
|
6
third_party/v8/builtins/array-sort.tq
vendored
6
third_party/v8/builtins/array-sort.tq
vendored
@ -1747,9 +1747,9 @@ module array {
|
||||
sortState[kBailoutStatusIdx] = kSuccess;
|
||||
|
||||
try {
|
||||
const a: JSArray = Cast<JSArray>(obj) otherwise slow;
|
||||
const a: JSArray = Cast<JSArray>(obj) otherwise Slow;
|
||||
const elementsKind: ElementsKind = map.elements_kind;
|
||||
if (!IsFastElementsKind(elementsKind)) goto slow;
|
||||
if (!IsFastElementsKind(elementsKind)) goto Slow;
|
||||
|
||||
// 3. Let len be ? ToLength(? Get(obj, "length")).
|
||||
const len: Smi = a.length_fast;
|
||||
@ -1771,7 +1771,7 @@ module array {
|
||||
}
|
||||
ArrayTimSort(context, sortState, nofNonUndefined);
|
||||
}
|
||||
label slow {
|
||||
label Slow {
|
||||
// 3. Let len be ? ToLength(? Get(obj, "length")).
|
||||
const len: Number = GetLengthProperty(context, obj);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user