Skip to content

Commit f7cd6d2

Browse files
committed
Make use #private instance field
1 parent 4405b6a commit f7cd6d2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/decoder.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ import { EnrichedSourceMap, RelativeFunctionDesc } from "./types.js";
1919

2020
import * as vlq from "vlq";
2121

22-
const _functionDescs = Symbol("functionDescs");
23-
2422
/**
2523
* Provides a utility to decode a coordinate in a source file
2624
* into the enclosing function name.
2725
*/
2826
export class SourceMapDecoder {
29-
private [_functionDescs]: Map<string, FunctionDesc[]>;
27+
#functionDescs: Map<string, FunctionDesc[]>;
3028

3129
/**
3230
* Initializes the `SourceMapDecoder`
@@ -36,7 +34,7 @@ export class SourceMapDecoder {
3634
*/
3735
constructor(sourceMap: EnrichedSourceMap) {
3836
validateSourceMap(sourceMap);
39-
this[_functionDescs] = decodeSources(sourceMap);
37+
this.#functionDescs = decodeSources(sourceMap);
4038
}
4139

4240
/**
@@ -54,8 +52,8 @@ export class SourceMapDecoder {
5452
line: number,
5553
column: number
5654
): string | null {
57-
const descs = this[_functionDescs].get(source);
58-
// `null` entries in the source map become empty arrays in `[_functionDescs]`
55+
const descs = this.#functionDescs.get(source);
56+
// `null` entries in the source map become empty arrays in `#functionDescs`
5957
// so `descs === undefined` means `source` is not present in the source map
6058
if (!descs) {
6159
throw Error(`source ${source} not found in source map`);

0 commit comments

Comments
 (0)