From ccdf7f922c26a4b2b0ead63a36ca2cee85a9fb66 Mon Sep 17 00:00:00 2001 From: tormozz48 Date: Mon, 3 Aug 2015 14:32:20 +0300 Subject: [PATCH] #78 Support BEMContext from exports --- techs/bem-xjst.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/techs/bem-xjst.js b/techs/bem-xjst.js index 7a4b13f..068938a 100644 --- a/techs/bem-xjst.js +++ b/techs/bem-xjst.js @@ -69,10 +69,11 @@ module.exports = require('enb/lib/build-flow').create() var jobQueue = this.node.getSharedResources().jobQueue, template = [ 'oninit(function(exports, context) {', - ' if(!context.BEMContext) {', + ' var BEMContext = exports.BEMContext || context.BEMContext;', + ' if(!BEMContext) {', ' throw Error("Seems like you have no base templates from i-bem.' + this.getName() + '");', ' }', - ' context.BEMContext.prototype.require = function(lib) {', + ' BEMContext.prototype.require = function(lib) {', ' return __bem_xjst_libs__[lib];', ' };', '});'