mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
37 lines
911 B
JavaScript
37 lines
911 B
JavaScript
'use strict';
|
|
// helpers provide a core set of various utility methods
|
|
// that are available in every template
|
|
var AsyncVDOMBuilder = require('./AsyncVDOMBuilder');
|
|
var makeRenderable = require('../renderable');
|
|
|
|
/**
|
|
* Method is for internal usage only. This method
|
|
* is invoked by code in a compiled Marko template and
|
|
* it is used to create a new Template instance.
|
|
* @private
|
|
*/
|
|
exports.t = function createTemplate(path) {
|
|
return new Template(path);
|
|
};
|
|
|
|
function Template(path, func) {
|
|
this.path = path;
|
|
this._ = func;
|
|
this.meta = undefined;
|
|
}
|
|
|
|
function createOut(globalData, parent, state) {
|
|
return new AsyncVDOMBuilder(globalData, parent, state);
|
|
}
|
|
|
|
var Template_prototype = Template.prototype = {
|
|
createOut: createOut
|
|
};
|
|
|
|
makeRenderable(Template_prototype);
|
|
|
|
exports.Template = Template;
|
|
exports.$__createOut = createOut;
|
|
|
|
require('../createOut').$__setCreateOut(createOut);
|