Skip to content

Commit

Permalink
Remove __FABLE_CORE__ global object
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsogarciacaro committed Jan 25, 2017
1 parent 4b4120b commit 76367ee
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions src/fable/Fable.Core/ts/Symbol.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
declare var global: any;

const fableGlobal: {
types: Map<string, FunctionConstructor>,
symbols: {
reflection: symbol,
generics: symbol,
}
} = function () {
const globalObj =
typeof window !== "undefined" ? window
: (typeof global !== "undefined" ? global
: (typeof self !== "undefined" ? self : {}));
if (typeof globalObj.__FABLE_CORE__ === "undefined") {
globalObj.__FABLE_CORE__ = {
types: new Map<string, FunctionConstructor>(),
symbols: {
reflection: Symbol("reflection"),
}
};
}
return globalObj.__FABLE_CORE__;
}();
const types = new Map<string, FunctionConstructor>();

export function setType(fullName: string, cons: FunctionConstructor) {
fableGlobal.types.set(fullName, cons);
types.set(fullName, cons);
}

export function getType(fullName: string) {
return fableGlobal.types.get(fullName);
return types.get(fullName);
}

export default (fableGlobal.symbols);
export default {
reflection: Symbol("reflection")
}

0 comments on commit 76367ee

Please sign in to comment.