Skip to content

Commit 58e33f2

Browse files
iamstolishachim-hassani
authored andcommitted
Regression test of the usage of for-await-of in the body of a module.
(cherry picked from commit 21f8fcd)
1 parent ea2fc0c commit 58e33f2

File tree

1 file changed

+16
-0
lines changed
  • graal-js/src/com.oracle.truffle.js.test/js/module

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
*/
7+
8+
/**
9+
* Regression test of the usage of for-await-of in the body of a module.
10+
*/
11+
12+
let sum = 0;
13+
for await (let x of [42, 211]) sum += x;
14+
if (sum !== 42 + 211) {
15+
throw new Error("Sum of 24 and 211 is not " + sum);
16+
}

0 commit comments

Comments
 (0)