aboutsummaryrefslogtreecommitdiff
path: root/test/js/async_exception_in_await.t.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/js/async_exception_in_await.t.js')
-rw-r--r--test/js/async_exception_in_await.t.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/js/async_exception_in_await.t.js b/test/js/async_exception_in_await.t.js
new file mode 100644
index 00000000..cc9bc8ab
--- /dev/null
+++ b/test/js/async_exception_in_await.t.js
@@ -0,0 +1,22 @@
+/*---
+includes: []
+flags: []
+---*/
+
+var p = new Promise(() => 0);
+Object.defineProperty(p, "constructor", {get: () => ({}).a.a});
+
+async function g() {
+ try {
+ await p;
+ } catch (e) {
+ }
+}
+
+function f() {
+ g();
+
+ return 42;
+}
+
+assert.sameValue(f(), 42);