0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-28 14:33:11 +01:00
nodejs/test/fixtures/source-map/no-throw.ts
Chengzhong Wu c0c598d753
lib: allow CJS source map cache to be reclaimed
Unifies the CJS and ESM source map cache map with SourceMapCacheMap
and allows the CJS cache entries to be queried more efficiently with
a source url without iteration on an IterableWeakMap.

Add a test to verify that the CJS source map cache entry can be
reclaimed.

PR-URL: https://github.com/nodejs/node/pull/51711
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-28 22:56:56 +00:00

43 lines
523 B
TypeScript

class Foo {
x;
constructor (x = 33) {
this.x = x ? x : 99
if (this.x) {
this.methodA()
} else {
this.methodB()
}
this.methodC()
}
methodA () {
}
methodB () {
}
methodC () {
}
methodD () {
}
}
const a = new Foo(0)
const b = new Foo(33)
a.methodD()
declare const module: {
exports: any
}
module.exports = {
a,
b,
Foo,
}
// To recreate:
//
// npx tsc --outDir test/fixtures/source-map --inlineSourceMap --inlineSources test/fixtures/source-map/no-throw.ts