diff options
Diffstat (limited to 'test/language/expressions/optional-chaining/iteration-statement-do.js')
-rw-r--r-- | test/language/expressions/optional-chaining/iteration-statement-do.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/language/expressions/optional-chaining/iteration-statement-do.js b/test/language/expressions/optional-chaining/iteration-statement-do.js new file mode 100644 index 000000000..5a82cc23c --- /dev/null +++ b/test/language/expressions/optional-chaining/iteration-statement-do.js @@ -0,0 +1,18 @@ +// 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); |