From cb5f9e9833eedfb432dd98833b047b66935b08bf Mon Sep 17 00:00:00 2001 From: Cashew Date: Mon, 25 Dec 2023 15:36:50 +0700 Subject: [PATCH] revert changes to dev/lib/handlebars --- dev/lib/handlebars/src/utils.ts | 4 ++-- dev/lib/handlebars/src/visitor.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/lib/handlebars/src/utils.ts b/dev/lib/handlebars/src/utils.ts index 8f5a8a9c5b..f55bd98abf 100644 --- a/dev/lib/handlebars/src/utils.ts +++ b/dev/lib/handlebars/src/utils.ts @@ -29,7 +29,7 @@ export function noop() { return ''; } -// Lifted from handlebars lib/handlebars/runtime.js +// liftet from handlebars lib/handlebars/runtime.js export function initData(context: any, data: any) { if (!data || !('root' in data)) { data = data ? createFrame(data) : {}; @@ -38,7 +38,7 @@ export function initData(context: any, data: any) { return data; } -// Lifted from handlebars lib/handlebars/compiler/compiler.js +// liftet from handlebars lib/handlebars/compiler/compiler.js export function transformLiteralToPath(node: { path: hbs.AST.PathExpression | hbs.AST.Literal }) { const pathIsLiteral = 'parts' in node.path === false; diff --git a/dev/lib/handlebars/src/visitor.ts b/dev/lib/handlebars/src/visitor.ts index 87478058a0..1842c8e5d6 100644 --- a/dev/lib/handlebars/src/visitor.ts +++ b/dev/lib/handlebars/src/visitor.ts @@ -106,7 +106,7 @@ export class ElasticHandlebarsVisitor extends Handlebars.Visitor { } return container.lookupProperty(obj, name); }, - // This function is lifted from the handlebars source and slightly modified (lib/handlebars/runtime.js) + // this function is lifted from the handlebars source and slightly modified (lib/handlebars/runtime.js) lookupProperty(parent, propertyName) { const result = parent[propertyName]; if (result == null) { @@ -121,7 +121,7 @@ export class ElasticHandlebarsVisitor extends Handlebars.Visitor { } return undefined; }, - // This function is lifted from the handlebars source and slightly modified (lib/handlebars/runtime.js) + // this function is lifted from the handlebars source and slightly modified (lib/handlebars/runtime.js) lambda(current, context) { return typeof current === 'function' ? current.call(context) : current; }, @@ -343,7 +343,7 @@ export class ElasticHandlebarsVisitor extends Handlebars.Visitor { } } - // Lifted from lib/handlebars/compiler/compiler.js (original name: classifySexpr) + // Liftet from lib/handlebars/compiler/compiler.js (original name: classifySexpr) private classifyNode(node: { path: hbs.AST.PathExpression }): NodeType { const isSimple = AST.helpers.simpleId(node.path); const isBlockParam = isSimple && !!this.blockParamIndex(node.path.parts[0]); @@ -378,7 +378,7 @@ export class ElasticHandlebarsVisitor extends Handlebars.Visitor { } } - // Lifted from lib/handlebars/compiler/compiler.js + // Liftet from lib/handlebars/compiler/compiler.js private blockParamIndex(name: string): [number, any] | undefined { for (let depth = 0, len = this.blockParamNames.length; depth < len; depth++) { const blockParams = this.blockParamNames[depth];