summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeo Balter <leonardo.balter@gmail.com>2017-11-03 15:19:34 -0400
committerGitHub <noreply@github.com>2017-11-03 15:19:34 -0400
commit06091cb6fda8b840a7d8c53a94e19cee88100ef6 (patch)
tree47838188163612e907054e0651bfa8a827bcd969 /src
parent8213224280e94ea4b7949c085cb9bf8e99bf0df6 (diff)
parenta9769d0854a52f07b80e8441d8b0a3c3046138bd (diff)
downloadqtdeclarative-testsuites-06091cb6fda8b840a7d8c53a94e19cee88100ef6.tar.gz
Merge pull request #1319 from bocoup/classfields-dupsdeletes
classfields: add tests duplicate private fields and deleting private fields
Diffstat (limited to 'src')
-rw-r--r--src/class-fields/call-expression-privatename.case18
-rw-r--r--src/class-fields/delete-error/cls-decl-field-delete-covered.template29
-rw-r--r--src/class-fields/delete-error/cls-decl-field-delete-twice-covered.template30
-rw-r--r--src/class-fields/delete-error/cls-decl-field-delete.template27
-rw-r--r--src/class-fields/delete-error/cls-decl-method-delete-covered.template33
-rw-r--r--src/class-fields/delete-error/cls-decl-method-delete-twice-covered.template33
-rw-r--r--src/class-fields/delete-error/cls-decl-method-delete.template31
-rw-r--r--src/class-fields/delete-error/cls-expr-field-delete-covered.template30
-rw-r--r--src/class-fields/delete-error/cls-expr-field-delete-twice-covered.template30
-rw-r--r--src/class-fields/delete-error/cls-expr-field-delete.template28
-rw-r--r--src/class-fields/delete-error/cls-expr-method-delete-covered.template33
-rw-r--r--src/class-fields/delete-error/cls-expr-method-delete-twice-covered.template33
-rw-r--r--src/class-fields/delete-error/cls-expr-method-delete.template31
-rw-r--r--src/class-fields/member-expression-privatename.case10
14 files changed, 396 insertions, 0 deletions
diff --git a/src/class-fields/call-expression-privatename.case b/src/class-fields/call-expression-privatename.case
new file mode 100644
index 000000000..a00e9616c
--- /dev/null
+++ b/src/class-fields/call-expression-privatename.case
@@ -0,0 +1,18 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: Syntax error if you call delete on call expressions . privatename
+template: delete-error
+---*/
+
+//- infieldsetup
+g = this.f;
+//- infunctionsetup
+var g = this.f;
+//- expression
+g().#x
+//- functiondeclaration
+ f() {
+ return this;
+}
diff --git a/src/class-fields/delete-error/cls-decl-field-delete-covered.template b/src/class-fields/delete-error/cls-decl-field-delete-covered.template
new file mode 100644
index 000000000..0d5bec730
--- /dev/null
+++ b/src/class-fields/delete-error/cls-decl-field-delete-covered.template
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/statements/class/err-field-delete-covered-
+name: in field, covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+class C {
+ #x;
+ /*{ infieldsetup }*/
+ x = delete (/*{ expression }*/);
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-decl-field-delete-twice-covered.template b/src/class-fields/delete-error/cls-decl-field-delete-twice-covered.template
new file mode 100644
index 000000000..917cd411a
--- /dev/null
+++ b/src/class-fields/delete-error/cls-decl-field-delete-twice-covered.template
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/statements/class/err-field-delete-twice-covered-
+name: in field, recursively covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+class C {
+ #x;
+ /*{ infieldsetup }*/
+ x = delete ((/*{ expression }*/));
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-decl-field-delete.template b/src/class-fields/delete-error/cls-decl-field-delete.template
new file mode 100644
index 000000000..68cf7615b
--- /dev/null
+++ b/src/class-fields/delete-error/cls-decl-field-delete.template
@@ -0,0 +1,27 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/statements/class/err-field-delete-
+name: in field
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+class C {
+ #x;
+ /*{ infieldsetup }*/
+ x = delete /*{ expression }*/;
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-decl-method-delete-covered.template b/src/class-fields/delete-error/cls-decl-method-delete-covered.template
new file mode 100644
index 000000000..2b0200d2c
--- /dev/null
+++ b/src/class-fields/delete-error/cls-decl-method-delete-covered.template
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/statements/class/err-method-delete-covered-
+name: in method, covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+class C {
+ #x;
+
+ x() {
+ /*{ infunctionsetup }*/
+ delete (/*{ expression }*/);
+ }
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-decl-method-delete-twice-covered.template b/src/class-fields/delete-error/cls-decl-method-delete-twice-covered.template
new file mode 100644
index 000000000..f39de82a4
--- /dev/null
+++ b/src/class-fields/delete-error/cls-decl-method-delete-twice-covered.template
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/statements/class/err-method-delete-twice-covered-
+name: in method, recursively covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+class C {
+ #x;
+
+ x() {
+ /*{ infunctionsetup }*/
+ delete ((/*{ expression }*/));
+ }
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-decl-method-delete.template b/src/class-fields/delete-error/cls-decl-method-delete.template
new file mode 100644
index 000000000..1f267683f
--- /dev/null
+++ b/src/class-fields/delete-error/cls-decl-method-delete.template
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/statements/class/err-method-delete-
+name: in method
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+class C {
+ #x;
+
+ x() {
+ /*{ infunctionsetup }*/
+ delete /*{ expression }*/;
+ }
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-expr-field-delete-covered.template b/src/class-fields/delete-error/cls-expr-field-delete-covered.template
new file mode 100644
index 000000000..bf3af2a6c
--- /dev/null
+++ b/src/class-fields/delete-error/cls-expr-field-delete-covered.template
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/expressions/class/err-field-delete-covered-
+name: in field, covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+var C = class {
+ #x;
+ /*{ infieldsetup }*/
+ x = delete (/*{ expression }*/);
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-expr-field-delete-twice-covered.template b/src/class-fields/delete-error/cls-expr-field-delete-twice-covered.template
new file mode 100644
index 000000000..595b706dc
--- /dev/null
+++ b/src/class-fields/delete-error/cls-expr-field-delete-twice-covered.template
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/expressions/class/err-field-delete-twice-covered-
+name: in field, recursively covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+var C = class {
+ #x;
+ /*{ infieldsetup }*/
+ x = delete ((/*{ expression }*/));
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-expr-field-delete.template b/src/class-fields/delete-error/cls-expr-field-delete.template
new file mode 100644
index 000000000..29eea4fcf
--- /dev/null
+++ b/src/class-fields/delete-error/cls-expr-field-delete.template
@@ -0,0 +1,28 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/expressions/class/err-field-delete-
+name: in field
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+var C = class {
+ #x;
+ /*{ infieldsetup }*/
+ x = delete /*{ expression }*/;
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-expr-method-delete-covered.template b/src/class-fields/delete-error/cls-expr-method-delete-covered.template
new file mode 100644
index 000000000..41ebc0e3b
--- /dev/null
+++ b/src/class-fields/delete-error/cls-expr-method-delete-covered.template
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/expressions/class/err-method-delete-covered-
+name: in method, covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+var C = class {
+ #x;
+
+ x() {
+ /*{ infunctionsetup }*/
+ delete (/*{ expression }*/);
+ }
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-expr-method-delete-twice-covered.template b/src/class-fields/delete-error/cls-expr-method-delete-twice-covered.template
new file mode 100644
index 000000000..f456e7c7c
--- /dev/null
+++ b/src/class-fields/delete-error/cls-expr-method-delete-twice-covered.template
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/expressions/class/err-method-delete-twice-covered-
+name: in method, recursively covered
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively applied.
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+var C = class {
+ #x;
+
+ x() {
+ /*{ infunctionsetup }*/
+ delete ((/*{ expression }*/));
+ }
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/delete-error/cls-expr-method-delete.template b/src/class-fields/delete-error/cls-expr-method-delete.template
new file mode 100644
index 000000000..c80c0faa0
--- /dev/null
+++ b/src/class-fields/delete-error/cls-expr-method-delete.template
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+path: language/expressions/class/err-method-delete-
+name: in method
+info: |
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression : IdentifierReference , MemberExpression : MemberExpression.PrivateName , or CallExpression : CallExpression.PrivateName .
+features: [class-fields]
+negative:
+ type: SyntaxError
+ phase: early
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+var C = class {
+ #x;
+
+ x() {
+ /*{ infunctionsetup }*/
+ delete /*{ expression }*/;
+ }
+
+ /*{ functiondeclaration }*/
+}
diff --git a/src/class-fields/member-expression-privatename.case b/src/class-fields/member-expression-privatename.case
new file mode 100644
index 000000000..595cdcea7
--- /dev/null
+++ b/src/class-fields/member-expression-privatename.case
@@ -0,0 +1,10 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: Syntax error if you call delete on member expressions . privatename
+template: delete-error
+---*/
+
+//- expression
+this.#x