| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent aa67b5b commit bec6856
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,9 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + function multiply(a: number, b: number): number { | ||
| 4 | + return a * b; | ||
| 5 | + } | ||
| 6 | + | ||
| 7 | + const x: number = 7; | ||
| 8 | + const y: number = 8; | ||
| 9 | + const result: number = multiply(x, y); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,50 @@ | |||
| 1 | + // Tests that probe mode works with type stripping. | ||
| 2 | + 'use strict'; | ||
| 3 | + | ||
| 4 | + const common = require('../common'); | ||
| 5 | + common.skipIfInspectorDisabled(); | ||
| 6 | + | ||
| 7 | + const fixtures = require('../common/fixtures'); | ||
| 8 | + const { spawnSyncAndAssert } = require('../common/child_process'); | ||
| 9 | + const { assertProbeJson } = require('../common/debugger-probe'); | ||
| 10 | + | ||
| 11 | + const cwd = fixtures.path('debugger'); | ||
| 12 | + const tsUrl = fixtures.fileURL('debugger', 'probe-typescript.ts').href; | ||
| 13 | + | ||
| 14 | + spawnSyncAndAssert(process.execPath, [ | ||
| 15 | + 'inspect', | ||
| 16 | + '--json', | ||
| 17 | + '--probe', 'probe-typescript.ts:9', | ||
| 18 | + '--expr', 'x', | ||
| 19 | + '--probe', 'probe-typescript.ts:9', | ||
| 20 | + '--expr', 'y', | ||
| 21 | + 'probe-typescript.ts', | ||
| 22 | + ], { cwd }, { | ||
| 23 | + stdout(output) { | ||
| 24 | + assertProbeJson(output, { | ||
| 25 | + v: 2, | ||
| 26 | + probes: [ | ||
| 27 | + { expr: 'x', target: { suffix: 'probe-typescript.ts', line: 9 } }, | ||
| 28 | + { expr: 'y', target: { suffix: 'probe-typescript.ts', line: 9 } }, | ||
| 29 | + ], | ||
| 30 | + results: [ | ||
| 31 | + { | ||
| 32 | + probe: 0, | ||
| 33 | + event: 'hit', | ||
| 34 | + hit: 1, | ||
| 35 | + location: { url: tsUrl, line: 9, column: 24 }, | ||
| 36 | + result: { type: 'number', value: 7, description: '7' }, | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + probe: 1, | ||
| 40 | + event: 'hit', | ||
| 41 | + hit: 1, | ||
| 42 | + location: { url: tsUrl, line: 9, column: 24 }, | ||
| 43 | + result: { type: 'number', value: 8, description: '8' }, | ||
| 44 | + }, | ||
| 45 | + { event: 'completed' }, | ||
| 46 | + ], | ||
| 47 | + }); | ||
| 48 | + }, | ||
| 49 | + trim: true, | ||
| 50 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments