Skip to content

Commit

Permalink
Fixes for invalid empty data validation in i18n.* techs (backport
Browse files Browse the repository at this point in the history
from master)
  • Loading branch information
Vladimir Varankin committed Dec 17, 2012
1 parent da1c25b commit 93ed6d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blocks-common/i-bem/bem/techs/i18n.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.techMixin = BEM.util.extend({}, LangsMixin, {
getCreateResult: function(path, suffix, vars) {

var data = vars.data,
i18n = data && data.lenght?
i18n = data && !BEM.util.isEmptyObject(data)?
this.serializeI18nData(data, vars.lang)
.concat([this.serializeI18nInit(vars.lang)])
.join('\n')
Expand Down
2 changes: 1 addition & 1 deletion blocks-common/i-bem/bem/techs/i18n.js.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports.techMixin = BEM.util.extend({}, LangsMixin, {
var _this = this;
return this.__base(prefixes, this.getBaseTechSuffix(), outputDir, outputName)
.then(function(res) {
return data && data.length? res
return data && !BEM.util.isEmptyObject(data)? res
.concat(_this.serializeI18nData(data, lang))
.concat([_this.serializeI18nInit(lang)]) : res;
});
Expand Down
2 changes: 1 addition & 1 deletion blocks-common/i-bem/bem/techs/i18n.keys.js.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports.techMixin = U.extend({}, require('./i18n').LangsMixin, {
},

getCreateResult: function(prefix, suffix, data, lang) {
return data?
return data && !BEM.util.isEmptyObject(data)?
this.serializeI18nData(data, lang).concat(this.serializeI18nInit(lang)) : [];
},

Expand Down

0 comments on commit 93ed6d9

Please sign in to comment.