cptn-no-else-false.js (528B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 13.6.7 5 description: Completion value when expression is false without an `else` clause 6 info: | 7 IfStatement : if ( Expression ) Statement 8 9 [...] 10 4. If exprValue is false, then 11 a. Return NormalCompletion(undefined). 12 ---*/ 13 14 assert.sameValue(eval('1; if (false) { }'), undefined); 15 assert.sameValue(eval('2; if (false) { 3; }'), undefined); 16 17 reportCompare(0, 0);