mirror of https://github.com/tc39/test262.git
Add tests for duplicate private methods (early-error) (#2308)
* Add tests for duplicate private methods * Add generated js test files * Fix indentation * Add more features to tests * Fix feature list format
This commit is contained in:
parent
71e40aad50
commit
407103728c
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2019 Qiming Ma (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: It's a SyntaxError if a class contains a private async generator and a private field with the same name
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
template: syntax/invalid
|
||||
features: [class-methods-private, class-fields-private, async-iteration]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#m;
|
||||
async * #m() {}
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2019 Qiming Ma (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: It's a SyntaxError if a class contains a private async function and a private field with the same name
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
template: syntax/invalid
|
||||
features: [class-methods-private, class-fields-private, async-functions]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#m;
|
||||
async #m() {}
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2019 Qiming Ma (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: It's a SyntaxError if a class contains a private generator and a private field with the same name
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
template: syntax/invalid
|
||||
features: [class-methods-private, class-fields-private, generators]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#m;
|
||||
* #m() {}
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/grammar-privatemeth-duplicate-async-gen.case
|
||||
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
|
||||
/*---
|
||||
description: It's a SyntaxError if a class contains a private async generator and a private field with the same name (class expression)
|
||||
esid: prod-ClassElement
|
||||
features: [class-methods-private, class-fields-private, async-iteration, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#m;
|
||||
async * #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/grammar-privatemeth-duplicate-async.case
|
||||
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
|
||||
/*---
|
||||
description: It's a SyntaxError if a class contains a private async function and a private field with the same name (class expression)
|
||||
esid: prod-ClassElement
|
||||
features: [class-methods-private, class-fields-private, async-functions, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#m;
|
||||
async #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/grammar-privatemeth-duplicate-gen.case
|
||||
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
|
||||
/*---
|
||||
description: It's a SyntaxError if a class contains a private generator and a private field with the same name (class expression)
|
||||
esid: prod-ClassElement
|
||||
features: [class-methods-private, class-fields-private, generators, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#m;
|
||||
* #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/grammar-privatemeth-duplicate-async-gen.case
|
||||
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
|
||||
/*---
|
||||
description: It's a SyntaxError if a class contains a private async generator and a private field with the same name (class declaration)
|
||||
esid: prod-ClassElement
|
||||
features: [class-methods-private, class-fields-private, async-iteration, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#m;
|
||||
async * #m() {}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/grammar-privatemeth-duplicate-async.case
|
||||
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
|
||||
/*---
|
||||
description: It's a SyntaxError if a class contains a private async function and a private field with the same name (class declaration)
|
||||
esid: prod-ClassElement
|
||||
features: [class-methods-private, class-fields-private, async-functions, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#m;
|
||||
async #m() {}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/grammar-privatemeth-duplicate-gen.case
|
||||
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
|
||||
/*---
|
||||
description: It's a SyntaxError if a class contains a private generator and a private field with the same name (class declaration)
|
||||
esid: prod-ClassElement
|
||||
features: [class-methods-private, class-fields-private, generators, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassBody : ClassElementList
|
||||
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#m;
|
||||
* #m() {}
|
||||
}
|
Loading…
Reference in New Issue