Skip to content

Are the “active script” & “base URL” assertions in the timer initialization steps correct? #9633

@bathos

Description

@bathos

The assertion at step 8 of the timer initialization steps

  1. Let initiating script be the active script.
  2. Assert: initiating script is not null, since this algorithm is always called from some script.

— seems like it may be incorrect? If I’m reading this right, active script and GetActiveScriptOrModule would return null for the second invocation of “timer initialization steps” kicked off by setTimeout(setTimeout.bind(this, () => {})), for example.

The initiating script is used by the task created at step 9 to determine the base URL if the handler is a string, with another assertion (under 9.3):

  1. Let base URL be initiating script's base URL.
  2. Assert: base URL is not null, as initiating script is a classic script or a JavaScript module script.

If I’m correct that these assertions are wrong, I suspect base URL should be getting set to the API base URL of the settings object of the incumbent realm (captured prior to the step 9 task steps) when initializing script is null. Or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions