lint: disallow duplicate values in "features" tag (#3010)

This commit is contained in:
jugglinmike 2021-06-24 13:38:18 -04:00 committed by GitHub
parent 64a8968246
commit 6c9d2222fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -29,3 +29,6 @@ class CheckFeatures(Check):
for feature in features:
if feature not in self.valid_features:
return 'Unrecognized feature: "%s"' % feature
if len(set(features)) != len(features):
return 'The `features` tag may not include duplicate entries'

View File

@ -0,0 +1,11 @@
FEATURES
^ expected errors | v input
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-assignment-operators-static-semantics-early-errors
description: Duplicated values in "features" frontmatter
features: [object-spread, async-functions, object-spread]
---*/
async function f({ ...a }) {}