JS backend: don't create namespace entry if it is empty.

(cherry picked from commit 79d9ef4)
This commit is contained in:
develar
2013-08-14 14:56:41 +04:00
committed by Zalim Bashorov
parent 481cee16c5
commit 43db01d7ce
@@ -111,8 +111,10 @@ final class NamespaceTranslator extends AbstractTranslator {
List<JsExpression> defineInvocation = descriptorToDefineInvocation.get(descriptor); List<JsExpression> defineInvocation = descriptorToDefineInvocation.get(descriptor);
if (defineInvocation == null) { if (defineInvocation == null) {
if (initializer != null || !visitor.getResult().isEmpty()) {
createDefinitionPlace(initializer, descriptorToDefineInvocation); createDefinitionPlace(initializer, descriptorToDefineInvocation);
} }
}
else { else {
if (context().isEcma5() && initializer != null) { if (context().isEcma5() && initializer != null) {
assert defineInvocation.get(0) == JsLiteral.NULL; assert defineInvocation.get(0) == JsLiteral.NULL;