summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-800651.js
blob: c6410f702eefbd82c3dec62026ece280de242ec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --allow-natives-syntax

var list = [];
function log(item) { list.push(item); }
async function f() {
  try {
    let namespace = await import(/a/);
  } catch(e) {
    log(1);
  }
}
f();

async function importUndefined() {
  try {
    await import({ get toString() { return undefined; }})
  } catch(e) {
    log(2);
  }
}

function g() {
  let namespace = Promise.resolve().then(importUndefined);
}
g();
  %RunMicrotasks();
assertEquals(list, [1,2]);