perf: make the most of streamed rendering

This commit is contained in:
Harttle
2021-10-01 18:36:57 +08:00
committed by harttle
parent 4358c9630f
commit aea34418de
13 changed files with 65 additions and 71 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ export class Context {
this.globals = opts.globals
this.environments = env
}
public getRegister (key: string, defaultValue = {}) {
return (this.registers[key] = this.registers[key] || defaultValue)
public getRegister (key: string) {
return (this.registers[key] = this.registers[key] || {})
}
public setRegister (key: string, value: any) {
return (this.registers[key] = value)