summaryrefslogtreecommitdiff
path: root/src/dstr-assignment-for-await/obj-id-init-order.case
blob: a5c60545b2e1bb0afef4c973c0e9c45ee3e1b5d4 (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
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: >
    Initializer values should be assigned in left-to-right order.
template: default
es6id: 12.14.5.4
---*/

//- setup
let x = 0;
let a, b;
//- elems
{ a = x += 1, b = x *= 2 }
//- vals
{}
//- body
assert.sameValue(a, 1);
assert.sameValue(b, 2);
assert.sameValue(x, 2);
//- teardown
promise
  .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
  .then($DONE, $DONE);