class-private-methods-unused-expected.txt 2.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
Test accessing unused private methods at runtime

Running test: testScopesPaused
Get privateProperties of A in testStatic()
[
    [0] : {
        name : #staticMethod
        value : {
            className : Function
            description : #staticMethod() { return 1; }
11
            objectId : <objectId>
12 13 14 15 16 17 18 19 20 21 22
            type : function
        }
    }
]
Access A.#staticMethod() in testStatic()
{
    exceptionDetails : {
        columnNumber : 0
        exception : {
            className : ReferenceError
            description : ReferenceError: A is not defined     at eval (eval at testStatic (:1:1), <anonymous>:1:1)     at Function.testStatic (<anonymous>:6:29)     at run (<anonymous>:9:7)     at <anonymous>:1:1
23
            objectId : <objectId>
24 25 26
            subtype : error
            type : object
        }
27
        exceptionId : <exceptionId>
28
        lineNumber : 0
29
        scriptId : <scriptId>
30 31 32 33 34
        text : Uncaught
    }
    result : {
        className : ReferenceError
        description : ReferenceError: A is not defined     at eval (eval at testStatic (:1:1), <anonymous>:1:1)     at Function.testStatic (<anonymous>:6:29)     at run (<anonymous>:9:7)     at <anonymous>:1:1
35
        objectId : <objectId>
36 37 38 39 40 41 42
        subtype : error
        type : object
    }
}
Access this.#staticMethod() in testStatic()
{
    exceptionDetails : {
43
        columnNumber : 5
44 45
        exception : {
            className : Error
46
            description : Error: Unused static private method '#staticMethod' cannot be accessed at debug time     at eval (eval at testStatic (:1:1), <anonymous>:1:6)     at Function.testStatic (<anonymous>:6:29)     at run (<anonymous>:9:7)     at <anonymous>:1:1
47
            objectId : <objectId>
48 49 50
            subtype : error
            type : object
        }
51
        exceptionId : <exceptionId>
52
        lineNumber : 0
53
        scriptId : <scriptId>
54 55 56 57
        text : Uncaught
    }
    result : {
        className : Error
58
        description : Error: Unused static private method '#staticMethod' cannot be accessed at debug time     at eval (eval at testStatic (:1:1), <anonymous>:1:6)     at Function.testStatic (<anonymous>:6:29)     at run (<anonymous>:9:7)     at <anonymous>:1:1
59
        objectId : <objectId>
60 61 62 63 64 65 66 67 68 69 70
        subtype : error
        type : object
    }
}
get privateProperties of a in testInstance()
[
    [0] : {
        name : #instanceMethod
        value : {
            className : Function
            description : #instanceMethod() { return 2; }
71
            objectId : <objectId>
72 73 74 75 76 77 78 79 80 81 82 83
            type : function
        }
    }
]
Evaluating this.#instanceMethod() in testInstance()
{
    result : {
        description : 2
        type : number
        value : 2
    }
}