diff --git a/html/semantics/scripting-1/the-script-element/module/choice-of-error-1.html b/html/semantics/scripting-1/the-script-element/module/choice-of-error-1.html
new file mode 100644
index 000000000000000..712047494171818
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/choice-of-error-1.html
@@ -0,0 +1,35 @@
+
+
Handling of different types of errors
+
+
+
+
+
+
diff --git a/html/semantics/scripting-1/the-script-element/module/choice-of-error-1a.js b/html/semantics/scripting-1/the-script-element/module/choice-of-error-1a.js
new file mode 100644
index 000000000000000..d294ccf1a1ac0f0
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/choice-of-error-1a.js
@@ -0,0 +1,2 @@
+import './choice-of-error-1b.js';
+import './errorhandling-parseerror-dependent.js?1c';
diff --git a/html/semantics/scripting-1/the-script-element/module/choice-of-error-1b.js b/html/semantics/scripting-1/the-script-element/module/choice-of-error-1b.js
new file mode 100644
index 000000000000000..a666c2df5e0c5e5
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/choice-of-error-1b.js
@@ -0,0 +1,2 @@
+import './choice-of-error-1a.js';
+import './errorhandling-parseerror-dependent.js?1d';
diff --git a/html/semantics/scripting-1/the-script-element/module/choice-of-error-2.html b/html/semantics/scripting-1/the-script-element/module/choice-of-error-2.html
new file mode 100644
index 000000000000000..11de34ccf6b4465
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/choice-of-error-2.html
@@ -0,0 +1,35 @@
+
+Handling of different types of errors
+
+
+
+
+
+
diff --git a/html/semantics/scripting-1/the-script-element/module/choice-of-error-2a.js b/html/semantics/scripting-1/the-script-element/module/choice-of-error-2a.js
new file mode 100644
index 000000000000000..2dc7aac11a82ffc
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/choice-of-error-2a.js
@@ -0,0 +1,2 @@
+import './choice-of-error-2b.js';
+import './instantiation-error-1.js?2c';
diff --git a/html/semantics/scripting-1/the-script-element/module/choice-of-error-2b.js b/html/semantics/scripting-1/the-script-element/module/choice-of-error-2b.js
new file mode 100644
index 000000000000000..2adb9eea59738ac
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/choice-of-error-2b.js
@@ -0,0 +1,2 @@
+import './choice-of-error-2a.js';
+import './instantiation-error-1.js?2d';
diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
index 9390ce0a7a85d51..1578f8570e45f70 100644
--- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
+++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html
@@ -9,7 +9,7 @@
["parse error", "../syntaxerror.js", new SyntaxError],
["bad module specifier", "does-not-start-with-dot.js", new TypeError, { differentErrorObjects: true }],
["bad module specifier in a dependency", "../bad-module-specifier.js", new TypeError],
- ["instantiation error", "../instantiation-error-1.js", new SyntaxError],
+ ["instantiation error", "../instantiation-error-1.js", new SyntaxError, { differentErrorObjects: true }],
["evaluation error", "../throw-error.js", new Error]
];
diff --git a/html/semantics/scripting-1/the-script-element/module/error-type-1.html b/html/semantics/scripting-1/the-script-element/module/error-type-1.html
new file mode 100644
index 000000000000000..dfe8312ee5cde8b
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/error-type-1.html
@@ -0,0 +1,33 @@
+
+Handling of different types of errors
+
+
+
+
+
+
diff --git a/html/semantics/scripting-1/the-script-element/module/error-type-1.js b/html/semantics/scripting-1/the-script-element/module/error-type-1.js
new file mode 100644
index 000000000000000..d930d66507a7da0
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/error-type-1.js
@@ -0,0 +1,2 @@
+import './errorhandling-parseerror-dependent.js';
+import './404.js';
diff --git a/html/semantics/scripting-1/the-script-element/module/error-type-2.html b/html/semantics/scripting-1/the-script-element/module/error-type-2.html
new file mode 100644
index 000000000000000..a7df1df0c866682
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/error-type-2.html
@@ -0,0 +1,34 @@
+
+Handling of different types of errors
+
+
+
+
+
+
diff --git a/html/semantics/scripting-1/the-script-element/module/error-type-2.js b/html/semantics/scripting-1/the-script-element/module/error-type-2.js
new file mode 100644
index 000000000000000..a287f0869e4ed27
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/error-type-2.js
@@ -0,0 +1,2 @@
+import './instantiation-error-1.js';
+import './errorhandling-parseerror-dependent.js';
diff --git a/html/semantics/scripting-1/the-script-element/module/error-type-3.html b/html/semantics/scripting-1/the-script-element/module/error-type-3.html
new file mode 100644
index 000000000000000..9b00df38915abe7
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/error-type-3.html
@@ -0,0 +1,34 @@
+
+Handling of different types of errors
+
+
+
+
+
+
diff --git a/html/semantics/scripting-1/the-script-element/module/error-type-3.js b/html/semantics/scripting-1/the-script-element/module/error-type-3.js
new file mode 100644
index 000000000000000..542be52846a45d3
--- /dev/null
+++ b/html/semantics/scripting-1/the-script-element/module/error-type-3.js
@@ -0,0 +1,2 @@
+import './throw.js';
+import './instantiation-error-1.js';
diff --git a/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html b/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html
index efdf5879fce9935..1cb07993de59ef1 100644
--- a/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html
+++ b/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html
@@ -12,11 +12,19 @@
const test_load = async_test(
"Test that missing exports lead to SyntaxError events on window and " +
- "load events on script, and that exceptions are remembered");
+ "load events on script");
window.addEventListener("load", test_load.step_func_done(ev => {
- const exn = log[0];
- assert_array_equals(log, [exn, 1, exn, 2, exn, 3, exn, 4, exn, 5]);
- assert_equals(exn.constructor, SyntaxError);
+ assert_equals(log.length, 10);
+ assert_equals(log[0].constructor, SyntaxError);
+ assert_equals(log[1], 1);
+ assert_equals(log[2].constructor, SyntaxError);
+ assert_equals(log[3], 2);
+ assert_equals(log[4].constructor, SyntaxError);
+ assert_equals(log[5], 3);
+ assert_equals(log[6].constructor, SyntaxError);
+ assert_equals(log[7], 4);
+ assert_equals(log[8].constructor, SyntaxError);
+ assert_equals(log[9], 5);
}));
function unreachable() { log.push("unexpected"); }
diff --git a/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html b/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html
index 3d50ce63a6ba1c5..d7151f2b90c0cf6 100644
--- a/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html
+++ b/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html
@@ -12,11 +12,19 @@
const test_load = async_test(
"Test that missing exports lead to SyntaxError events on window and " +
- "load events on script, and that exceptions are remembered");
+ "load events on script");
window.addEventListener("load", test_load.step_func_done(ev => {
- const exn = log[0];
- assert_array_equals(log, [exn, 1, exn, 2, exn, 3, exn, 4, exn, 5]);
- assert_equals(exn.constructor, SyntaxError);
+ assert_equals(log.length, 10);
+ assert_equals(log[0].constructor, SyntaxError);
+ assert_equals(log[1], 1);
+ assert_equals(log[2].constructor, SyntaxError);
+ assert_equals(log[3], 2);
+ assert_equals(log[4].constructor, SyntaxError);
+ assert_equals(log[5], 3);
+ assert_equals(log[6].constructor, SyntaxError);
+ assert_equals(log[7], 4);
+ assert_equals(log[8].constructor, SyntaxError);
+ assert_equals(log[9], 5);
}));
function unreachable() { log.push("unexpected"); }
diff --git a/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html b/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html
index ab510c675ad170f..739bf0ebb6ba719 100644
--- a/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html
+++ b/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html
@@ -12,11 +12,15 @@
const test_load = async_test(
"Test that unresolvable cycles lead to SyntaxError events on window " +
- "and load events on script, and that exceptions are remembered");
+ "and load events on script");
window.addEventListener("load", test_load.step_func_done(ev => {
- const exn = log[0];
- assert_array_equals(log, [exn, 1, exn, 2, exn, 3]);
- assert_equals(exn.constructor, SyntaxError);
+ assert_equals(log.length, 6);
+ assert_equals(log[0].constructor, SyntaxError);
+ assert_equals(log[1], 1);
+ assert_equals(log[2].constructor, SyntaxError);
+ assert_equals(log[3], 2);
+ assert_equals(log[4].constructor, SyntaxError);
+ assert_equals(log[5], 3);
}));
function unreachable() { log.push("unexpected"); }
diff --git a/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html b/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html
index 4eb2f9f277b3398..b6be1db137c254f 100644
--- a/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html
+++ b/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html
@@ -14,9 +14,11 @@
"Test that loading a graph in which a module is already " +
"errored results in that module's error.");
window.addEventListener("load", test_load.step_func_done(ev => {
- const exn = log[0];
- assert_array_equals(log, [exn, 1, exn, 2]);
- assert_equals(exn.constructor, SyntaxError);
+ assert_equals(log.length, 4);
+ assert_equals(log[0].constructor, SyntaxError);
+ assert_equals(log[1], 1);
+ assert_equals(log[2].constructor, SyntaxError);
+ assert_equals(log[3], 2);
}));
function unreachable() { log.push("unexpected"); }
diff --git a/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html b/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html
index 86d0fb3e956ddfd..5afd011d00aaf56 100644
--- a/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html
+++ b/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html
@@ -14,9 +14,12 @@
"Test that loading a graph in which a module is already " +
"errored results in that module's error.");
window.addEventListener("load", test_load.step_func_done(ev => {
- const exn = log[0];
- assert_array_equals(log, [exn, 1, exn, 2]);
- assert_equals(exn.constructor, SyntaxError);
+ assert_equals(log.length, 4);
+ assert_equals(log[0].constructor, SyntaxError);
+ assert_equals(log[1], 1);
+ assert_equals(log[2].constructor, SyntaxError);
+ assert_equals(log[3], 2);
+ assert_not_equals(log[0], log[2], "errors should be different");
}));
function unreachable() { log.push("unexpected"); }