mirror of https://github.com/tc39/test262.git
lint: disallow extra fields in "negative" metadata (#3009)
This commit is contained in:
parent
9997a26c7d
commit
64a8968246
|
@ -27,6 +27,9 @@ class CheckNegative(Check):
|
||||||
if not 'phase' in negative:
|
if not 'phase' in negative:
|
||||||
return '"negative" must specify a "phase" field'
|
return '"negative" must specify a "phase" field'
|
||||||
|
|
||||||
|
if len(negative.keys()) > 2:
|
||||||
|
return '"negative" must specify only "type" and "phase" fields'
|
||||||
|
|
||||||
if negative["phase"] not in ["parse", "resolution", "runtime"]:
|
if negative["phase"] not in ["parse", "resolution", "runtime"]:
|
||||||
return '"phase" must be one of ["parse", "resolution", "runtime"]'
|
return '"phase" must be one of ["parse", "resolution", "runtime"]'
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
NEGATIVE
|
||||||
|
^ 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: Extraneous field in "negative" frontmatter
|
||||||
|
negative:
|
||||||
|
flags: strict
|
||||||
|
type: ReferenceError
|
||||||
|
phase: runtime
|
||||||
|
---*/
|
||||||
|
|
||||||
|
x;
|
||||||
|
let x;
|
Loading…
Reference in New Issue