summaryrefslogtreecommitdiff
path: root/js/src/tests/test262/language/optional-chaining/iteration-statement-do.js
blob: 470f067b20e6439464d07dfe9baaf8d41c20b94c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2019 Google, LLC.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-OptionalExpression
description: >
  optional chain in test portion of do while statement
info: |
  IterationStatement
    do Statement while (OptionalExpression)
features: [optional-chaining]
---*/
let count = 0;
const obj = {a: true};
do {
  count++;
  break;
} while (obj?.a);
assert.sameValue(1, count);

reportCompare(0, 0);