mirror of https://github.com/tc39/test262.git
test: Add tests for private methods and accessors productions
This commit is contained in:
parent
70248aa166
commit
3d88cbfd3f
|
@ -0,0 +1,108 @@
|
|||
// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: Valid PrivateName as private getter
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
...
|
||||
;
|
||||
|
||||
MethodDefinition :
|
||||
...
|
||||
get ClassElementName ( ){ FunctionBody }
|
||||
...
|
||||
|
||||
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: productions
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
get #$() {
|
||||
return this.#$_;
|
||||
}
|
||||
get #_() {
|
||||
return this.#__;
|
||||
}
|
||||
get #\u{6F}() {
|
||||
return this.#\u{6F}_;
|
||||
}
|
||||
get #℘() {
|
||||
return this.#℘_;
|
||||
}
|
||||
get #ZW__NJ() {
|
||||
return this.#ZW__NJ_;
|
||||
}
|
||||
get #ZW__J() {
|
||||
return this.#ZW__J_;
|
||||
}
|
||||
|
||||
//- privateinspectionfunctions
|
||||
$(value) {
|
||||
this.#$_ = value;
|
||||
return this.#$;
|
||||
}
|
||||
_(value) {
|
||||
this.#__ = value;
|
||||
return this.#_;
|
||||
}
|
||||
\u{6F}(value) {
|
||||
this.#\u{6F}_ = value;
|
||||
return this.#\u{6F};
|
||||
}
|
||||
℘(value) {
|
||||
this.#℘_ = value;
|
||||
return this.#℘;
|
||||
}
|
||||
ZW__NJ(value) {
|
||||
this.#ZW__NJ_ = value;
|
||||
return this.#ZW__NJ;
|
||||
}
|
||||
ZW__J(value) {
|
||||
this.#ZW__J_ = value;
|
||||
return this.#ZW__J;
|
||||
}
|
||||
|
||||
//- assertions
|
||||
assert.sameValue(c.$(1), 1);
|
||||
assert.sameValue(c._(1), 1);
|
||||
assert.sameValue(c.\u{6F}(1), 1);
|
||||
assert.sameValue(c.℘(1), 1);
|
||||
assert.sameValue(c.ZW__NJ(1), 1);
|
||||
assert.sameValue(c.ZW__J(1), 1);
|
|
@ -0,0 +1,108 @@
|
|||
// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: Valid PrivateName as private getter
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
...
|
||||
;
|
||||
|
||||
MethodDefinition :
|
||||
...
|
||||
get ClassElementName ( ){ FunctionBody }
|
||||
...
|
||||
|
||||
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: productions
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
get #$() {
|
||||
return this.#$_;
|
||||
}
|
||||
get #_() {
|
||||
return this.#__;
|
||||
}
|
||||
get #\u{6F}() {
|
||||
return this.#\u{6F}_;
|
||||
}
|
||||
get #\u2118() {
|
||||
return this.#\u2118_;
|
||||
}
|
||||
get #ZW_\u200C_NJ() {
|
||||
return this.#ZW_\u200C_NJ_;
|
||||
}
|
||||
get #ZW_\u200D_J() {
|
||||
return this.#ZW_\u200D_J_;
|
||||
}
|
||||
|
||||
//- privateinspectionfunctions
|
||||
$(value) {
|
||||
this.#$_ = value;
|
||||
return this.#$;
|
||||
}
|
||||
_(value) {
|
||||
this.#__ = value;
|
||||
return this.#_;
|
||||
}
|
||||
\u{6F}(value) {
|
||||
this.#\u{6F}_ = value;
|
||||
return this.#\u{6F};
|
||||
}
|
||||
\u2118(value) {
|
||||
this.#\u2118_ = value;
|
||||
return this.#\u2118;
|
||||
}
|
||||
ZW_\u200C_NJ(value) {
|
||||
this.#ZW_\u200C_NJ_ = value;
|
||||
return this.#ZW_\u200C_NJ;
|
||||
}
|
||||
ZW_\u200D_J(value) {
|
||||
this.#ZW_\u200D_J_ = value;
|
||||
return this.#ZW_\u200D_J;
|
||||
}
|
||||
|
||||
//- assertions
|
||||
assert.sameValue(c.$(1), 1);
|
||||
assert.sameValue(c._(1), 1);
|
||||
assert.sameValue(c.\u{6F}(1), 1);
|
||||
assert.sameValue(c.\u2118(1), 1);
|
||||
assert.sameValue(c.ZW_\u200C_NJ(1), 1);
|
||||
assert.sameValue(c.ZW_\u200D_J(1), 1);
|
|
@ -0,0 +1,107 @@
|
|||
// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: Valid PrivateName as private method
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
...
|
||||
;
|
||||
|
||||
MethodDefinition :
|
||||
ClassElementName ( UniqueFormalParameters ) { FunctionBody }
|
||||
...
|
||||
|
||||
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: productions
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
#$() {
|
||||
return this.#$_;
|
||||
}
|
||||
#_() {
|
||||
return this.#__;
|
||||
}
|
||||
#\u{6F}() {
|
||||
return this.#\u{6F}_;
|
||||
}
|
||||
#℘() {
|
||||
return this.#℘_;
|
||||
}
|
||||
#ZW__NJ() {
|
||||
return this.#ZW__NJ_;
|
||||
}
|
||||
#ZW__J() {
|
||||
return this.#ZW__J_;
|
||||
}
|
||||
|
||||
//- privateinspectionfunctions
|
||||
$(value) {
|
||||
this.#$_ = value;
|
||||
return this.#$();
|
||||
}
|
||||
_(value) {
|
||||
this.#__ = value;
|
||||
return this.#_();
|
||||
}
|
||||
\u{6F}(value) {
|
||||
this.#\u{6F}_ = value;
|
||||
return this.#\u{6F}();
|
||||
}
|
||||
℘(value) {
|
||||
this.#℘_ = value;
|
||||
return this.#℘();
|
||||
}
|
||||
ZW__NJ(value) {
|
||||
this.#ZW__NJ_ = value;
|
||||
return this.#ZW__NJ();
|
||||
}
|
||||
ZW__J(value) {
|
||||
this.#ZW__J_ = value;
|
||||
return this.#ZW__J();
|
||||
}
|
||||
|
||||
//- assertions
|
||||
assert.sameValue(c.$(1), 1);
|
||||
assert.sameValue(c._(1), 1);
|
||||
assert.sameValue(c.\u{6F}(1), 1);
|
||||
assert.sameValue(c.℘(1), 1);
|
||||
assert.sameValue(c.ZW__NJ(1), 1);
|
||||
assert.sameValue(c.ZW__J(1), 1);
|
|
@ -0,0 +1,107 @@
|
|||
// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: Valid PrivateName as private method
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
...
|
||||
;
|
||||
|
||||
MethodDefinition :
|
||||
ClassElementName ( UniqueFormalParameters ) { FunctionBody }
|
||||
...
|
||||
|
||||
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: productions
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
#$() {
|
||||
return this.#$_;
|
||||
}
|
||||
#_() {
|
||||
return this.#__;
|
||||
}
|
||||
#\u{6F}() {
|
||||
return this.#\u{6F}_;
|
||||
}
|
||||
#\u2118() {
|
||||
return this.#\u2118_;
|
||||
}
|
||||
#ZW_\u200C_NJ() {
|
||||
return this.#ZW_\u200C_NJ_;
|
||||
}
|
||||
#ZW_\u200D_J() {
|
||||
return this.#ZW_\u200D_J_;
|
||||
}
|
||||
|
||||
//- privateinspectionfunctions
|
||||
$(value) {
|
||||
this.#$_ = value;
|
||||
return this.#$();
|
||||
}
|
||||
_(value) {
|
||||
this.#__ = value;
|
||||
return this.#_();
|
||||
}
|
||||
\u{6F}(value) {
|
||||
this.#\u{6F}_ = value;
|
||||
return this.#\u{6F}();
|
||||
}
|
||||
\u2118(value) {
|
||||
this.#\u2118_ = value;
|
||||
return this.#\u2118();
|
||||
}
|
||||
ZW_\u200C_NJ(value) {
|
||||
this.#ZW_\u200C_NJ_ = value;
|
||||
return this.#ZW_\u200C_NJ();
|
||||
}
|
||||
ZW_\u200D_J(value) {
|
||||
this.#ZW_\u200D_J_ = value;
|
||||
return this.#ZW_\u200D_J();
|
||||
}
|
||||
|
||||
//- assertions
|
||||
assert.sameValue(c.$(1), 1);
|
||||
assert.sameValue(c._(1), 1);
|
||||
assert.sameValue(c.\u{6F}(1), 1);
|
||||
assert.sameValue(c.\u2118(1), 1);
|
||||
assert.sameValue(c.ZW_\u200C_NJ(1), 1);
|
||||
assert.sameValue(c.ZW_\u200D_J(1), 1);
|
|
@ -0,0 +1,107 @@
|
|||
// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: Valid PrivateName as private setter
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
...
|
||||
;
|
||||
|
||||
MethodDefinition :
|
||||
...
|
||||
set ClassElementName ( PropertySetParameterList ) { FunctionBody }
|
||||
|
||||
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: productions
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
set #$(value) {
|
||||
this.#$_ = value;
|
||||
}
|
||||
set #_(value) {
|
||||
this.#__ = value;
|
||||
}
|
||||
set #\u{6F}(value) {
|
||||
this.#\u{6F}_ = value;
|
||||
}
|
||||
set #℘(value) {
|
||||
this.#℘_ = value;
|
||||
}
|
||||
set #ZW__NJ(value) {
|
||||
this.#ZW__NJ_ = value;
|
||||
}
|
||||
set #ZW__J(value) {
|
||||
this.#ZW__J_ = value;
|
||||
}
|
||||
|
||||
//- privateinspectionfunctions
|
||||
$(value) {
|
||||
this.#$ = value;
|
||||
return this.#$_;
|
||||
}
|
||||
_(value) {
|
||||
this.#_ = value;
|
||||
return this.#__;
|
||||
}
|
||||
\u{6F}(value) {
|
||||
this.#\u{6F} = value;
|
||||
return this.#\u{6F}_;
|
||||
}
|
||||
℘(value) {
|
||||
this.#℘ = value;
|
||||
return this.#℘_;
|
||||
}
|
||||
ZW__NJ(value) {
|
||||
this.#ZW__NJ = value;
|
||||
return this.#ZW__NJ_;
|
||||
}
|
||||
ZW__J(value) {
|
||||
this.#ZW__J = value;
|
||||
return this.#ZW__J_;
|
||||
}
|
||||
|
||||
//- assertions
|
||||
assert.sameValue(c.$(1), 1);
|
||||
assert.sameValue(c._(1), 1);
|
||||
assert.sameValue(c.\u{6F}(1), 1);
|
||||
assert.sameValue(c.℘(1), 1);
|
||||
assert.sameValue(c.ZW__NJ(1), 1);
|
||||
assert.sameValue(c.ZW__J(1), 1);
|
|
@ -0,0 +1,107 @@
|
|||
// Copyright (C) 2018 Kubilay Kahveci (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: Valid PrivateName as private setter
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
...
|
||||
;
|
||||
|
||||
MethodDefinition :
|
||||
...
|
||||
set ClassElementName ( PropertySetParameterList ) { FunctionBody }
|
||||
|
||||
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: productions
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
set #$(value) {
|
||||
this.#$_ = value;
|
||||
}
|
||||
set #_(value) {
|
||||
this.#__ = value;
|
||||
}
|
||||
set #\u{6F}(value) {
|
||||
this.#\u{6F}_ = value;
|
||||
}
|
||||
set #\u2118(value) {
|
||||
this.#\u2118_ = value;
|
||||
}
|
||||
set #ZW_\u200C_NJ(value) {
|
||||
this.#ZW_\u200C_NJ_ = value;
|
||||
}
|
||||
set #ZW_\u200D_J(value) {
|
||||
this.#ZW_\u200D_J_ = value;
|
||||
}
|
||||
|
||||
//- privateinspectionfunctions
|
||||
$(value) {
|
||||
this.#$ = value;
|
||||
return this.#$_;
|
||||
}
|
||||
_(value) {
|
||||
this.#_ = value;
|
||||
return this.#__;
|
||||
}
|
||||
\u{6F}(value) {
|
||||
this.#\u{6F} = value;
|
||||
return this.#\u{6F}_;
|
||||
}
|
||||
\u2118(value) {
|
||||
this.#\u2118 = value;
|
||||
return this.#\u2118_;
|
||||
}
|
||||
ZW_\u200C_NJ(value) {
|
||||
this.#ZW_\u200C_NJ = value;
|
||||
return this.#ZW_\u200C_NJ_;
|
||||
}
|
||||
ZW_\u200D_J(value) {
|
||||
this.#ZW_\u200D_J = value;
|
||||
return this.#ZW_\u200D_J_;
|
||||
}
|
||||
|
||||
//- assertions
|
||||
assert.sameValue(c.$(1), 1);
|
||||
assert.sameValue(c._(1), 1);
|
||||
assert.sameValue(c.\u{6F}(1), 1);
|
||||
assert.sameValue(c.\u2118(1), 1);
|
||||
assert.sameValue(c.ZW_\u200C_NJ(1), 1);
|
||||
assert.sameValue(c.ZW_\u200D_J(1), 1);
|
Loading…
Reference in New Issue