From a1ee40d4f78b8f9f238df2a3b63acadff49af104 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 13 Oct 2022 17:11:18 +0200 Subject: [PATCH 1/4] Editorial: Give script's settings object an unambiguous ID. --- source | 60 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/source b/source index b8b9888bc90..ff15698eec2 100644 --- a/source +++ b/source @@ -103853,7 +103853,8 @@ document.querySelector("button").addEventListener("click", bound); data-x="struct">structs. All scripts have:

-
A settings object
+
A settings object

An environment settings object, containing various settings that are shared with other scripts in the same context.

@@ -104922,7 +104923,8 @@ document.querySelector("button").addEventListener("click", bound);
  • Let script be a new classic script that this algorithm will subsequently initialize.

  • -
  • Set script's settings object to settings.

  • +
  • Set script's settings + object to settings.

  • Set script's base URL to baseURL.

  • @@ -104974,7 +104976,8 @@ document.querySelector("button").addEventListener("click", bound);
  • Let script be a new module script that this algorithm will subsequently initialize.

  • -
  • Set script's settings object to settings.

  • +
  • Set script's settings + object to settings.

  • Set script's base URL to baseURL.

  • @@ -105082,7 +105085,8 @@ document.querySelector("button").addEventListener("click", bound);
  • Let script be a new module script that this algorithm will subsequently initialize.

  • -
  • Set script's settings object to settings.

  • +
  • Set script's settings + object to settings.

  • Set script's base URL and fetch options to null.

  • @@ -105121,7 +105125,8 @@ document.querySelector("button").addEventListener("click", bound);
  • Let script be a new module script that this algorithm will subsequently initialize.

  • -
  • Set script's settings object to settings.

  • +
  • Set script's settings + object to settings.

  • Set script's base URL and fetch options to null.

  • @@ -105193,7 +105198,8 @@ document.querySelector("button").addEventListener("click", bound); and an optional boolean rethrow errors (default false):

      -
    1. Let settings be the settings object of script.

    2. +
    3. Let settings be the settings + object of script.

    4. Check if we can run script with settings. If this returns "do not run" then return NormalCompletion(empty).

    5. @@ -105274,7 +105280,8 @@ document.querySelector("button").addEventListener("click", bound); and an optional boolean preventErrorReporting (default false):

        -
      1. Let settings be the settings object of script.

      2. +
      3. Let settings be the settings + object of script.

      4. Check if we can run script with settings. If this returns "do not run", then return a promise resolved with with undefined.

      5. @@ -105507,9 +105514,9 @@ document.querySelector("button").addEventListener("click", bound); data-x="concept-script">script, with the problematic position (line number and column number) in the resource containing the script, using the global object specified by the script's - settings object as the target. If the error is still not handled after this, then the error may be reported to a - developer console.

        + settings object as the target. If the error + is still not handled after this, then the error may be + reported to a developer console.

        The existence of both report an error and report an exception is confusing, and both algorithms @@ -105754,8 +105761,8 @@ dictionary PromiseRejectionEventInit : EventInitIf referringScript is not null, then:

          -
        1. Set settingsObject to referringScript's settings - object.

        2. +
        3. Set settingsObject to referringScript's + settings object.

        4. Set baseURL to referringScript's base URL.

        5. @@ -106527,7 +106534,8 @@ dictionary PromiseRejectionEventInit : EventInit

          Let settings object be the current settings object.

        6. If script is not null, then set settings object to - script's settings object.

        7. + script's settings + object.

        8. If operation is "reject", then:

          @@ -106803,8 +106811,9 @@ dictionary PromiseRejectionEventInit : EventInit

          If active script is not null, set script execution context to a new JavaScript execution context, with its Function field set to null, its Realm field - set to active script's settings object's realm, and its ScriptOrModule set to active script's + set to active script's settings + object's realm, and its + ScriptOrModule set to active script's record.

          As seen below, this is used in order to propagate the current active @@ -107091,8 +107100,8 @@ import "https://example.com/foo/../module2.mjs";

          1. Set referencingScript to referrer.[[HostDefined]].

            -
          2. Set settingsObject to referencingScript's settings - object.

          3. +
          4. Set settingsObject to referencingScript's settings object.

          5. Set fetchOptions to the new descendant script fetch options for referencingScript's fetch @@ -107468,7 +107477,7 @@ import "https://example.com/foo/../module2.mjs"; the browsing context's active document.

          6. If the task is being queued by or for a script, then - return the script's settings object's settings object's global object's associated Document.

          7. @@ -116550,9 +116559,9 @@ interface SharedWorker : EventTarget {
          8. If worker global scope is not null, but the user agent has been configured to disallow communication between the worker represented by the worker global - scope and the scripts whose settings object is outside settings, then set worker global - scope to null.

            + scope and the scripts whose settings object is outside settings, + then set worker global scope to null.

            For example, a user agent could have a development mode that isolates a particular top-level traversable from all other pages, and scripts in that @@ -132753,10 +132762,11 @@ if (s = prompt('What is your name?')) {

          9. None of the elements in the Document are in any of the following namespaces: HTML namespace, SVG namespace, MathML namespace
          10. The Document has no focusable area (e.g. from XLink) other than the viewport.
          11. The Document has no hyperlinks (e.g. from XLink). -
          12. There exists no script whose settings - object's global object is a - Window object with this Document as its associated Document. +
          13. There exists no script whose settings object's global object is a Window object with + this Document as its associated + Document.
          14. None of the elements in the Document have any registered event listeners. From baf6d0ad28ec44f00d753a843c9611ac52ec6dfd Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 20 Oct 2023 13:35:40 +0200 Subject: [PATCH 2/4] Editorial: note that a script's fetch options can be null --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index ff15698eec2..3396fa26285 100644 --- a/source +++ b/source @@ -103910,8 +103910,8 @@ document.querySelector("button").addEventListener("click", bound);
            Fetch options
            -
            A script fetch options, containing various options related to fetching this - script or module scripts that it imports.
            +
            Null or a script fetch options, containing various options related to fetching + this script or module scripts that it imports.
            A base URL
            From f91131956d8a9fa81716792ff363314e7281983e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 20 Oct 2023 13:42:49 +0200 Subject: [PATCH 3/4] Editorial: correct miscount in definition of 'script' This was introduced in 3d45584d286e9455cc24ebae1f3aca3db120dc9d (#4898). --- source | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source b/source index 3396fa26285..41373788d62 100644 --- a/source +++ b/source @@ -103849,8 +103849,9 @@ document.querySelector("button").addEventListener("click", bound);
            Scripts
            -

            A script is one of three possible structs. All scripts have:

            +

            A script is one of two possible structs (namely, a classic script or a + module script). All scripts have:

            A Date: Fri, 20 Oct 2023 13:47:14 +0200 Subject: [PATCH 4/4] Editorial: fix typos in HostLoadImportedModule Fixes #9867. --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index 41373788d62..080cedcda3f 100644 --- a/source +++ b/source @@ -107162,14 +107162,14 @@ import "https://example.com/foo/../module2.mjs";
            1. Set destination to loadState.[[Destination]].

            2. -
            3. Set fetchClient loadState.[[FetchClient]].

            4. +
            5. Set fetchClient to loadState.[[FetchClient]].

          15. Fetch a single imported module script given url, fetchClient, destination, fetchOptions, - settingsObject fetchReferrer, moduleRequest, and + settingsObject, fetchReferrer, moduleRequest, and onSingleFetchComplete as defined below. If loadState is not undefined and loadState.[[PerformFetch]] is not null, pass loadState.[[PerformFetch]] along as well.

            @@ -107201,8 +107201,8 @@ import "https://example.com/foo/../module2.mjs";
          16. Otherwise, set completion to Completion Record { [[Type]]: - normal, [[Value]]: result's record, - [[Target]]: empty }.

          17. + normal, [[Value]]: moduleScript's + record, [[Target]]: empty }.

          18. Perform FinishLoadingImportedModule(referrer, moduleRequest, payload, completion).