Merge pull request #1660 from rwaldron/restore-spectranaut-tests

Restore class field tests: public, private (+static)
This commit is contained in:
Leo Balter 2018-08-21 16:47:27 -04:00 committed by GitHub
commit d296cc93ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1428 changed files with 107365 additions and 2325 deletions

View File

@ -20,6 +20,12 @@ BigInt
class-fields-public class-fields-public
class-fields-private 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 # Promise.prototype.finally
# https://github.com/tc39/proposal-promise-finally # https://github.com/tc39/proposal-promise-finally
Promise.prototype.finally Promise.prototype.finally

View File

@ -4,7 +4,7 @@
/*--- /*---
path: language/statements/class/fields-evaluation-error- path: language/statements/class/fields-evaluation-error-
name: field definitions in a class declaration name: field definitions in a class declaration
features: [class, class-fields-public] features: [class]
esid: sec-runtime-semantics-classdefinitionevaluation esid: sec-runtime-semantics-classdefinitionevaluation
---*/ ---*/

View File

@ -4,7 +4,7 @@
/*--- /*---
path: language/expressions/class/fields-evaluation-error- path: language/expressions/class/fields-evaluation-error-
name: field definitions in a class expression name: field definitions in a class expression
features: [class, class-fields-public] features: [class]
esid: sec-runtime-semantics-classdefinitionevaluation esid: sec-runtime-semantics-classdefinitionevaluation
---*/ ---*/

View File

@ -4,7 +4,7 @@
/*--- /*---
path: language/statements/class/fields- path: language/statements/class/fields-
name: field definitions in a class declaration name: field definitions in a class declaration
features: [class, class-fields-public] features: [class]
esid: prod-FieldDefinition esid: prod-FieldDefinition
---*/ ---*/

View File

@ -4,7 +4,7 @@
/*--- /*---
path: language/expressions/class/fields- path: language/expressions/class/fields-
name: field definitions in a class expression name: field definitions in a class expression
features: [class, class-fields-public] features: [class]
esid: prod-FieldDefinition esid: prod-FieldDefinition
---*/ ---*/

View File

@ -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 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. 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: negative:
type: SyntaxError type: SyntaxError
phase: parse phase: parse

View File

@ -13,12 +13,17 @@ info: |
Additional Early Error Rules for Eval Outside Functions 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. 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. It is a Syntax Error if StatementList Contains NewTarget.
features: [class, class-fields-public, new.target]
features: [class, new.target]
template: initializer-eval-newtarget template: initializer-eval-newtarget
---*/ ---*/
//- initializer //- initializer
new.target new.target
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -13,12 +13,17 @@ info: |
Additional Early Error Rules for Eval Outside Constructor Methods 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. 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. It is a Syntax Error if StatementList Contains SuperCall.
features: [class, class-fields-public] features: [class, class-fields-public]
template: initializer-eval-super-call template: initializer-eval-super-call
---*/ ---*/
//- initializer //- initializer
super()['x'] super()['x']
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -4,21 +4,19 @@
/*--- /*---
desc: error if `super().x` in StatementList of eval desc: error if `super().x` in StatementList of eval
info: | 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 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. 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. It is a Syntax Error if StatementList Contains SuperCall.
features: [class, class-fields-public] features: [class, class-fields-public]
template: initializer-eval-super-call template: initializer-eval-super-call
---*/ ---*/
//- initializer //- initializer
super().x super().x
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -13,12 +13,17 @@ info: |
Additional Early Error Rules for Eval Outside Constructor Methods 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. 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. It is a Syntax Error if StatementList Contains SuperCall.
features: [class, class-fields-public] features: [class, class-fields-public]
template: initializer-eval-super-call template: initializer-eval-super-call
---*/ ---*/
//- initializer //- initializer
super() super()
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -13,12 +13,17 @@ info: |
Additional Early Error Rules for Eval Outside Methods 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. 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. It is a Syntax Error if StatementList Contains SuperProperty.
features: [class, class-fields-public] features: [class, class-fields-public]
template: initializer-eval-super-property template: initializer-eval-super-property
---*/ ---*/
//- initializer //- initializer
super.x super.x
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -2,23 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file. // 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: | info: |
Additional Early Error Rules for Eval Inside Initializer The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
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 Methods 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. It is a Syntax Error if StatementList Contains SuperProperty.
features: [class, class-fields-public] features: [class, class-fields-public]
template: initializer-eval-super-property template: initializer-eval-super-property
---*/ ---*/
//- initializer //- initializer
super['x'] super['x']
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -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

View File

@ -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;

View File

@ -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: Valid FieldDefinition, ClassElementName, PropertyName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PropertyName :
LiteralPropertyName
ComputedPropertyName
LiteralPropertyName :
IdentifierName
StringLiteral
NumericLiteral
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
$;
_;
\u{6F};
℘; // DO NOT CHANGE THE NAME OF THIS FIELD
ZW__NJ; // DO NOT CHANGE THE NAME OF THIS FIELD
ZW__J; // DO NOT CHANGE THE NAME OF THIS FIELD

View File

@ -0,0 +1,63 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Invalid FieldDefinition, ClassElementName, PropertyName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PropertyName :
LiteralPropertyName
ComputedPropertyName
LiteralPropertyName :
IdentifierName
StringLiteral
NumericLiteral
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/invalid
features: [class-fields-public]
---*/
//- fields
\u0000;

View File

@ -0,0 +1,63 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Invalid FieldDefinition, ClassElementName, PropertyName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PropertyName :
LiteralPropertyName
ComputedPropertyName
LiteralPropertyName :
IdentifierName
StringLiteral
NumericLiteral
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/invalid
features: [class-fields-public]
---*/
//- fields
\u200D_ZWJ;

View File

@ -0,0 +1,63 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Invalid FieldDefinition, ClassElementName, PropertyName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PropertyName :
LiteralPropertyName
ComputedPropertyName
LiteralPropertyName :
IdentifierName
StringLiteral
NumericLiteral
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/invalid
features: [class-fields-public]
---*/
//- fields
\u200C_ZWNJ;

View File

@ -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: Valid FieldDefinition, ClassElementName, PropertyName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PropertyName :
LiteralPropertyName
ComputedPropertyName
LiteralPropertyName :
IdentifierName
StringLiteral
NumericLiteral
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
$;
_;
\u{6F};
\u2118;
ZW_\u200C_NJ;
ZW_\u200D_J;

View File

@ -0,0 +1,27 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid multi-line, multi-field
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
template: syntax/valid
features: [class-fields-public]
---*/
//- fields
x
y

View File

@ -0,0 +1,26 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: SyntaxError
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
template: syntax/invalid
features: [class-fields-public]
---*/
//- fields
x y

View File

@ -0,0 +1,65 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid PrivateName = Initializer Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# 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-private]
---*/
//- 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

View File

@ -0,0 +1,65 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid PrivateName = Initializer Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# 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-private]
---*/
//- fields
#$ = 1;
#_ = 2;
#\u{6F} = 3;
#\u2118 = 4;
#ZW_\u200C_NJ = 5;
#ZW_\u200D_J = 6;

View File

@ -0,0 +1,29 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: No space allowed between sigial and IdentifierName
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
template: syntax/invalid
features: [class-fields-private]
---*/
//- fields
# x

View File

@ -0,0 +1,57 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid PrivateName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
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/invalid
features: [class-fields-private]
---*/
//- fields
#\u0000;

View File

@ -0,0 +1,58 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid PrivateName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
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/invalid
features: [class-fields-private]
---*/
//- fields
#\u200D_ZWJ;

View File

@ -0,0 +1,58 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid PrivateName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
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/invalid
features: [class-fields-private]
---*/
//- fields
#\u200C_ZWNJ;

View File

@ -0,0 +1,91 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: PrivateName Static Semantics, StringValue
esid: sec-private-names-static-semantics-stringvalue
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
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".
1. Return the String value consisting of the sequence of code
units corresponding to PrivateName. In determining the sequence
any occurrences of \ UnicodeEscapeSequence are first replaced
with the code point represented by the UnicodeEscapeSequence
and then the code points of the entire PrivateName are converted
to code units by UTF16Encoding (10.1.1) each code point.
template: productions
features: [class-fields-private]
---*/
//- fields
#\u{6F};
#\u2118;
#ZW_\u200C_NJ;
#ZW_\u200D_J;
//- privateinspectionfunctions
o(value) {
this.#o = value;
return this.#o;
}
℘(value) {
this.#℘ = value;
return this.#℘;
}
ZW__NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
this.#ZW__NJ = value;
return this.#ZW__NJ;
}
ZW__J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
this.#ZW__J = value;
return this.#ZW__J;
}
//- assertions
assert.sameValue(c.o(1), 1);
assert.sameValue(c.℘(1), 1);
assert.sameValue(c.ZW__NJ(1), 1);
assert.sameValue(c.ZW__J(1), 1);

View File

@ -0,0 +1,62 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Valid PrivateName Syntax
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
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-private]
---*/
//- fields
#$;
#_;
#\u{6F};
#\u2118;
#ZW_\u200C_NJ;
#ZW_\u200D_J;

View File

@ -0,0 +1,30 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: SyntaxError
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
template: syntax/valid
features: [class-fields-private]
---*/
//- fields
#x
m() {}

View File

@ -0,0 +1,30 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: SyntaxError
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
template: syntax/valid
features: [class-fields-private]
---*/
//- fields
#x
#y

View File

@ -0,0 +1,31 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: SyntaxError
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
template: syntax/invalid
negative:
features: [class-fields-private]
---*/
//- fields
#x #y

View File

@ -5,7 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-arrow-fnc- path: language/statements/class/fields-arrow-fnc-
name: arrow function expression name: arrow function expression
features: [arrow-function] features: [arrow-function, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -0,0 +1,16 @@
// 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/fields-comp-name-
name: computed ClassElementName
features: [class, class-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
var x = "string";
class C {
[x] = /*{ initializer }*/;
}

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-equality- path: language/statements/class/fields-equality-
name: equality expression name: equality expression
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-literal-name- path: language/statements/class/fields-literal-name-
name: literal ClassElementName name: literal ClassElementName
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -0,0 +1,16 @@
// 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/fields-static-comp-name-
name: static computed ClassElementName
features: [class, class-static-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
var x = "string";
class C {
static [x] = /*{ initializer }*/;
}

View File

@ -0,0 +1,15 @@
// 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/fields-static-literal-
name: static literal ClassElementName
features: [class, class-static-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static x = /*{ initializer }*/;
}

View File

@ -0,0 +1,15 @@
// 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/fields-static-private-
name: static PrivateName
features: [class, class-static-fields-private]
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static #x = /*{ initializer }*/;
}

View File

@ -0,0 +1,15 @@
// 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/fields-static-string-literal-name-
name: static string literal ClassElementName
features: [class, class-static-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
class C {
static 'x' = /*{ initializer }*/;
}

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-string-literal-name- path: language/statements/class/fields-string-literal-name-
name: string literal ClassElementName name: string literal ClassElementName
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-ternary- path: language/statements/class/fields-ternary-
name: ternary expression name: ternary expression
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-typeof- path: language/statements/class/fields-typeof-
name: typeof expression name: typeof expression
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,7 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-arrow-fnc- path: language/expressions/class/fields-arrow-fnc-
name: arrow function expression name: arrow function expression
features: [arrow-function] features: [arrow-function, class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-comp-name- path: language/expressions/class/fields-comp-name-
name: computed ClassElementName name: computed ClassElementName
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-equality- path: language/expressions/class/fields-equality-
name: equality expression name: equality expression
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-literal-name- path: language/expressions/class/fields-literal-name-
name: literal ClassElementName name: literal ClassElementName
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -0,0 +1,16 @@
// 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/fields-static-comp-name-
name: static computed ClassElementName
features: [class, class-static-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
var x = "string";
var C = class {
static [x] = /*{ initializer }*/;
}

View File

@ -0,0 +1,15 @@
// 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/fields-static-literal-
name: static literal ClassElementName
features: [class, class-static-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static x = /*{ initializer }*/;
}

View File

@ -0,0 +1,15 @@
// 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/fields-static-private-
name: static PrivateName
features: [class, class-static-fields-private]
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static #x = /*{ initializer }*/;
}

View File

@ -0,0 +1,15 @@
// 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/fields-static-string-literal-name-
name: static string literal ClassElementName
features: [class, class-static-fields-public]
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
static 'x' = /*{ initializer }*/;
}

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-string-literal-name- path: language/expressions/class/fields-string-literal-name-
name: string literal ClassElementName name: string literal ClassElementName
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-ternary- path: language/expressions/class/fields-ternary-
name: ternary expression name: ternary expression
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-class-definitions-static-semantics-early-errors esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-typeof- path: language/expressions/class/fields-typeof-
name: typeof expression name: typeof expression
features: [class, class-fields-public]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-direct- path: language/statements/class/fields-direct-
name: direct eval name: direct eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-indirect- path: language/statements/class/fields-indirect-
name: indirect eval name: indirect eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = eval('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-direct- path: language/expressions/class/fields-direct-
name: direct eval name: direct eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-indirect- path: language/expressions/class/fields-indirect-
name: indirect eval name: indirect eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
var C = class {
#x = eval('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
var C = class {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-direct- path: language/statements/class/fields-direct-
name: direct eval name: direct eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-indirect- path: language/statements/class/fields-indirect-
name: indirect eval name: indirect eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = eval('executed = true; /*{ initializer }*/;');
}
var c = new C();
assert.sameValue(executed, true);
assert.sameValue(c.x, undefined);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-direct- path: language/expressions/class/fields-direct-
name: direct eval name: direct eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -5,6 +5,7 @@
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-indirect- path: language/expressions/class/fields-indirect-
name: indirect eval name: indirect eval
features: [class, class-fields-public]
---*/ ---*/
var executed = false; var executed = false;

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
var C = class {
#x = eval('executed = true; /*{ initializer }*/;');
}
var c = new C();
assert.sameValue(executed, true);
assert.sameValue(c.x, undefined);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
var C = class {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-direct-
name: direct eval name: direct eval
---*/ ---*/
class A {}
var executed = false; var executed = false;
class A {}
class C extends A { class C extends A {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} }

View File

@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-indirect-
name: indirect eval name: indirect eval
---*/ ---*/
class A {}
var executed = false; var executed = false;
class A {}
class C extends A { class C extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} }

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-derived-cls-direct-
name: direct eval
---*/
var executed = false;
class A {}
class C extends A {
#x = eval('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-derived-cls-indirect-
name: indirect eval
---*/
var executed = false;
class A {}
class C extends A {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -7,9 +7,8 @@ path: language/expressions/class/fields-derived-cls-direct-
name: direct eval name: direct eval
---*/ ---*/
var A = class {}
var executed = false; var executed = false;
var A = class {}
var C = class extends A { var C = class extends A {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} }

View File

@ -7,9 +7,8 @@ path: language/expressions/class/fields-derived-cls-indirect-
name: indirect eval name: indirect eval
---*/ ---*/
var A = class {}
var executed = false; var executed = false;
var A = class {}
var C = class extends A { var C = class extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} }

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-derived-cls-direct-
name: direct eval
---*/
var executed = false;
var A = class {}
var C = class extends A {
#x = eval('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-derived-cls-indirect-
name: indirect eval
---*/
var executed = false;
var A = class {}
var C = class extends A {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-direct-
name: direct eval name: direct eval
---*/ ---*/
class A {}
var executed = false; var executed = false;
class A {}
class C extends A { class C extends A {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} }

View File

@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-indirect-
name: indirect eval name: indirect eval
---*/ ---*/
class A {}
var executed = false; var executed = false;
class A {}
class C extends A { class C extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} }

View File

@ -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.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-derived-cls-direct-
name: direct eval
---*/
var executed = false;
class A {}
class C extends A {
#x = eval('executed = true; /*{ initializer }*/;');
}
new C();
assert.sameValue(executed, true);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-derived-cls-indirect-
name: indirect eval
---*/
var executed = false;
class A {}
class C extends A {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -7,12 +7,11 @@ path: language/expressions/class/fields-derived-cls-direct-
name: direct eval name: direct eval
---*/ ---*/
var A = class {}
var executed = false; var executed = false;
var A = class {}
var C = class extends A { var C = class extends A {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} };
new C(); new C();

View File

@ -7,12 +7,11 @@ path: language/expressions/class/fields-derived-cls-indirect-
name: indirect eval name: indirect eval
---*/ ---*/
var A = class {}
var executed = false; var executed = false;
var A = class {}
var C = class extends A { var C = class extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} };
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {
new C(); new C();

View File

@ -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.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-derived-cls-direct-
name: direct eval
---*/
var executed = false;
var A = class {}
var C = class extends A {
#x = eval('executed = true; /*{ initializer }*/;');
};
new C();
assert.sameValue(executed, true);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-derived-cls-indirect-
name: indirect eval
---*/
var executed = false;
var A = class {}
var C = class extends A {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
};
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-derived-cls-direct-
name: direct eval
features: [class, class-fields-public]
---*/
var executed = false;
class A = {}
class C extends A {
x = eval('executed = true; /*{ initializer }*/;';
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,22 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-derived-cls-indirect-
name: indirect eval
features: [class, class-fields-public]
---*/
class A = {}
var executed = false;
class C extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;';
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-derived-cls-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
class A = {}
class C extends A {
#x = eval('executed = true; /*{ initializer }*/;';
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,22 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-derived-cls-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
class A = {}
var executed = false;
class C extends A {
#x = (0, eval)('executed = true; /*{ initializer }*/;';
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-derived-cls-direct-
name: direct eval
features: [class, class-fields-public]
---*/
var executed = false;
var A = class {}
var C = class extends A {
x = eval('executed = true; /*{ initializer }*/;';
};
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-derived-cls-indirect-
name: indirect eval
features: [class, class-fields-public]
---*/
var executed = false;
var A = class {}
var C = class extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;';
};
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-derived-cls-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
var A = class {}
var C = class extends A {
#x = eval('executed = true; /*{ initializer }*/;';
};
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-private-derived-cls-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
var A = class {}
var C = class extends A {
#x = (0, eval)('executed = true; /*{ initializer }*/;';
};
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-direct-
name: direct eval
features: [class, class-fields-public]
---*/
var executed = false;
class C {
x = eval('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-indirect-
name: indirect eval
features: [class, class-fields-public]
---*/
var executed = false;
class C {
x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = eval('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-private-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);

Some files were not shown because too many files have changed in this diff Show More