Skip to content

Commit ec44811

Browse files
Remove __FABLE_CORE__ global object
1 parent 610b59c commit ec44811

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

src/fable/Fable.Core/ts/Symbol.ts

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
1-
declare var global: any;
2-
3-
const fableGlobal: {
4-
types: Map<string, FunctionConstructor>,
5-
symbols: {
6-
reflection: symbol,
7-
generics: symbol,
8-
}
9-
} = function () {
10-
const globalObj =
11-
typeof window !== "undefined" ? window
12-
: (typeof global !== "undefined" ? global
13-
: (typeof self !== "undefined" ? self : {}));
14-
if (typeof globalObj.__FABLE_CORE__ === "undefined") {
15-
globalObj.__FABLE_CORE__ = {
16-
types: new Map<string, FunctionConstructor>(),
17-
symbols: {
18-
reflection: Symbol("reflection"),
19-
}
20-
};
21-
}
22-
return globalObj.__FABLE_CORE__;
23-
}();
1+
const types = new Map<string, FunctionConstructor>();
242

253
export function setType(fullName: string, cons: FunctionConstructor) {
26-
fableGlobal.types.set(fullName, cons);
4+
types.set(fullName, cons);
275
}
286

297
export function getType(fullName: string) {
30-
return fableGlobal.types.get(fullName);
8+
return types.get(fullName);
319
}
3210

33-
export default (fableGlobal.symbols);
11+
export default {
12+
reflection: Symbol("reflection")
13+
}

0 commit comments

Comments
 (0)