refactor: bye typed context

This commit is contained in:
cha0s 2019-04-08 18:41:49 -04:00
parent 8ef041c149
commit da728200c5
2 changed files with 1 additions and 28 deletions

View File

@ -65,35 +65,8 @@ class Context extends Map {
} }
} }
class TypedContext extends Context {
constructor(iterator) {
super(iterator);
this.types = {};
}
add(key, value, type) {
super.add(key, value);
if (!type) {
return;
}
this.types = {
...this.types,
[key]: type,
};
}
}
export function createContext() { export function createContext() {
const context = new Context(); const context = new Context();
context.add('global', new Globals()); context.add('global', new Globals());
return context; return context;
} }
export function createTypedContext() {
const context = new TypedContext();
context.add('global', new Globals(), 'globals');
return context;
}

View File

@ -1,4 +1,4 @@
export {createContext, createTypedContext} from './context'; export {createContext} from './context';
export {TypeMap} from './context/types'; export {TypeMap} from './context/types';
export { export {
get as getType, get as getType,