summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerie R Young <valerie@bocoup.com>2017-10-25 12:56:00 -0400
committerValerie R Young <valerie@bocoup.com>2017-10-26 10:10:57 -0400
commitf8c4f381df24d53eac331b8efc8cdedfe265d564 (patch)
tree5c6bff3250b47894016004f6c21dc32908b655e8
parentc39eeb9276f657e43d1898b7837dbf01b0f0b180 (diff)
downloadqtdeclarative-testsuites-f8c4f381df24d53eac331b8efc8cdedfe265d564.tar.gz
classfields: add tests for early error delete private field
-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