Skip to content

Commit 6b421db

Browse files
authored
fix: Symbol.asyncDispose is not defined on the current JavaScript platform (#376)
We have a polyfill file that should be imported before `Symbol.asyncDispose` is used anywhere. The polyfill file is imported in the entry point of `@aws-cdk/toolkit-lib`, but we can't guarantee that all imports go through the entry point. Instead, import the polyfill in every file where `Symbol.asyncDispose` is used. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 25db152 commit 6b421db

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Diff for: packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/cached-source.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../../private/dispose-polyfill';
12
import type * as cxapi from '@aws-cdk/cx-api';
23
import { BorrowedAssembly } from './private/borrowed-assembly';
34
import type { ICloudAssemblySource, IReadableCloudAssembly } from './types';

Diff for: packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/private/borrowed-assembly.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../../../private/dispose-polyfill';
12
import type * as cxapi from '@aws-cdk/cx-api';
23
import type { IReadableCloudAssembly } from '../types';
34

Diff for: packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/private/prepare-source.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../../../private/dispose-polyfill';
12
import * as os from 'node:os';
23
import * as path from 'node:path';
34
import { format } from 'node:util';

Diff for: packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/private/stack-assembly.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../../../private/dispose-polyfill';
12
import { major } from 'semver';
23
import type { IoHelper } from '../../shared-private';
34
import { BaseStackAssembly, StackCollection, ExtendedStackSelection as CliExtendedStackSelection } from '../../shared-private';
@@ -6,11 +7,6 @@ import type { StackSelector } from '../stack-selector';
67
import { ExpandStackSelection, StackSelectionStrategy } from '../stack-selector';
78
import type { IReadableCloudAssembly } from '../types';
89

9-
if (!Symbol.asyncDispose) {
10-
// eslint-disable-next-line @cdklabs/no-throw-default-error
11-
throw new Error('Symbol.asyncDispose is not defined on the current JavaScript platform!');
12-
}
13-
1410
/**
1511
* A single Cloud Assembly wrapped to provide additional stack operations.
1612
*/

Diff for: packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../private/dispose-polyfill';
12
import * as path from 'node:path';
23
import type { TemplateDiff } from '@aws-cdk/cloudformation-diff';
34
import * as cxapi from '@aws-cdk/cx-api';

0 commit comments

Comments
 (0)