Skip to content

Commit

Permalink
fix(evasive-transform): Do not use ?? nor ?. operators
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Dec 19, 2023
1 parent 15b543a commit 9c2445e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/evasive-transform/src/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ const { default: generator } = /** @type {any} */ (babelGenerate);
export const generate =
/** @type {GenerateAstWithSourceMap & GenerateAstWithoutSourceMap} */ (
(ast, options) => {
const sourceUrl = options?.sourceUrl;
// TODO Use options?.sourceUrl when resolved:
// https://github.com/Agoric/agoric-sdk/issues/8671
const sourceUrl = options ? options.sourceUrl : undefined;
const result = generator(ast, {
sourceFileName: sourceUrl,
sourceMaps: Boolean(sourceUrl),
Expand Down
4 changes: 3 additions & 1 deletion packages/evasive-transform/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ import { generate } from './generate.js';
* @public
*/
export async function evadeCensor(source, options) {
const { sourceMap, sourceUrl, useLocationUnmap, sourceType } = options ?? {};
// TODO Use options ?? {} when resolved:
// https://github.com/Agoric/agoric-sdk/issues/8671
const { sourceMap, sourceUrl, useLocationUnmap, sourceType } = options || {};

// See "Chesterton's Fence"
await null;
Expand Down

0 comments on commit 9c2445e

Please sign in to comment.