Skip to content

Commit

Permalink
Merge pull request #1660 from rwaldron/restore-spectranaut-tests
Browse files Browse the repository at this point in the history
Restore class field tests: public, private (+static)
  • Loading branch information
leobalter authored Aug 21, 2018
2 parents afbba10 + fa36c45 commit d296cc9
Show file tree
Hide file tree
Showing 1,428 changed files with 107,353 additions and 2,313 deletions.
6 changes: 6 additions & 0 deletions features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ BigInt
class-fields-public
class-fields-private

# Static Class Fields & Methods:
# https://github.com/tc39/proposal-static-class-features/
class-static-fields-public
class-static-fields-private
class-static-methods-private

# Promise.prototype.finally
# https://github.com/tc39/proposal-promise-finally
Promise.prototype.finally
Expand Down
2 changes: 1 addition & 1 deletion src/class-fields/class-evaluation-error/cls-decl.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*---
path: language/statements/class/fields-evaluation-error-
name: field definitions in a class declaration
features: [class, class-fields-public]
features: [class]
esid: sec-runtime-semantics-classdefinitionevaluation
---*/

Expand Down
2 changes: 1 addition & 1 deletion src/class-fields/class-evaluation-error/cls-expr.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*---
path: language/expressions/class/fields-evaluation-error-
name: field definitions in a class expression
features: [class, class-fields-public]
features: [class]
esid: sec-runtime-semantics-classdefinitionevaluation
---*/

Expand Down
2 changes: 1 addition & 1 deletion src/class-fields/default/cls-decl.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*---
path: language/statements/class/fields-
name: field definitions in a class declaration
features: [class, class-fields-public]
features: [class]
esid: prod-FieldDefinition
---*/

Expand Down
2 changes: 1 addition & 1 deletion src/class-fields/default/cls-expr.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*---
path: language/expressions/class/fields-
name: field definitions in a class expression
features: [class, class-fields-public]
features: [class]
esid: prod-FieldDefinition
---*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ info: |
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, class-fields-private]
features: [class, class-fields-private, class-fields-public]
negative:
type: SyntaxError
phase: parse
Expand Down
9 changes: 7 additions & 2 deletions src/class-fields/eval-err-contains-newtarget.case
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ info: |

Additional Early Error Rules for Eval Outside Functions
These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
ScriptBody:StatementList
ScriptBody : StatementList

It is a Syntax Error if StatementList Contains NewTarget.
features: [class, class-fields-public, new.target]

features: [class, new.target]
template: initializer-eval-newtarget
---*/

//- initializer
new.target
//- earlyerror
SyntaxError
//- executionerror
SyntaxError
7 changes: 6 additions & 1 deletion src/class-fields/eval-err-contains-supercall-1.case
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ info: |

Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList
ScriptBody : StatementList

It is a Syntax Error if StatementList Contains SuperCall.

features: [class, class-fields-public]
template: initializer-eval-super-call
---*/

//- initializer
super()['x']
//- earlyerror
SyntaxError
//- executionerror
SyntaxError
14 changes: 6 additions & 8 deletions src/class-fields/eval-err-contains-supercall-2.case
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@
/*---
desc: error if `super().x` in StatementList of eval
info: |
Additional Early Error Rules for Eval Inside Initializer
These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
ScriptBody : StatementList

...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function.

Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList
ScriptBody : StatementList

It is a Syntax Error if StatementList Contains SuperCall.

features: [class, class-fields-public]
template: initializer-eval-super-call
---*/

//- initializer
super().x
//- earlyerror
SyntaxError
//- executionerror
SyntaxError
7 changes: 6 additions & 1 deletion src/class-fields/eval-err-contains-supercall.case
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ info: |

Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList
ScriptBody : StatementList

It is a Syntax Error if StatementList Contains SuperCall.

features: [class, class-fields-public]
template: initializer-eval-super-call
---*/

//- initializer
super()
//- earlyerror
SyntaxError
//- executionerror
SyntaxError
7 changes: 6 additions & 1 deletion src/class-fields/eval-err-contains-superproperty-1.case
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ info: |

Additional Early Error Rules for Eval Outside Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
ScriptBody:StatementList
ScriptBody : StatementList

It is a Syntax Error if StatementList Contains SuperProperty.

features: [class, class-fields-public]
template: initializer-eval-super-property
---*/

//- initializer
super.x
//- earlyerror
SyntaxError
//- executionerror
SyntaxError
20 changes: 11 additions & 9 deletions src/class-fields/eval-err-contains-superproperty-2.case
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: error if `super['x']` in StatementList of eval
desc: error if super['x'] in StatementList of eval
info: |
Additional Early Error Rules for Eval Inside Initializer
These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
ScriptBody : StatementList

...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
The remaining eval rules apply as outside a constructor, inside a method, and inside a function.

Additional Early Error Rules for Eval Outside Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
ScriptBody:StatementList

These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.

ScriptBody : StatementList

It is a Syntax Error if StatementList Contains SuperProperty.

features: [class, class-fields-public]
template: initializer-eval-super-property
---*/

//- initializer
super['x']
//- earlyerror
SyntaxError
//- executionerror
SyntaxError
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax
info: |

ClassElement :
...
FieldDefinition ;
;

FieldDefinition :
ClassElementName Initializer _opt

ClassElementName :
PropertyName
PrivateName

PropertyName :
LiteralPropertyName
ComputedPropertyName

LiteralPropertyName :
IdentifierName

Initializer :
= AssignmentExpression

IdentifierName ::
IdentifierStart
IdentifierName IdentifierPart

IdentifierStart ::
UnicodeIDStart
$
_
\ UnicodeEscapeSequence

IdentifierPart ::
UnicodeIDContinue
$
\ UnicodeEscapeSequence
<ZWNJ> <ZWJ>

UnicodeIDStart ::
any Unicode code point with the Unicode property "ID_Start"

UnicodeIDContinue ::
any Unicode code point with the Unicode property "ID_Continue"


NOTE 3
The sets of code points with Unicode properties "ID_Start" and
"ID_Continue" include, respectively, the code points with Unicode
properties "Other_ID_Start" and "Other_ID_Continue".

template: syntax/valid
features: [class-fields-public]
---*/

//- fields
$ = 1;
_ = 2;
\u{6F} = 3;
℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD
ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD
ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD
68 changes: 68 additions & 0 deletions src/class-fields/grammar-field-classelementname-initializer.case
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax
info: |

ClassElement :
...
FieldDefinition ;
;

FieldDefinition :
ClassElementName Initializer _opt

ClassElementName :
PropertyName
PrivateName

PropertyName :
LiteralPropertyName
ComputedPropertyName

LiteralPropertyName :
IdentifierName

Initializer :
= AssignmentExpression

IdentifierName ::
IdentifierStart
IdentifierName IdentifierPart

IdentifierStart ::
UnicodeIDStart
$
_
\ UnicodeEscapeSequence

IdentifierPart ::
UnicodeIDContinue
$
\ UnicodeEscapeSequence
<ZWNJ> <ZWJ>

UnicodeIDStart ::
any Unicode code point with the Unicode property "ID_Start"

UnicodeIDContinue ::
any Unicode code point with the Unicode property "ID_Continue"


NOTE 3
The sets of code points with Unicode properties "ID_Start" and
"ID_Continue" include, respectively, the code points with Unicode
properties "Other_ID_Start" and "Other_ID_Continue".

template: syntax/valid
features: [class-fields-public]
---*/

//- fields
$ = 1;
_ = 2;
\u{6F} = 3;
\u2118 = 4;
ZW_\u200C_NJ = 5;
ZW_\u200D_J = 6;
Loading

0 comments on commit d296cc9

Please sign in to comment.