Skip to content

Commit

Permalink
revert changes to dev/lib/handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
Casheeew committed Dec 25, 2023
1 parent 6619d71 commit cb5f9e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dev/lib/handlebars/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) : {};
Expand All @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions dev/lib/handlebars/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
},
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit cb5f9e9

Please sign in to comment.