Constant folding removes array literal in boolean context

André Bargull andrebargull at googlemail.com
Tue Oct 8 00:10:42 PDT 2013


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é


More information about the nashorn-dev mailing list