Class Fields: convert propname-error into non-generated to avoid creating erroneous tests where restrictions do not align.

This commit is contained in:
Rick Waldron 2018-07-30 18:35:07 -04:00 committed by Leo Balter
parent 7bb3bfe7fd
commit 734544272b
20 changed files with 400 additions and 49 deletions

View File

@ -1,33 +1,32 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-expr-computed-name.template
/*--- /*---
description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public] features: [class, class-fields-public]
flags: [generated]
info: | info: |
Static Semantics: PropName Static Semantics: PropName
... ...
ComputedPropertyName : [ AssignmentExpression ] ComputedPropertyName : [ AssignmentExpression ]
Return empty. Return empty.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors
ClassElement : FieldDefinition; ClassElement : FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "constructor". It is a Syntax Error if PropName of FieldDefinition is "constructor".
negative:
phase: parse
type: SyntaxError
---*/ ---*/
throw "Test262: This statement should not be evaluated.";
var x = "constructor"; var x = "constructor";
var C = class { var C = class {
[x]; [x];
}; };
var c = new C();
assert.sameValue(c.hasOwnProperty("constructor"), true);
assert.sameValue(C.hasOwnProperty("constructor"), false);

View File

@ -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.
/*---
description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : static FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
var x = "constructor";
var C = class {
static [x];
};

View File

@ -0,0 +1,32 @@
// 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 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : static FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
var x = "prototype";
var C = class {
static [x];
};

View File

@ -1,11 +1,9 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-expr-literal-name.template
/*--- /*---
description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public] features: [class, class-fields-public]
flags: [generated]
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
@ -14,7 +12,7 @@ info: |
LiteralPropertyName : IdentifierName LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName. Return StringValue of IdentifierName.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors

View File

@ -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.
/*---
description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: PropName
LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : staticFieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static constructor;
};

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: PropName
LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : staticFieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static prototype;
};

View File

@ -1,11 +1,9 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-expr-string-name.template
/*--- /*---
description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public] features: [class, class-fields-public]
flags: [generated]
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
@ -15,7 +13,7 @@ info: |
LiteralPropertyName : StringLiteral LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral. Return the String value whose code units are the SV of the StringLiteral.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors

View File

@ -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.
/*---
description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: PropName
...
LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : staticFieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static 'constructor';
};

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: PropName
...
LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : staticFieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static 'prototype';
};

View File

@ -1,26 +1,29 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-decl-computed-name.template
/*--- /*---
description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public] features: [class, class-fields-public]
flags: [generated]
info: | info: |
Static Semantics: PropName Static Semantics: PropName
... ...
ComputedPropertyName : [ AssignmentExpression ] ComputedPropertyName : [ AssignmentExpression ]
Return empty. Return empty.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors
ClassElement : FieldDefinition; ClassElement : FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "constructor". It is a Syntax Error if PropName of FieldDefinition is "constructor".
negative:
phase: parse
type: SyntaxError
---*/ ---*/
throw "Test262: This statement should not be evaluated.";
var x = "constructor"; var x = "constructor";
class C { class C {

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-static-fields-public]
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : static FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
var x = "constructor";
class C {
static [x];
}

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-static-fields-public]
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : static FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
var x = "prototype";
class C {
static [x];
}

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class-static-fields-public]
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : static FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static ["constructor"];
}

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class-static-fields-public]
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : static FieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static ["prototype"];
}

View File

@ -1,11 +1,9 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-decl-literal-name.template
/*--- /*---
description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public] features: [class, class-fields-public]
flags: [generated]
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
@ -14,7 +12,7 @@ info: |
LiteralPropertyName : IdentifierName LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName. Return StringValue of IdentifierName.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors

View File

@ -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.
/*---
description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-static-fields-public]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: PropName
LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : staticFieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static constructor;
}

View File

@ -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.
/*---
description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden value)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-static-fields-public]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: PropName
LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName.
// This test file tests the following early error:
Static Semantics: Early Errors
ClassElement : staticFieldDefinition;
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static prototype;
}

View File

@ -1,11 +1,9 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-decl-string-name.template
/*--- /*---
description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public] features: [class, class-fields-public]
flags: [generated]
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
@ -15,7 +13,7 @@ info: |
LiteralPropertyName : StringLiteral LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral. Return the String value whose code units are the SV of the StringLiteral.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors

View File

@ -1,11 +1,9 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/static-propname-constructor.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-decl-string-name.template
/*--- /*---
description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class-fields] features: [class, class-static-fields-public]
flags: [generated]
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
@ -15,7 +13,7 @@ info: |
LiteralPropertyName : StringLiteral LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral. Return the String value whose code units are the SV of the StringLiteral.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors
@ -28,5 +26,5 @@ info: |
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
class C { class C {
'constructor'; static 'constructor';
} }

View File

@ -1,11 +1,9 @@
// This file was procedurally generated from the following sources: // Copyright (C) 2017 Valerie Young. All rights reserved.
// - src/class-fields/static-propname-prototype.case // This code is governed by the BSD license found in the LICENSE file.
// - src/class-fields/propname-error/cls-decl-string-name.template
/*--- /*---
description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value)
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
features: [class-fields] features: [class, class-static-fields-public]
flags: [generated]
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
@ -15,7 +13,7 @@ info: |
LiteralPropertyName : StringLiteral LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral. Return the String value whose code units are the SV of the StringLiteral.
// This test file tests the following early error: // This test file tests the following early error:
Static Semantics: Early Errors Static Semantics: Early Errors
@ -28,5 +26,5 @@ info: |
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
class C { class C {
'prototype'; static 'prototype';
} }