We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52c18b4 commit 623a775Copy full SHA for 623a775
lib/util/track.js
@@ -8,13 +8,17 @@
8
* This info isn’t used yet but suchs functionality allows line wrapping,
9
* and theoretically source maps (though, is there practical use in that?).
10
*
11
- * @param {TrackFields} options
+ * @param {TrackFields} options_
12
*/
13
-export function track(options) {
14
- const now = options.now
15
- let lineShift = options.lineShift
16
- let line = now.line
17
- let column = now.column
+export function track(options_) {
+ // Defaults are used to prevent crashes when older utilities somehow activate
+ // this code.
+ /* c8 ignore next 5 */
+ const options = options_ || {}
18
+ const now = options.now || {}
19
+ let lineShift = options.lineShift || 0
20
+ let line = now.line || 1
21
+ let column = now.column || 1
22
23
return {move, current, shift}
24
0 commit comments