Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for duplicate private methods (early-error) #2308

Merged
merged 5 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/class-elements/grammar-privatemeth-duplicate-async-gen.case
Original file line number Diff line number Diff line change
@@ -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() {}
17 changes: 17 additions & 0 deletions src/class-elements/grammar-privatemeth-duplicate-async.case
Original file line number Diff line number Diff line change
@@ -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() {}
17 changes: 17 additions & 0 deletions src/class-elements/grammar-privatemeth-duplicate-gen.case
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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() {}
};
Original file line number Diff line number Diff line change
@@ -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() {}
};
Original file line number Diff line number Diff line change
@@ -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() {}
};
Original file line number Diff line number Diff line change
@@ -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() {}
}
Original file line number Diff line number Diff line change
@@ -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() {}
}
Original file line number Diff line number Diff line change
@@ -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() {}
}