2020-05-05 09:19:02 +02:00
Test static private class methods
Running test: testScopesPaused
2023-03-30 12:11:08 +02:00
private members on the base class
privateProperties from Runtime.getProperties()
2020-05-05 09:19:02 +02:00
[
[0] : {
name : #writeOnly
set : {
className : Function
description : set #writeOnly(val) { this.#field = val; }
objectId : <objectId>
type : function
}
}
[1] : {
get : {
className : Function
description : get #readOnly() { return this.#field; }
objectId : <objectId>
type : function
}
name : #readOnly
}
[2] : {
get : {
className : Function
description : get #accessor() { return this.#field; }
objectId : <objectId>
type : function
}
name : #accessor
set : {
className : Function
description : set #accessor(val) { this.#field = val; }
objectId : <objectId>
type : function
}
}
[3] : {
name : #field
value : {
description : 2
type : number
value : 2
}
}
]
2023-03-30 12:11:08 +02:00
[[PrivateMethods]] in internalProperties from Runtime.getProperties()
{
name : [[PrivateMethods]]
value : {
className : Array
description : PrivateMethods[1]
objectId : <objectId>
subtype : internal#privateMethodList
type : object
}
}
{
result : [
[0] : {
configurable : true
enumerable : true
isOwn : true
name : 0
value : {
className : Object
description : #inc() { return ++A.#accessor; }
objectId : <objectId>
subtype : internal#privateMethod
type : object
}
writable : true
}
]
}
2020-05-05 09:19:02 +02:00
Evaluating A.#inc();
{
result : {
description : 3
type : number
value : 3
}
}
Evaluating this.#inc();
{
result : {
description : 4
type : number
value : 4
}
}
Evaluating ++this.#accessor;
{
result : {
description : 5
type : number
value : 5
}
}
Evaluating this.#readOnly;
{
result : {
description : 5
type : number
value : 5
}
}
Evaluating this.#writeOnly = 0; this.#field;
{
result : {
description : 0
type : number
value : 0
}
}
2023-03-30 12:11:08 +02:00
private members on the subclass
privateProperties from Runtime.getProperties()
2020-05-05 09:19:02 +02:00
[
[0] : {
get : {
className : Function
description : get #accessor() { return 'subclassAccessor'; }
objectId : <objectId>
type : function
}
name : #accessor
}
]
2023-03-30 12:11:08 +02:00
[[PrivateMethods]] in internalProperties from Runtime.getProperties()
{
name : [[PrivateMethods]]
value : {
className : Array
description : PrivateMethods[1]
objectId : <objectId>
subtype : internal#privateMethodList
type : object
}
}
{
result : [
[0] : {
configurable : true
enumerable : true
isOwn : true
name : 0
value : {
className : Object
description : #subclassMethod() { return B.#accessor; }
objectId : <objectId>
subtype : internal#privateMethod
type : object
}
writable : true
}
]
}
2020-05-05 09:19:02 +02:00
Evaluating this.#inc(); from the base class
{
exceptionDetails : {
columnNumber : 4
exception : {
className : SyntaxError
2022-04-19 09:00:36 +02:00
description : SyntaxError: Private field '#inc' must be declared in an enclosing class at B.test (<anonymous>:24:7) at run (<anonymous>:28:5) at <anonymous>:1:1
2020-05-05 09:19:02 +02:00
objectId : <objectId>
subtype : error
type : object
}
exceptionId : <exceptionId>
lineNumber : 0
scriptId : <scriptId>
text : Uncaught
}
result : {
className : SyntaxError
2022-04-19 09:00:36 +02:00
description : SyntaxError: Private field '#inc' must be declared in an enclosing class at B.test (<anonymous>:24:7) at run (<anonymous>:28:5) at <anonymous>:1:1
2020-05-05 09:19:02 +02:00
objectId : <objectId>
subtype : error
type : object
}
}
Evaluating this.#subclassMethod();
{
result : {
type : string
value : subclassAccessor
}
}