Closed blond closed 9 years ago
Can we write as such way?
oninit(function(exports, context) {
var BEMContext = context.BEMContext || exports.BEMContext;
if(!BEMContext) {
throw Error("Seems like you have no base templates from i-bem.' + this.getName() + '");
}
BEMContext.prototype.require = function(lib) {',
return __bem_xjst_libs__[lib];
};
});
I think yes.
I would have swapped exports
and context
:
var BEMContext = exports.BEMContext || context.BEMContext;
/cc @tadatuta
As for me — :ok:
See https://github.com/bem/bem-core/issues/1099
Now we extend the definition of the basic templates with
oninit
. TheBEMContext
is available fromcontext
argument.In
bem-core@v3
BEMContext
wiil be available fromexports
argument only.