From 6382a5bc6810057981b3ca06a9e27e8b5e88741b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 30 Sep 2022 12:28:03 +0200 Subject: [PATCH] Add test for invalid import assertion --- .../basic.html} | 21 ++++--------------- .../dynamic-import/microtasks/ticker.js | 13 ++++++++++++ .../microtasks/with-import-assertions.html | 18 ++++++++++++++++ 3 files changed, 35 insertions(+), 17 deletions(-) rename html/semantics/scripting-1/the-script-element/module/dynamic-import/{microtasks.html => microtasks/basic.html} (66%) create mode 100644 html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/ticker.js create mode 100644 html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/with-import-assertions.html diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/basic.html similarity index 66% rename from html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks.html rename to html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/basic.html index ee1241f14cdbb63..f36bb693da64289 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/basic.html @@ -3,20 +3,7 @@ diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/ticker.js b/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/ticker.js new file mode 100644 index 000000000000000..2d655b4dafd5487 --- /dev/null +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/ticker.js @@ -0,0 +1,13 @@ +export function ticker(max) { + let i = 0; + let stop = false; + Promise.resolve().then(function loop() { + if (stop || i >= max) return; + i++; + Promise.resolve().then(loop); + }); + return () => { + stop = true; + return i; + }; +}; diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/with-import-assertions.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/with-import-assertions.html new file mode 100644 index 000000000000000..2d63ca7fb9a923d --- /dev/null +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/microtasks/with-import-assertions.html @@ -0,0 +1,18 @@ + +Dynamic import interaction with microtask queue + + +