Skip to content

Commit

Permalink
Improve invokePartialWrapper performance
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-akram committed Sep 3, 2023
1 parent e497a35 commit 7d961f8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lib/handlebars/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,18 @@ export function template(templateSpec, env) {
}
partial = env.VM.resolvePartial.call(this, partial, context, options);

let extendedOptions = Utils.extend({}, options, {
hooks: this.hooks,
protoAccessControl: this.protoAccessControl
});

let result = env.VM.invokePartial.call(
this,
partial,
context,
extendedOptions
);
options.hooks = this.hooks;
options.protoAccessControl = this.protoAccessControl;

let result = env.VM.invokePartial.call(this, partial, context, options);

if (result == null && env.compile) {
options.partials[options.name] = env.compile(
partial,
templateSpec.compilerOptions,
env
);
result = options.partials[options.name](context, extendedOptions);
result = options.partials[options.name](context, options);
}
if (result != null) {
if (options.indent) {
Expand Down

0 comments on commit 7d961f8

Please sign in to comment.