Bug 1752347 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Currently, this works for ESLint to recognise it and define `snapshot_overlap_limit` as a global:

```
XPCOMUtils.defineLazyPreferenceGetter(
  this,
  "snapshot_overlap_limit",
  "browser.places.interactions.snapshotOverlapLimit",
  1000
);
```

However this version does not:

```
XPCOMUtils.defineLazyPreferenceGetter(
  this,
  "snapshot_overlap_limit",
  "browser.places.interactions.snapshotOverlapLimit",
  -1
);
```

The issue is that the -1 is unary expression
Currently, this works for ESLint to recognise it and define `snapshot_overlap_limit` as a global:

```
XPCOMUtils.defineLazyPreferenceGetter(
  this,
  "snapshot_overlap_limit",
  "browser.places.interactions.snapshotOverlapLimit",
  1000
);
```

However this version does not:

```
XPCOMUtils.defineLazyPreferenceGetter(
  this,
  "snapshot_overlap_limit",
  "browser.places.interactions.snapshotOverlapLimit",
  -1
);
```

The issue is that the -1 is a unary expression and our AST source handler is not handling those expressions.

Back to Bug 1752347 Comment 0