From 9c2445eba86b0f6d2dee00d1f66e94df420924cb Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 18 Dec 2023 16:06:16 -0800 Subject: [PATCH] fix(evasive-transform): Do not use ?? nor ?. operators --- packages/evasive-transform/src/generate.js | 4 +++- packages/evasive-transform/src/index.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/evasive-transform/src/generate.js b/packages/evasive-transform/src/generate.js index c946f7661c..a00bd2df15 100644 --- a/packages/evasive-transform/src/generate.js +++ b/packages/evasive-transform/src/generate.js @@ -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), diff --git a/packages/evasive-transform/src/index.js b/packages/evasive-transform/src/index.js index 75d02f72f5..da4b05eae0 100644 --- a/packages/evasive-transform/src/index.js +++ b/packages/evasive-transform/src/index.js @@ -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;