fix: support for NodeJS 15, fixes #732

This commit is contained in:
Yang Jun
2024-08-16 23:40:48 +08:00
committed by Jun Yang
parent 22ba21d63f
commit 4548c11406
7 changed files with 48 additions and 16 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { performance } from 'node:perf_hooks'
import { getPerformance } from '../util/performance'
import { toPromise, RenderError, LiquidErrors, LiquidError } from '../util'
import { Context } from '../context'
import { Template } from '../template'
@@ -17,7 +17,7 @@ export class Render {
}
const errors = []
for (const tpl of templates) {
ctx.renderLimit.check(performance.now())
ctx.renderLimit.check(getPerformance().now())
try {
// if tpl.render supports emitter, it'll return empty `html`
const html = yield tpl.render(ctx, emitter)