( container, i, fn, data, declaredBlockParams, blockParams, depths )
| 306 | } |
| 307 | |
| 308 | export function wrapProgram( |
| 309 | container, |
| 310 | i, |
| 311 | fn, |
| 312 | data, |
| 313 | declaredBlockParams, |
| 314 | blockParams, |
| 315 | depths |
| 316 | ) { |
| 317 | function prog(context, options = {}) { |
| 318 | let currentDepths = depths; |
| 319 | if ( |
| 320 | depths && |
| 321 | context != depths[0] && |
| 322 | !(context === container.nullContext && depths[0] === null) |
| 323 | ) { |
| 324 | currentDepths = [context].concat(depths); |
| 325 | } |
| 326 | |
| 327 | return fn( |
| 328 | container, |
| 329 | context, |
| 330 | container.helpers, |
| 331 | container.partials, |
| 332 | options.data || data, |
| 333 | blockParams && [options.blockParams].concat(blockParams), |
| 334 | currentDepths |
| 335 | ); |
| 336 | } |
| 337 | |
| 338 | prog = executeDecorators(fn, prog, container, depths, data, blockParams); |
| 339 | |
| 340 | prog.program = i; |
| 341 | prog.depth = depths ? depths.length : 0; |
| 342 | prog.blockParams = declaredBlockParams || 0; |
| 343 | return prog; |
| 344 | } |
| 345 | |
| 346 | /** |
| 347 | * This is currently part of the official API, therefore implementation details should not be changed. |
no test coverage detected