Skip to content

Commit aa0d563

Browse files
authored
Fix Node.js v14 compatibility by replacing ??= operator with equivalent if-null check (#5036)
Fixes #5008
1 parent a70aef7 commit aa0d563

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/transpilers/typescript/transpile-module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ const shouldCheckProjectPkgJsonContent = (fileName: string, moduleKind: ts.Modul
6363
* - Allow using custom AST transformers with the internal created {@link Program}
6464
*/
6565
const transpileWorker: ExtendedTsTranspileModuleFn = (input, transpileOptions) => {
66-
barebonesLibSourceFile ??= ts.createSourceFile(barebonesLibName, barebonesLibContent, {
67-
languageVersion: ts.ScriptTarget.Latest,
68-
})
66+
if (!barebonesLibSourceFile) {
67+
barebonesLibSourceFile = ts.createSourceFile(barebonesLibName, barebonesLibContent, {
68+
languageVersion: ts.ScriptTarget.Latest,
69+
})
70+
}
6971

7072
const diagnostics: ts.Diagnostic[] = []
7173

0 commit comments

Comments
 (0)