diff --git a/packages/@aws-cdk/cdk/lib/cfn-reference.ts b/packages/@aws-cdk/cdk/lib/cfn-reference.ts index 9d533f4778d79..24cb71b37aba9 100644 --- a/packages/@aws-cdk/cdk/lib/cfn-reference.ts +++ b/packages/@aws-cdk/cdk/lib/cfn-reference.ts @@ -1,6 +1,6 @@ import { Reference } from "./reference"; -const CFN_REFERENCE_SYMBOL = Symbol('@aws-cdk/cdk.CfnReference'); +const CFN_REFERENCE_SYMBOL = Symbol.for('@aws-cdk/cdk.CfnReference'); /** * A Token that represents a CloudFormation reference to another resource @@ -112,4 +112,4 @@ export class CfnReference extends Reference { import { CfnOutput } from "./cfn-output"; import { Construct, IConstruct } from "./construct"; import { Stack } from "./stack"; -import { ResolveContext, Token } from "./token"; \ No newline at end of file +import { ResolveContext, Token } from "./token"; diff --git a/packages/@aws-cdk/cdk/lib/reference.ts b/packages/@aws-cdk/cdk/lib/reference.ts index e9a91da8c4967..791f67c7945e4 100644 --- a/packages/@aws-cdk/cdk/lib/reference.ts +++ b/packages/@aws-cdk/cdk/lib/reference.ts @@ -1,6 +1,6 @@ import { Token } from "./token"; -const REFERENCE_SYMBOL = Symbol('@aws-cdk/cdk.Reference'); +const REFERENCE_SYMBOL = Symbol.for('@aws-cdk/cdk.Reference'); /** * A Token that represents a reference between two constructs @@ -24,4 +24,4 @@ export class Reference extends Token { } } -import { Construct } from "./construct"; \ No newline at end of file +import { Construct } from "./construct"; diff --git a/packages/@aws-cdk/cdk/lib/stack.ts b/packages/@aws-cdk/cdk/lib/stack.ts index ed1023ffaee36..ed63d77e9e5d7 100644 --- a/packages/@aws-cdk/cdk/lib/stack.ts +++ b/packages/@aws-cdk/cdk/lib/stack.ts @@ -42,7 +42,7 @@ export interface StackProps { readonly autoDeploy?: boolean; } -const STACK_SYMBOL = Symbol('@aws-cdk/cdk.CfnReference'); +const STACK_SYMBOL = Symbol.for('@aws-cdk/cdk.Stack'); /** * A root construct which represents a single CloudFormation stack. @@ -66,8 +66,8 @@ export class Stack extends Construct { * * We do attribute detection since we can't reliably use 'instanceof'. */ - public static isStack(x: any): x is Stack { - return x[STACK_SYMBOL] === true; + public static isStack(obj: any): obj is Stack { + return obj[STACK_SYMBOL] === true; } private static readonly VALID_STACK_NAME_REGEX = /^[A-Za-z][A-Za-z0-9-]*$/; @@ -676,4 +676,4 @@ function findResources(roots: Iterable): CfnResource[] { interface StackDependency { stack: Stack; reason: string; -} \ No newline at end of file +}