|
| 1 | +=== tests/cases/compiler/usage.js === |
| 2 | +const { Thing, useThing, cbThing } = require("./index"); |
| 3 | +>Thing : Symbol(Thing, Decl(usage.js, 0, 7)) |
| 4 | +>useThing : Symbol(useThing, Decl(usage.js, 0, 14)) |
| 5 | +>cbThing : Symbol(cbThing, Decl(usage.js, 0, 24)) |
| 6 | +>require : Symbol(require) |
| 7 | +>"./index" : Symbol("tests/cases/compiler/index", Decl(index.js, 0, 0)) |
| 8 | + |
| 9 | +useThing(Thing.a); |
| 10 | +>useThing : Symbol(useThing, Decl(usage.js, 0, 14)) |
| 11 | +>Thing : Symbol(Thing, Decl(usage.js, 0, 7)) |
| 12 | + |
| 13 | +/** |
| 14 | + * @typedef {Object} LogEntry |
| 15 | + * @property {string} type |
| 16 | + * @property {number} time |
| 17 | + */ |
| 18 | + |
| 19 | +cbThing(type => { |
| 20 | +>cbThing : Symbol(cbThing, Decl(usage.js, 0, 24)) |
| 21 | +>type : Symbol(type, Decl(usage.js, 10, 8)) |
| 22 | + |
| 23 | + /** @type {LogEntry} */ |
| 24 | + const logEntry = { |
| 25 | +>logEntry : Symbol(logEntry, Decl(usage.js, 12, 9)) |
| 26 | + |
| 27 | + time: Date.now(), |
| 28 | +>time : Symbol(time, Decl(usage.js, 12, 22)) |
| 29 | +>Date.now : Symbol(DateConstructor.now, Decl(lib.es5.d.ts, --, --)) |
| 30 | +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --)) |
| 31 | +>now : Symbol(DateConstructor.now, Decl(lib.es5.d.ts, --, --)) |
| 32 | + |
| 33 | + type, |
| 34 | +>type : Symbol(type, Decl(usage.js, 13, 25)) |
| 35 | + |
| 36 | + }; |
| 37 | +}); |
| 38 | + |
| 39 | +=== tests/cases/compiler/index.js === |
| 40 | +/** @enum {string} */ |
| 41 | +const Thing = Object.freeze({ |
| 42 | +>Thing : Symbol(Thing, Decl(index.js, 1, 5), Decl(index.js, 0, 4)) |
| 43 | +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 44 | +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 45 | +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 46 | + |
| 47 | + a: "thing", |
| 48 | +>a : Symbol(a, Decl(index.js, 1, 29)) |
| 49 | + |
| 50 | + b: "chill" |
| 51 | +>b : Symbol(b, Decl(index.js, 2, 15)) |
| 52 | + |
| 53 | +}); |
| 54 | + |
| 55 | +exports.Thing = Thing; |
| 56 | +>exports.Thing : Symbol(Thing, Decl(index.js, 4, 3), Decl(index.js, 0, 4)) |
| 57 | +>exports : Symbol(Thing, Decl(index.js, 4, 3), Decl(index.js, 0, 4)) |
| 58 | +>Thing : Symbol(Thing, Decl(index.js, 4, 3), Decl(index.js, 0, 4)) |
| 59 | +>Thing : Symbol(Thing, Decl(index.js, 1, 5), Decl(index.js, 0, 4)) |
| 60 | + |
| 61 | +/** |
| 62 | + * @param {Thing} x |
| 63 | + */ |
| 64 | +function useThing(x) {} |
| 65 | +>useThing : Symbol(useThing, Decl(index.js, 6, 22)) |
| 66 | +>x : Symbol(x, Decl(index.js, 11, 18)) |
| 67 | + |
| 68 | +exports.useThing = useThing; |
| 69 | +>exports.useThing : Symbol(useThing, Decl(index.js, 11, 23)) |
| 70 | +>exports : Symbol(useThing, Decl(index.js, 11, 23)) |
| 71 | +>useThing : Symbol(useThing, Decl(index.js, 11, 23)) |
| 72 | +>useThing : Symbol(useThing, Decl(index.js, 6, 22)) |
| 73 | + |
| 74 | +/** |
| 75 | + * @param {(x: Thing) => void} x |
| 76 | + */ |
| 77 | +function cbThing(x) {} |
| 78 | +>cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) |
| 79 | +>x : Symbol(x, Decl(index.js, 18, 17)) |
| 80 | + |
| 81 | +exports.cbThing = cbThing; |
| 82 | +>exports.cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) |
| 83 | +>exports : Symbol(cbThing, Decl(index.js, 18, 22)) |
| 84 | +>cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) |
| 85 | +>cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) |
| 86 | + |
0 commit comments