Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lib): Also separate Token Map and symbols for interoperability with AWS CDK Tokens #1176

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/cdktf/lib/tokens/private/token-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {

const glob = global as any;

const STRING_SYMBOL = Symbol.for("@aws-cdk/core.TokenMap.STRING");
const LIST_SYMBOL = Symbol.for("@aws-cdk/core.TokenMap.LIST");
const NUMBER_SYMBOL = Symbol.for("@aws-cdk/core.TokenMap.NUMBER");
const STRING_SYMBOL = Symbol.for("@cdktf/core.TokenMap.STRING");
const LIST_SYMBOL = Symbol.for("@cdktf/core.TokenMap.LIST");
const NUMBER_SYMBOL = Symbol.for("@cdktf/core.TokenMap.NUMBER");

/**
* Central place where we keep a mapping from Tokens to their String representation
Expand All @@ -32,10 +32,10 @@ export class TokenMap {
* Singleton instance of the token string map
*/
public static instance(): TokenMap {
if (!glob.__cdkTokenMap) {
glob.__cdkTokenMap = new TokenMap();
if (!glob.__cdktfTokenMap) {
glob.__cdktfTokenMap = new TokenMap();
}
return glob.__cdkTokenMap;
return glob.__cdktfTokenMap;
}

private readonly stringTokenMap = new Map<string, IResolvable>();
Expand Down