mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 22:45:10 +02:00
[generation] Parse and render new error format
Extend the test generation tool to emit the recently-modified format of the "negative" meta-data. Update the effected test case files accordingly.
This commit is contained in:
parent
0c29e6de86
commit
7f6e6d137d
@ -5,7 +5,9 @@ desc: >
|
|||||||
It is a Syntax Error if BoundNames of FormalParameters contains any duplicate
|
It is a Syntax Error if BoundNames of FormalParameters contains any duplicate
|
||||||
elements.
|
elements.
|
||||||
template: syntax
|
template: syntax
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: |
|
info: |
|
||||||
14.1.2 Static Semantics: Early Errors
|
14.1.2 Static Semantics: Early Errors
|
||||||
|
|
||||||
|
@ -20,7 +20,9 @@ info: |
|
|||||||
|
|
||||||
...BindingIdentifier[?Yield]
|
...BindingIdentifier[?Yield]
|
||||||
...BindingPattern[?Yield]
|
...BindingPattern[?Yield]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- params
|
||||||
|
@ -10,7 +10,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -8,7 +8,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.4
|
es6id: 12.14.5.4
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
AssignmentPattern as the goal symbol.
|
AssignmentPattern as the goal symbol.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.3
|
es6id: 12.14.5.3
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
AssignmentPattern as the goal symbol.
|
AssignmentPattern as the goal symbol.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.3
|
es6id: 12.14.5.3
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -10,7 +10,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.4
|
es6id: 12.14.5.4
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -7,7 +7,9 @@ desc: >
|
|||||||
AssignmentElementList.
|
AssignmentElementList.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -7,7 +7,9 @@ desc: >
|
|||||||
AssignmentElementList.
|
AssignmentElementList.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -7,7 +7,9 @@ desc: >
|
|||||||
AssignmentElementList.
|
AssignmentElementList.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -7,7 +7,9 @@ desc: >
|
|||||||
AssignmentRestElement in a AssignmentElementList.
|
AssignmentRestElement in a AssignmentElementList.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -6,7 +6,9 @@ desc: >
|
|||||||
The AssignmentRestElement does not support an initializer.
|
The AssignmentRestElement does not support an initializer.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- setup
|
//- setup
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
AssignmentPattern as the goal symbol.
|
AssignmentPattern as the goal symbol.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.3
|
es6id: 12.14.5.3
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
AssignmentPattern as the goal symbol.
|
AssignmentPattern as the goal symbol.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.3
|
es6id: 12.14.5.3
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- setup
|
//- setup
|
||||||
|
@ -9,7 +9,9 @@ template: syntax
|
|||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- setup
|
//- setup
|
||||||
|
@ -8,7 +8,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -8,7 +8,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5
|
es6id: 12.14.5
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -8,7 +8,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.4
|
es6id: 12.14.5.4
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.4
|
es6id: 12.14.5.4
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
AssignmentPattern as the goal symbol.
|
AssignmentPattern as the goal symbol.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.4
|
es6id: 12.14.5.4
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -10,7 +10,9 @@ desc: >
|
|||||||
the goal symbol.
|
the goal symbol.
|
||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.1
|
es6id: 12.14.5.1
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -9,7 +9,9 @@ desc: >
|
|||||||
template: syntax
|
template: syntax
|
||||||
es6id: 12.14.5.4
|
es6id: 12.14.5.4
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- elems
|
//- elems
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
/*---
|
/*---
|
||||||
template: default
|
template: default
|
||||||
desc: Reset element (nested array pattern) does not support initializer
|
desc: Reset element (nested array pattern) does not support initializer
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: >
|
info: >
|
||||||
13.3.3 Destructuring Binding Patterns
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
/*---
|
/*---
|
||||||
template: default
|
template: default
|
||||||
desc: Reset element (identifier) does not support initializer
|
desc: Reset element (identifier) does not support initializer
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: >
|
info: >
|
||||||
13.3.3 Destructuring Binding Patterns
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
/*---
|
/*---
|
||||||
template: default
|
template: default
|
||||||
desc: Reset element (nested object pattern) does not support initializer
|
desc: Reset element (nested object pattern) does not support initializer
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: >
|
info: >
|
||||||
13.3.3 Destructuring Binding Patterns
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
/*---
|
/*---
|
||||||
template: default
|
template: default
|
||||||
desc: Rest element (array binding pattern) may not be followed by any element
|
desc: Rest element (array binding pattern) may not be followed by any element
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: >
|
info: >
|
||||||
13.3.3 Destructuring Binding Patterns
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
/*---
|
/*---
|
||||||
template: default
|
template: default
|
||||||
desc: Rest element (identifier) may not be followed by any element
|
desc: Rest element (identifier) may not be followed by any element
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: >
|
info: >
|
||||||
13.3.3 Destructuring Binding Patterns
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
/*---
|
/*---
|
||||||
template: default
|
template: default
|
||||||
desc: Rest element (object binding pattern) may not be followed by any element
|
desc: Rest element (object binding pattern) may not be followed by any element
|
||||||
negative: SyntaxError
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
info: >
|
info: >
|
||||||
13.3.3 Destructuring Binding Patterns
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
|
||||||
|
@ -144,7 +144,10 @@ class Template:
|
|||||||
lines += ['includes: ' + yaml.dump(includes).strip()]
|
lines += ['includes: ' + yaml.dump(includes).strip()]
|
||||||
|
|
||||||
if case_values['meta'].get('negative'):
|
if case_values['meta'].get('negative'):
|
||||||
lines += ['negative: ' + case_values['meta'].get('negative')]
|
lines += ['negative:']
|
||||||
|
as_yaml = yaml.dump(case_values['meta'].get('negative'),
|
||||||
|
default_flow_style=False)
|
||||||
|
lines += indent(as_yaml.strip(), ' ').split('\n')
|
||||||
|
|
||||||
info = []
|
info = []
|
||||||
|
|
||||||
|
13
tools/generation/test/expected/negative/negative-negative.js
Normal file
13
tools/generation/test/expected/negative/negative-negative.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - tools/generation/test/fixtures/negative.case
|
||||||
|
// - tools/generation/test/fixtures/negative/negative.template
|
||||||
|
/*---
|
||||||
|
description: foobar (The "negative" field should be emitted in the output files)
|
||||||
|
es6id: 1.2.3
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: ReferenceError
|
||||||
|
info: |
|
||||||
|
case info
|
||||||
|
---*/
|
10
tools/generation/test/fixtures/negative.case
vendored
Normal file
10
tools/generation/test/fixtures/negative.case
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright (C) 2016 Mike Pennisi. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
template: negative
|
||||||
|
desc: foobar
|
||||||
|
info: case info
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: ReferenceError
|
||||||
|
---*/
|
7
tools/generation/test/fixtures/negative/negative.template
vendored
Normal file
7
tools/generation/test/fixtures/negative/negative.template
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// Copyright (C) 2016 Mike Pennisi. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
name: The "negative" field should be emitted in the output files
|
||||||
|
path: negative/negative-
|
||||||
|
es6id: 1.2.3
|
||||||
|
---*/
|
@ -54,5 +54,10 @@ class TestGeneration(unittest.TestCase):
|
|||||||
self.assertEqual(result['returncode'], 0)
|
self.assertEqual(result['returncode'], 0)
|
||||||
self.compareTrees('normal')
|
self.compareTrees('normal')
|
||||||
|
|
||||||
|
def test_negative(self):
|
||||||
|
result = self.fixture('negative.case')
|
||||||
|
self.assertEqual(result['returncode'], 0)
|
||||||
|
self.compareTrees('negative')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user