Re: Constant folding removes array literal in boolean context

2013-10-08 Thread Hannes Wallnoefer
Thanks André. https://bugs.openjdk.java.net/browse/JDK-8026042 Wondering if our very limited constant folding for if and ternary nodes is worth it at all. Hannes Am 2013-10-08 09:10, schrieb André Bargull: Just a quick one this time: FoldConstants#leaveIfNode() and FoldConstants#leaveTernar

Constant folding removes array literal in boolean context

2013-10-08 Thread André Bargull
Just a quick one this time: FoldConstants#leaveIfNode() and FoldConstants#leaveTernaryNode() need to guard against ArrayLiteralNode: jjs> (function(){if([a]);})() Expected: throws ReferenceError Actual: no error jjs> [a] ? 1 : 2 Expected: throws ReferenceError Actual: no error - André