summaryrefslogtreecommitdiff
path: root/test/language
diff options
context:
space:
mode:
authorDaniel Ehrenberg <littledan@chromium.org>2017-12-21 16:57:31 +0100
committerRick Waldron <waldron.rick@gmail.com>2017-12-21 15:21:04 -0500
commitd50c33a5b32362a3640bc28cd309e9f3fc39f2b2 (patch)
tree756262ecaa15185f6afea3bde7e591c4ad4df430 /test/language
parentcb84893f9387af82c542bf6848b71f7260ab075c (diff)
downloadqtdeclarative-testsuites-d50c33a5b32362a3640bc28cd309e9f3fc39f2b2.tar.gz
Remove static fields tests
Static fields were broken up from instance fields and demoted to Stage 2 in the November 2017 TC39 meeting. This patch removes the test262 tests which test static class fields.
Diffstat (limited to 'test/language')
-rw-r--r--test/language/expressions/class/fields-computed-name-static-propname-constructor.js32
-rw-r--r--test/language/expressions/class/fields-computed-name-static-propname-prototype.js58
-rw-r--r--test/language/statements/class/fields-computed-name-static-propname-constructor.js32
-rw-r--r--test/language/statements/class/fields-computed-name-static-propname-prototype.js58
-rw-r--r--test/language/statements/class/static-classelementname-abrupt-completion.js42
-rw-r--r--test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js42
6 files changed, 0 insertions, 264 deletions
diff --git a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js
deleted file mode 100644
index 9cbd70502..000000000
--- a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2017 Valerie Young. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-description: >
- static class fields forbid PropName 'constructor' (no early error for
- ComputedPropertyName)
-esid: sec-class-definitions-static-semantics-early-errors
-features: [class, class-fields-public]
-info: |
- Static Semantics: PropName
- ...
- ComputedPropertyName : [ AssignmentExpression ]
- Return empty.
-
- // This test file also tests the ComputedPropertyName won't trigger the
- // following early error:
- Static Semantics: Early Errors
-
- ClassElement : staticFieldDefinition;
- It is a Syntax Error if PropName of FieldDefinition is "prototype" or
- "constructor".
----*/
-
-var C = class {
- static ["constructor"];
-};
-
-assert.sameValue(C.hasOwnProperty("constructor"), true);
-
-var c = new C();
-assert.sameValue(c.hasOwnProperty("constructor"), false);
diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js
deleted file mode 100644
index 97edf0e44..000000000
--- a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) 2017 Valerie Young. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-description: >
- Cannot redefine a non-configurable, non-writable "prototype" property
-esid: runtime-semantics-class-definition-evaluation
-features: [class, class-fields-public]
-info: |
- // This test file also tests the ComputedPropertyName won't trigger the
- // following early error:
- Static Semantics: Early Errors
-
- ClassElement : staticFieldDefinition;
- It is a Syntax Error if PropName of FieldDefinition is "prototype" or
- "constructor".
-
- 2.13.2 Runtime Semantics: ClassDefinitionEvaluation
-
- ...
- 21. Perform MakeConstructor(F, false, proto).
- ...
- 25. Else, let elements be NonConstructorMethodDefinitions of ClassBody.
- 26. Let fieldRecords be a new empty List.
- 26. For each ClassElement me in order from elements
- a. If IsStatic of me is false, then
- i. Let fields be the result of performing ClassElementEvaluation for e
- with arguments proto and false.
- ...
- 33. Let result be InitializeStaticFields(F).
- ...
-
- // ClassElementEvaluation should evaluate the ComputedPropertyName
-
- 12.2.6.7 Runtime Semantics: Evaluation
-
- ComputedPropertyName:[AssignmentExpression]
-
- 1. Let exprValue be the result of evaluating AssignmentExpression.
- 2. Let propName be ? GetValue(exprValue).
- 3. Return ? ToPropertyKey(propName).
-
- // And the Static Fields should be defined to the class
-
- 2.8 InitializeStaticFields(F)
-
- ...
- 3. Let fieldRecords be the value of F's [[Fields]] internal slot.
- 4. For each item fieldRecord in order from fieldRecords,
- a. If fieldRecord.[[static]] is true, then
- i. Perform ? DefineField(F, fieldRecord).
----*/
-
-assert.throws(TypeError, function() {
- var C = class {
- static ["prototype"];
- };
-});
diff --git a/test/language/statements/class/fields-computed-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-propname-constructor.js
deleted file mode 100644
index 760e89bef..000000000
--- a/test/language/statements/class/fields-computed-name-static-propname-constructor.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2017 Valerie Young. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-description: >
- static class fields forbid PropName 'constructor' (no early error for
- ComputedPropertyName)
-esid: sec-class-definitions-static-semantics-early-errors
-features: [class, class-fields-public]
-info: |
- Static Semantics: PropName
- ...
- ComputedPropertyName : [ AssignmentExpression ]
- Return empty.
-
- // This test file also tests the ComputedPropertyName won't trigger the
- // following early error:
- Static Semantics: Early Errors
-
- ClassElement : staticFieldDefinition;
- It is a Syntax Error if PropName of FieldDefinition is "prototype" or
- "constructor".
----*/
-
-class C {
- static ["constructor"];
-}
-
-assert.sameValue(C.hasOwnProperty("constructor"), true);
-
-var c = new C();
-assert.sameValue(c.hasOwnProperty("constructor"), false);
diff --git a/test/language/statements/class/fields-computed-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-propname-prototype.js
deleted file mode 100644
index df50d8615..000000000
--- a/test/language/statements/class/fields-computed-name-static-propname-prototype.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) 2017 Valerie Young. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-description: >
- Cannot redefine a non-configurable, non-writable "prototype" property
-esid: runtime-semantics-class-definition-evaluation
-features: [class, class-fields-public]
-info: |
- // This test file also tests the ComputedPropertyName won't trigger the
- // following early error:
- Static Semantics: Early Errors
-
- ClassElement : staticFieldDefinition;
- It is a Syntax Error if PropName of FieldDefinition is "prototype" or
- "constructor".
-
- 2.13.2 Runtime Semantics: ClassDefinitionEvaluation
-
- ...
- 21. Perform MakeConstructor(F, false, proto).
- ...
- 25. Else, let elements be NonConstructorMethodDefinitions of ClassBody.
- 26. Let fieldRecords be a new empty List.
- 26. For each ClassElement me in order from elements
- a. If IsStatic of me is false, then
- i. Let fields be the result of performing ClassElementEvaluation for e
- with arguments proto and false.
- ...
- 33. Let result be InitializeStaticFields(F).
- ...
-
- // ClassElementEvaluation should evaluate the ComputedPropertyName
-
- 12.2.6.7 Runtime Semantics: Evaluation
-
- ComputedPropertyName:[AssignmentExpression]
-
- 1. Let exprValue be the result of evaluating AssignmentExpression.
- 2. Let propName be ? GetValue(exprValue).
- 3. Return ? ToPropertyKey(propName).
-
- // And the Static Fields should be defined to the class
-
- 2.8 InitializeStaticFields(F)
-
- ...
- 3. Let fieldRecords be the value of F's [[Fields]] internal slot.
- 4. For each item fieldRecord in order from fieldRecords,
- a. If fieldRecord.[[static]] is true, then
- i. Perform ? DefineField(F, fieldRecord).
----*/
-
-assert.throws(TypeError, function() {
- class C {
- static ["prototype"];
- };
-});
diff --git a/test/language/statements/class/static-classelementname-abrupt-completion.js b/test/language/statements/class/static-classelementname-abrupt-completion.js
deleted file mode 100644
index 77e10ed27..000000000
--- a/test/language/statements/class/static-classelementname-abrupt-completion.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2017 Valerie Young. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-description: Class definition should error if evaluation of static ClassElementName errors
-esid: runtime-semantics-class-definition-evaluation
-info: |
- Runtime Semantics: ClassDefinitionEvaluation
- ...
- 27. For each ClassElement e in order from elements
- a. If IsStatic of e is false, then
- i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
- b. Else,
- i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
- c. If fields is an abrupt completion, then
- i. Set the running execution context's LexicalEnvironment to lex.
- ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
- iii. Return Completion(status).
-
- Runtime Semantics: ClassElementEvaluation
- ...
- ClassElement : static FieldDefinition ;
- 1. Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
-
- Runtime Semantics: ClassFieldDefinitionEvaluation
- With parameters isStatic and homeObject.
- FieldDefinition : ClassElementNameInitializer
- 1. Let fieldName be the result of evaluating ClassElementName.
- 2. ReturnIfAbrupt(fieldName).
-
-features: [class, class-fields-public]
----*/
-
-function f() {
- throw new Test262Error();
-}
-
-assert.throws(Test262Error, function() {
- class C {
- static [f()]
- }
-});
diff --git a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js b/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js
deleted file mode 100644
index 93ae75308..000000000
--- a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2017 Valerie Young. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-description: Class construction should error if evaluation of static field initializer errors
-esid: runtime-semantics-class-definition-evaluation
-info: |
- Runtime Semantics: ClassDefinitionEvaluation
- ...
- 33. Let result be InitializeStaticFields(F).
- 34. If result is an abrupt completion, then
- a. Set the running execution context's LexicalEnvironment to lex.
- b. Return Completion(result).
-
- InitializeStaticFields(F)
- 1. Assert: Type(F) is Object.
- 2. Assert: F is an ECMAScript function object.
- 3. Let fieldRecords be the value of F's [[Fields]] internal slot.
- 4. For each item fieldRecord in order from fieldRecords,
- a. If fieldRecord.[[static]] is true, then
- i. Perform ? DefineField(F, fieldRecord).
-
- DefineField(receiver, fieldRecord)
- 1. Assert: Type(receiver) is Object.
- 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
- 3. Let fieldName be fieldRecord.[[Name]].
- 4. Let initializer be fieldRecord.[[Initializer]].
- 5. If initializer is not empty, then
- a. Let initValue be ? Call(initializer, receiver).
-
-features: [class, class-fields-public]
----*/
-
-function f() {
- throw new Test262Error();
-}
-
-assert.throws(Test262Error, function() {
- class C {
- static x = f();
- }
-})