mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 12:45:25 +00:00

PR-URL: https://github.com/nodejs/node/pull/47251 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
294 lines
7.2 KiB
Plaintext
294 lines
7.2 KiB
Plaintext
Test private class methods
|
|
|
|
Running test: testScopesPaused
|
|
privateProperties from Runtime.getProperties()
|
|
[
|
|
[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
|
|
}
|
|
}
|
|
]
|
|
[[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() { this.#field++; return this.#field; }
|
|
objectId : <objectId>
|
|
subtype : internal#privateMethod
|
|
type : object
|
|
}
|
|
writable : true
|
|
}
|
|
]
|
|
}
|
|
private accessors properties on the base class instance
|
|
privateProperties from Runtime.getProperties()
|
|
[
|
|
[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
|
|
}
|
|
}
|
|
]
|
|
Evaluating private methods
|
|
{
|
|
result : {
|
|
description : 3
|
|
type : number
|
|
value : 3
|
|
}
|
|
}
|
|
Evaluating private methods
|
|
{
|
|
result : {
|
|
description : 4
|
|
type : number
|
|
value : 4
|
|
}
|
|
}
|
|
Evaluating private accessors
|
|
{
|
|
result : {
|
|
description : 5
|
|
type : number
|
|
value : 5
|
|
}
|
|
}
|
|
Evaluating read-only accessor
|
|
{
|
|
result : {
|
|
description : 5
|
|
type : number
|
|
value : 5
|
|
}
|
|
}
|
|
Evaluating write-only accessor
|
|
{
|
|
result : {
|
|
description : 0
|
|
type : number
|
|
value : 0
|
|
}
|
|
}
|
|
private members on the subclass instance
|
|
privateProperties from Runtime.getProperties()
|
|
[
|
|
[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
|
|
}
|
|
}
|
|
]
|
|
[[PrivateMethods]] in internalProperties from Runtime.getProperties()
|
|
{
|
|
name : [[PrivateMethods]]
|
|
value : {
|
|
className : Array
|
|
description : PrivateMethods[3]
|
|
objectId : <objectId>
|
|
subtype : internal#privateMethodList
|
|
type : object
|
|
}
|
|
}
|
|
{
|
|
result : [
|
|
[0] : {
|
|
configurable : true
|
|
enumerable : true
|
|
isOwn : true
|
|
name : 0
|
|
value : {
|
|
className : Object
|
|
description : #inc() { this.#field++; return this.#field; }
|
|
objectId : <objectId>
|
|
subtype : internal#privateMethod
|
|
type : object
|
|
}
|
|
writable : true
|
|
}
|
|
[1] : {
|
|
configurable : true
|
|
enumerable : true
|
|
isOwn : true
|
|
name : 1
|
|
value : {
|
|
className : Object
|
|
description : #subclassMethod() { return 'subclassMethod'; }
|
|
objectId : <objectId>
|
|
subtype : internal#privateMethod
|
|
type : object
|
|
}
|
|
writable : true
|
|
}
|
|
[2] : {
|
|
configurable : true
|
|
enumerable : true
|
|
isOwn : true
|
|
name : 2
|
|
value : {
|
|
className : Object
|
|
description : #inc() { return 'subclass #inc'; }
|
|
objectId : <objectId>
|
|
subtype : internal#privateMethod
|
|
type : object
|
|
}
|
|
writable : true
|
|
}
|
|
]
|
|
}
|
|
Evaluating private methods in the base class from the subclass
|
|
{
|
|
exceptionDetails : {
|
|
columnNumber : 4
|
|
exception : {
|
|
className : SyntaxError
|
|
description : SyntaxError: Private field '#subclassMethod' must be declared in an enclosing class at B.fn (<anonymous>:20:7) at run (<anonymous>:34:5) at <anonymous>:1:1
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
text : Uncaught
|
|
}
|
|
result : {
|
|
className : SyntaxError
|
|
description : SyntaxError: Private field '#subclassMethod' must be declared in an enclosing class at B.fn (<anonymous>:20:7) at run (<anonymous>:34:5) at <anonymous>:1:1
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
}
|
|
Evaluating private method in the subclass from the subclass
|
|
{
|
|
result : {
|
|
type : string
|
|
value : subclassMethod
|
|
}
|
|
}
|
|
Evaluating private method shadowing the base class method
|
|
{
|
|
result : {
|
|
type : string
|
|
value : subclass #inc
|
|
}
|
|
}
|