JS backend: don't create namespace entry if it is empty.
(cherry picked from commit 79d9ef4)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user