diff --git a/src/jdk/nashorn/internal/codegen/Attr.java b/src/jdk/nashorn/internal/codegen/Attr.java index d4e378cfd8b60b448d507f2aba2cb2824a383e67..f1ced8ada068f481cd8a40b2af10296e9f948000 100644 --- a/src/jdk/nashorn/internal/codegen/Attr.java +++ b/src/jdk/nashorn/internal/codegen/Attr.java @@ -1265,12 +1265,17 @@ final class Attr extends NodeOperatorVisitor { @Override public Node leaveCOMMARIGHT(final BinaryNode binaryNode) { - return end(ensureSymbol(binaryNode.rhs().getType(), binaryNode)); + return leaveComma(binaryNode, binaryNode.rhs()); } @Override public Node leaveCOMMALEFT(final BinaryNode binaryNode) { - return end(ensureSymbol(binaryNode.lhs().getType(), binaryNode)); + return leaveComma(binaryNode, binaryNode.lhs()); + } + + private Node leaveComma(final BinaryNode commaNode, final Expression effectiveExpr) { + ensureTypeNotUnknown(effectiveExpr); + return end(ensureSymbol(effectiveExpr.getType(), commaNode)); } @Override diff --git a/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/src/jdk/nashorn/internal/codegen/CodeGenerator.java index 206433db268d414eceb135dcc993c8bf3c21f911..f5c1fb874a878abf7fe18a3f9851a78846c47be0 100644 --- a/src/jdk/nashorn/internal/codegen/CodeGenerator.java +++ b/src/jdk/nashorn/internal/codegen/CodeGenerator.java @@ -412,6 +412,8 @@ final class CodeGenerator extends NodeOperatorVisitor