forked from LeenkxTeam/Kmake
56 lines
1.4 KiB
Plaintext
56 lines
1.4 KiB
Plaintext
|
|
Evaluate conflicting private class member out of class scope in Runtime.evaluate()
|
||
|
|
|
||
|
|
class Klass {
|
||
|
|
#name = "string";
|
||
|
|
}
|
||
|
|
class ClassWithField extends Klass {
|
||
|
|
#name = "child";
|
||
|
|
}
|
||
|
|
class ClassWithMethod extends Klass {
|
||
|
|
#name() {}
|
||
|
|
}
|
||
|
|
class ClassWithAccessor extends Klass {
|
||
|
|
get #name() {}
|
||
|
|
set #name(val) {}
|
||
|
|
}
|
||
|
|
class StaticClass extends Klass {
|
||
|
|
static #name = "child";
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
Running test: evaluatePrivateMembers
|
||
|
|
Runtime.evaluate: `(new ClassWithField).#name`
|
||
|
|
{
|
||
|
|
className : Error
|
||
|
|
description : Error: Operation is ambiguous because there are more than one private name'#name' on the object at <anonymous>:1:2
|
||
|
|
objectId : <objectId>
|
||
|
|
subtype : error
|
||
|
|
type : object
|
||
|
|
}
|
||
|
|
Runtime.evaluate: `(new ClassWithMethod).#name`
|
||
|
|
{
|
||
|
|
className : Error
|
||
|
|
description : Error: Operation is ambiguous because there are more than one private name'#name' on the object at <anonymous>:1:2
|
||
|
|
objectId : <objectId>
|
||
|
|
subtype : error
|
||
|
|
type : object
|
||
|
|
}
|
||
|
|
Runtime.evaluate: `(new ClassWithAccessor).#name`
|
||
|
|
{
|
||
|
|
className : Error
|
||
|
|
description : Error: Operation is ambiguous because there are more than one private name'#name' on the object at <anonymous>:1:2
|
||
|
|
objectId : <objectId>
|
||
|
|
subtype : error
|
||
|
|
type : object
|
||
|
|
}
|
||
|
|
Runtime.evaluate: `StaticClass.#name`
|
||
|
|
{
|
||
|
|
type : string
|
||
|
|
value : child
|
||
|
|
}
|
||
|
|
Runtime.evaluate: `(new StaticClass).#name`
|
||
|
|
{
|
||
|
|
type : string
|
||
|
|
value : string
|
||
|
|
}
|