diff --git a/src/class-elements/grammar-privatemeth-duplicate-get-field.case b/src/class-elements/grammar-privatemeth-duplicate-get-field.case new file mode 100644 index 0000000000000000000000000000000000000000..90cfc9dd000745ecda82f19716400fc7f6e17993 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-get-field.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 getter 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] +---*/ + +//- elements +#m; +get #m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-get-get.case b/src/class-elements/grammar-privatemeth-duplicate-get-get.case new file mode 100644 index 0000000000000000000000000000000000000000..5b9d0a962b075bb05147bec3567a6586f85f12cb --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-get-get.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 multiple private getters 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] +---*/ + +//- elements +get #m() {} +get #m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-get-set.case b/src/class-elements/grammar-privatemeth-duplicate-get-set.case new file mode 100644 index 0000000000000000000000000000000000000000..c7a9283c5050f078c443605e78bf45369cd9868a --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-get-set.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: It's valid if a class contains a private getter and a private setter 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/valid +features: [class-methods-private] +---*/ + +//- elements +get #m() {} +set #m(_) {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-field.case b/src/class-elements/grammar-privatemeth-duplicate-meth-field.case new file mode 100644 index 0000000000000000000000000000000000000000..3fce8c753beac788930d775244d45399156a3dca --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-field.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 method 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] +---*/ + +//- elements +#m; +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-get.case b/src/class-elements/grammar-privatemeth-duplicate-meth-get.case new file mode 100644 index 0000000000000000000000000000000000000000..3f666f13f9749c0541d330dc2f6d22d06172ab77 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-get.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 method and a private getter 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] +---*/ + +//- elements +get #m() {} +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-meth.case b/src/class-elements/grammar-privatemeth-duplicate-meth-meth.case new file mode 100644 index 0000000000000000000000000000000000000000..51f8a4625e64bec94faa4d2ae78e54081d851858 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-meth.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 multiple private methods 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] +---*/ + +//- elements +#m() {} +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-nestedclassmeth.case b/src/class-elements/grammar-privatemeth-duplicate-meth-nestedclassmeth.case new file mode 100644 index 0000000000000000000000000000000000000000..91b76498592dab93bb5ab031ced072826b1a8c75 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-nestedclassmeth.case @@ -0,0 +1,22 @@ +// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: It's valid if a nested class shadows a private method +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/valid +features: [class-methods-private] +---*/ + +//- elements +constructor() { + class B { + #m() {} + } +} + +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-set.case b/src/class-elements/grammar-privatemeth-duplicate-meth-set.case new file mode 100644 index 0000000000000000000000000000000000000000..d81f63fcb930d3d8bbab7bf68cfa7b0407e5c93a --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-set.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 method and a private setter 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] +---*/ + +//- elements +set #m(_) {} +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-staticfield.case b/src/class-elements/grammar-privatemeth-duplicate-meth-staticfield.case new file mode 100644 index 0000000000000000000000000000000000000000..787f7dd1b78f94390f76de86186285847c994cf3 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-staticfield.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 method and a private static 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-static-fields-private] +---*/ + +//- elements +static #m; +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-meth-staticmeth.case b/src/class-elements/grammar-privatemeth-duplicate-meth-staticmeth.case new file mode 100644 index 0000000000000000000000000000000000000000..ed4ab412c55e9e82443d2174d34ae975e3bb4b9d --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-meth-staticmeth.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 method and a private static method 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-static-methods-private] +---*/ + +//- elements +static #m() {} +#m() {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-set-field.case b/src/class-elements/grammar-privatemeth-duplicate-set-field.case new file mode 100644 index 0000000000000000000000000000000000000000..ef422105fee7178cec69c8f365bcc711ac74e047 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-set-field.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 setter 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] +---*/ + +//- elements +#m; +set #m(_) {} diff --git a/src/class-elements/grammar-privatemeth-duplicate-set-set.case b/src/class-elements/grammar-privatemeth-duplicate-set-set.case new file mode 100644 index 0000000000000000000000000000000000000000..7216563a2e17da3892cbbbf56efa73708950a323 --- /dev/null +++ b/src/class-elements/grammar-privatemeth-duplicate-set-set.case @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Kubilay Kahveci (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 multiple private setters 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] +---*/ + +//- elements +set #m(_) {} +set #m(_) {}