import(arg) crashes when ToString(arg) throws
[WebKit-https.git] / JSTests / stress / import-reject-with-exception.js
1 function shouldBe(actual, expected)
2 {
3     if (actual !== expected)
4         abort();
5 }
6
7 let x = {
8     get toString() {
9         throw new Error('bad');
10     }
11 };
12
13 import(x).then(abort, function (error) {
14     shouldBe(String(error), `Error: bad`);
15 });