Skip to content

Commit

Permalink
feat: more nullish coalescing (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton authored Apr 21, 2022
1 parent 6fac396 commit 4e0ec4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/near-membrane-base/src/membrane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export function createMembraneMarshall(isInShadowRealm?: boolean) {
// Safari 12 on iOS 12.1 has a `this` of `undefined` so we
// fallback to `self`.
// eslint-disable-next-line no-restricted-globals
return this || self;
return this ?? self;
},
} as PropertyDescriptor),
globalThis);
Expand Down
2 changes: 1 addition & 1 deletion packages/near-membrane-dom/src/browser-realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function createDetachableIframe(): HTMLIFrameElement {
// It is impossible to test whether the NodeProtoLastChildGetter branch is
// reached in a normal Karma test environment.
const parent =
ReflectApply(DocumentProtoBodyGetter, docRef, []) ||
ReflectApply(DocumentProtoBodyGetter, docRef, []) ??
/* istanbul ignore next */ ReflectApply(NodeProtoLastChildGetter, docRef, []);
const style = ReflectApply(HTMLElementProtoStyleGetter, iframe, []);
style.display = 'none';
Expand Down
4 changes: 2 additions & 2 deletions scripts/rollup/plugins/babel-output.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ module.exports = {
// https://github.com/babel/babel/blob/v7.15.6/packages/babel-core/src/config/files/configuration.ts#L24
const configPath =
// prettier-ignore
options.configFile ||
(await globby([`${path.resolve('.babelrc')}{,.js,.cjs,.mjs,.json}`]))[0] ||
options.configFile ??
(await globby([`${path.resolve('.babelrc')}{,.js,.cjs,.mjs,.json}`]))[0] ??
(await globby([`${path.resolve(rootPath, 'babel.config')}{.js,.cjs,.mjs,.json}`]))[0];
const config =
path.extname(configPath) === '.json'
Expand Down

0 comments on commit 4e0ec4a

Please sign in to comment.