diff options
Diffstat (limited to 'js/src/tests/test262/language/optional-chaining/iteration-statement-while.js')
-rw-r--r-- | js/src/tests/test262/language/optional-chaining/iteration-statement-while.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/optional-chaining/iteration-statement-while.js b/js/src/tests/test262/language/optional-chaining/iteration-statement-while.js new file mode 100644 index 000000000..139031589 --- /dev/null +++ b/js/src/tests/test262/language/optional-chaining/iteration-statement-while.js @@ -0,0 +1,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 while statement +info: | + IterationStatement + while (Expression) Statement +features: [optional-chaining] +---*/ +let count = 0; +const obj = {a: true}; +while (obj?.a) { + count++; + break; +} +assert.sameValue(1, count); + +reportCompare(0, 0); |