test262/test/language/statements/if/cptn-no-else-false.js
Mike Pennisi 407b8964ce Add tests for ES2015 completion reform
In order to facilitate proper tail calls, ES2015 modified the completion
value of a number of statements.

These tests use `eval` to verify the new values.
2016-01-22 15:00:03 -05:00

16 lines
506 B
JavaScript

// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.7
description: Completion value when expression is false without an `else` clause
info: >
IfStatement : if ( Expression ) Statement
[...]
4. If exprValue is false, then
a. Return NormalCompletion(undefined).
---*/
assert.sameValue(eval('1; if (false) { }'), undefined);
assert.sameValue(eval('2; if (false) { 3; }'), undefined);