diff --git a/tools/lint/lib/checks/features.py b/tools/lint/lib/checks/features.py index fdfa57aec1..bbb7214a45 100644 --- a/tools/lint/lib/checks/features.py +++ b/tools/lint/lib/checks/features.py @@ -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' diff --git a/tools/lint/test/fixtures/test/features_duplicated.js b/tools/lint/test/fixtures/test/features_duplicated.js new file mode 100644 index 0000000000..f70b7044dc --- /dev/null +++ b/tools/lint/test/fixtures/test/features_duplicated.js @@ -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 }) {}