Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid usage of logical nullish assignment for node 14 compatibility #1015

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/system/keyboard.ts
Expand Up @@ -98,7 +98,7 @@ export class KeyboardHost {
const target = getActiveElementOrBody(config.document)
this.setKeydownTarget(target)

this.pressed[code] ??= {
this.pressed[code] = this.pressed[code] ?? {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about the eslint as that would mean if I understand correctly that the ??= is unnecessary here and we not even need a fallback?

/cc @ph-fritsche

keyDef,
unpreventedDefault: false,
}
Expand Down
2 changes: 1 addition & 1 deletion src/system/pointer/index.ts
Expand Up @@ -41,7 +41,7 @@ export class PointerHost {
private registry = {} as Record<string, Device>

get(k: string) {
this.registry[k] ??= new Device()
this.registry[k] = this.registry[k] ?? new Device()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above here 🤔

return this.registry[k]
}
})()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/misc/level.ts
Expand Up @@ -16,7 +16,7 @@ declare module '../../setup' {
}

export function setLevelRef(config: Config, level: ApiLevel) {
config[Level] ??= {}
config[Level] = config[Level] ?? {}
config[Level][level] = {}
}

Expand Down