fix: context clear doesn't clear defaults
This commit is contained in:
parent
5002d9b107
commit
f14493b61b
|
@ -15,6 +15,12 @@ class Context extends Map {
|
|||
this.set(key, value);
|
||||
}
|
||||
|
||||
clear() {
|
||||
super.clear();
|
||||
this.add('context', this);
|
||||
this.add('global', new Globals());
|
||||
}
|
||||
|
||||
compile(traversal) {
|
||||
// Compile traversal.
|
||||
if (!compiled.has(traversal.hash)) {
|
||||
|
@ -101,7 +107,6 @@ class Context extends Map {
|
|||
|
||||
export function createContext() {
|
||||
const context = new Context();
|
||||
context.add('context', context);
|
||||
context.add('global', new Globals());
|
||||
context.clear();
|
||||
return context;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user