This commit is contained in:
Lucas Perais (lpe)
2020-01-03 17:45:17 +01:00
parent 401b2a5b48
commit e2d86dceb4
+4
View File
@@ -177,6 +177,10 @@ export class CompilationContext {
const protectID = this.generateID(); const protectID = this.generateID();
this.rootContext.shouldDefineScope = true; this.rootContext.shouldDefineScope = true;
this.addLine(`let _origScope${protectID} = scope;`); this.addLine(`let _origScope${protectID} = scope;`);
this.addLine(`let _origScope${protectID} = scope;`);
// dict of origscopes
// export protectID in compiled string form
// fetch in subsequent code the relevant scope
this.addLine(`scope = Object.assign(Object.create(context), scope);`); this.addLine(`scope = Object.assign(Object.create(context), scope);`);
return protectID; return protectID;
} }