summaryrefslogtreecommitdiff
path: root/src/dstr-assignment-for-await/obj-prop-elem-init-evaluation.case
blob: cdca15202c65b6d3f81fbcf216f5ed59ac212c94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: >
    The Initializer should only be evaluated if v is undefined.
template: default
es6id: 12.14.5.4
---*/

//- setup
let flag1 = false;
let flag2 = false;
let x, y;
//- elems
{ x: x = flag1 = true, y: y = flag2 = true }
//- vals
{ y: 1 }
//- body
assert.sameValue(x, true, 'value of `x`');
assert.sameValue(flag1, true, 'value of `flag1`');
assert.sameValue(y, 1, 'value of `y`');
assert.sameValue(flag2, false, 'value of `flag2`');
//- teardown
promise
  .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
  .then($DONE, $DONE);