From 459cbed33b104f9d448df076e8c9903f253f8b78 Mon Sep 17 00:00:00 2001 From: zuckjet Date: Fri, 4 Feb 2022 12:02:58 +0800 Subject: [PATCH] refactor(dev-infra): convert nullish coalescing operator to plain javascript (#44968) low version nodejs doesn't support nullish coalescing operator very well PR Close #44968 --- tools/postinstall-patches.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/postinstall-patches.js b/tools/postinstall-patches.js index 0af340c046a..4e22d1ea47d 100644 --- a/tools/postinstall-patches.js +++ b/tools/postinstall-patches.js @@ -68,7 +68,8 @@ const captureNgDevPatches = (files, patches) => patches.forEach(p => _captureNgDevPatch(p[0], p[1], files)); const _captureNgDevPatch = (search, replace, files) => { for (const fileName of files) { - const currentPatches = ngDevPatches.get(fileName) ?? []; + const patches = ngDevPatches.get(fileName); + const currentPatches = (patches !== null && patches !== undefined) ? patches : []; ngDevPatches.set(fileName, [...currentPatches, [search, replace]]); } };