Skip to content

Commit ab627d7

Browse files
committed
doc: clarify sourceMap.payload behavior and immutability
1 parent 73ffd8a commit ab627d7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

doc/api/module.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,9 @@ generated code.
19701970
19711971
Getter for the payload used to construct the [`SourceMap`][] instance.
19721972
1973+
The returned object is frozen with [`Object.freeze()`][], and the same
1974+
reference is returned on every access. Do not mutate the returned object.
1975+
19731976
#### `sourceMap.findEntry(lineOffset, columnOffset)`
19741977
19751978
* `lineOffset` {number} The zero-indexed line number offset in
@@ -2065,6 +2068,7 @@ returned object contains the following keys:
20652068
[`module`]: #the-module-object
20662069
[`os.tmpdir()`]: os.md#ostmpdir
20672070
[`register`]: #moduleregisterspecifier-parenturl-options
2071+
[`Object.freeze()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
20682072
[`util.TextDecoder`]: util.md#class-utiltextdecoder
20692073
[accepted final formats]: #accepted-final-formats-returned-by-load
20702074
[asynchronous `load` hook]: #asynchronous-loadurl-context-nextload

0 commit comments

Comments
 (0)