1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
=== tests/cases/conformance/salsa/use.js ===
var npmlog = require('./npmlog')
>npmlog : typeof EE
>require('./npmlog') : typeof EE
>require : any
>'./npmlog' : "./npmlog"
npmlog.x
>npmlog.x : number
>npmlog : typeof EE
>x : number
npmlog.on
>npmlog.on : (s: string) => void
>npmlog : typeof EE
>on : (s: string) => void
=== tests/cases/conformance/salsa/npmlog.js ===
class EE {
>EE : EE
/** @param {string} s */
on(s) { }
>on : (s: string) => void
>s : string
}
var npmlog = module.exports = new EE()
>npmlog : typeof EE
>module.exports = new EE() : typeof EE
>module.exports : typeof EE
>module : { "tests/cases/conformance/salsa/npmlog": typeof EE; }
>exports : typeof EE
>new EE() : EE
>EE : typeof EE
npmlog.on('hi') // both references should see EE.on
>npmlog.on('hi') : void
>npmlog.on : (s: string) => void
>npmlog : typeof EE
>on : (s: string) => void
>'hi' : "hi"
module.exports.on('hi') // here too
>module.exports.on('hi') : void
>module.exports.on : (s: string) => void
>module.exports : typeof EE
>module : { "tests/cases/conformance/salsa/npmlog": typeof EE; }
>exports : typeof EE
>on : (s: string) => void
>'hi' : "hi"
npmlog.x = 1
>npmlog.x = 1 : 1
>npmlog.x : number
>npmlog : typeof EE
>x : number
>1 : 1
module.exports.y = 2
>module.exports.y = 2 : 2
>module.exports.y : number
>module.exports : typeof EE
>module : { "tests/cases/conformance/salsa/npmlog": typeof EE; }
>exports : typeof EE
>y : number
>2 : 2
npmlog.y
>npmlog.y : number
>npmlog : typeof EE
>y : number
module.exports.x
>module.exports.x : number
>module.exports : typeof EE
>module : { "tests/cases/conformance/salsa/npmlog": typeof EE; }
>exports : typeof EE
>x : number
|