We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64b266f commit a0fb04fCopy full SHA for a0fb04f
packages/@aws-cdk/core/lib/feature-flags.ts
@@ -1,5 +1,5 @@
1
import * as cxapi from '@aws-cdk/cx-api';
2
-import { IConstruct } from '../lib/construct-compat';
+import { IConstruct, Node } from 'constructs';
3
4
/**
5
* Features that are implemented behind a flag in order to preserve backwards
@@ -24,7 +24,7 @@ export class FeatureFlags {
24
* module.
25
*/
26
public isEnabled(featureFlag: string): boolean | undefined {
27
- const context = this.construct.node.tryGetContext(featureFlag);
+ const context = Node.of(this.construct).tryGetContext(featureFlag);
28
if (cxapi.FUTURE_FLAGS_EXPIRED.includes(featureFlag)) {
29
if (context !== undefined) {
30
throw new Error(`Unsupported feature flag '${featureFlag}'. This flag existed on CDKv1 but has been removed in CDKv2.`
0 commit comments