2017-06-06 10:28:14 +02:00
|
|
|
// Copyright 2017 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.
|
|
|
|
|
2022-01-29 08:33:07 +01:00
|
|
|
// Flags: --allow-natives-syntax
|
2017-06-06 10:28:14 +02:00
|
|
|
|
|
|
|
var ran = false;
|
|
|
|
|
|
|
|
async function test2() {
|
|
|
|
try {
|
2019-08-16 11:32:46 +02:00
|
|
|
let x = await import('modules-skip-9.mjs');
|
2017-06-06 10:28:14 +02:00
|
|
|
%AbortJS('failure: should be unreachable');
|
|
|
|
} catch(e) {
|
|
|
|
assertInstanceof(e, SyntaxError);
|
|
|
|
assertEquals(
|
2019-08-16 11:32:46 +02:00
|
|
|
"The requested module 'modules-skip-empty.mjs' does not provide an " +
|
2018-03-07 08:54:53 +01:00
|
|
|
"export named 'default'",
|
2017-06-06 10:28:14 +02:00
|
|
|
e.message);
|
|
|
|
ran = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test2();
|
2019-03-12 09:01:49 +01:00
|
|
|
%PerformMicrotaskCheckpoint();
|
2017-06-06 10:28:14 +02:00
|
|
|
assertTrue(ran);
|
|
|
|
|
|
|
|
ran = false;
|
|
|
|
|
|
|
|
async function test3() {
|
|
|
|
try {
|
2019-08-16 11:32:46 +02:00
|
|
|
let x = await import('nonexistent-file.mjs');
|
2017-06-06 10:28:14 +02:00
|
|
|
%AbortJS('failure: should be unreachable');
|
|
|
|
} catch(e) {
|
2021-03-12 08:24:20 +01:00
|
|
|
assertTrue(e.message.startsWith('d8: Error reading'));
|
2017-06-06 10:28:14 +02:00
|
|
|
ran = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test3();
|
2019-03-12 09:01:49 +01:00
|
|
|
%PerformMicrotaskCheckpoint();
|
2017-06-06 10:28:14 +02:00
|
|
|
assertTrue(ran);
|