Lines Matching refs:name
101 var name = _ref[0],
103 return _this.addFilter(name, filter);
106 var name = _ref2[0],
108 return _this.addTest(name, test);
117 loader.on('update', function (name, fullname) { argument
118 loader.cache[name] = null;
119 _this2.emit('update', name, fullname, loader);
121 loader.on('load', function (name, source) { argument
122 _this2.emit('load', name, source, loader);
132 _proto.addExtension = function addExtension(name, extension) { argument
133 extension.__name = name;
134 this.extensions[name] = extension;
138 _proto.removeExtension = function removeExtension(name) { argument
139 var extension = this.getExtension(name);
144 delete this.extensions[name];
146 _proto.getExtension = function getExtension(name) { argument
147 return this.extensions[name];
149 _proto.hasExtension = function hasExtension(name) { argument
150 return !!this.extensions[name];
152 _proto.addGlobal = function addGlobal(name, value) { argument
153 this.globals[name] = value;
156 _proto.getGlobal = function getGlobal(name) { argument
157 if (typeof this.globals[name] === 'undefined') {
158 throw new Error('global not found: ' + name);
160 return this.globals[name];
162 _proto.addFilter = function addFilter(name, func, async) { argument
165 this.asyncFilters.push(name);
167 this.filters[name] = wrapped;
170 _proto.getFilter = function getFilter(name) { argument
171 if (!this.filters[name]) {
172 throw new Error('filter not found: ' + name);
174 return this.filters[name];
176 _proto.addTest = function addTest(name, func) { argument
177 this.tests[name] = func;
180 _proto.getTest = function getTest(name) { argument
181 if (!this.tests[name]) {
182 throw new Error('test not found: ' + name);
184 return this.tests[name];
190 _proto.getTemplate = function getTemplate(name, eagerCompile, parentName, ignoreMissing, cb) { argument
194 if (name && name.raw) {
196 name = name.raw;
207 if (name instanceof Template) {
208 tmpl = name;
209 } else if (typeof name !== 'string') {
210 throw new Error('template names must be a string: ' + name);
214 tmpl = loader.cache[this.resolveTemplate(loader, parentName, name)];
234 err = new Error('template not found: ' + name);
250 info.loader.cache[name] = newTmpl;
272 name = that.resolveTemplate(loader, parentName, name);
274 loader.getSource(name, handle);
276 handle(null, loader.getSource(name));
284 _proto.render = function render(name, ctx, cb) { argument
295 this.getTemplate(name, function (err, tmpl) {
335 lib.keys(blocks).forEach(function (name) { argument
336 _this4.addBlock(name, blocks[name]);
339 _proto2.lookup = function lookup(name) { argument
342 if (name in this.env.globals && !(name in this.ctx)) {
343 return this.env.globals[name];
345 return this.ctx[name];
348 _proto2.setVariable = function setVariable(name, val) { argument
349 this.ctx[name] = val;
354 _proto2.addBlock = function addBlock(name, block) { argument
355 this.blocks[name] = this.blocks[name] || [];
356 this.blocks[name].push(block);
359 _proto2.getBlock = function getBlock(name) { argument
360 if (!this.blocks[name]) {
361 throw new Error('unknown block "' + name + '"');
363 return this.blocks[name][0];
365 _proto2.getSuper = function getSuper(env, name, block, frame, runtime, cb) { argument
366 var idx = lib.indexOf(this.blocks[name] || [], block);
367 var blk = this.blocks[name][idx + 1];
370 throw new Error('no super block available for "' + name + '"');
374 _proto2.addExport = function addExport(name) { argument
375 this.exported.push(name);
380 this.exported.forEach(function (name) { argument
381 exported[name] = _this5.ctx[name];