Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"run a classic script" returns completion records and throws #10104

Open
Ms2ger opened this issue Jan 29, 2024 · 1 comment
Open

"run a classic script" returns completion records and throws #10104

Ms2ger opened this issue Jan 29, 2024 · 1 comment
Labels
clarification Standard could be clearer topic: script

Comments

@Ms2ger
Copy link
Member

Ms2ger commented Jan 29, 2024

What is the issue with the HTML Standard?

run a classic script has both of these steps:

It's not clear to me whether these are supposed to have the same effect. If yes, they should probably be phrased the same way; if no, the calling convention could be clarified.

@domenic domenic added clarification Standard could be clearer topic: script labels Jan 30, 2024
@domenic
Copy link
Member

domenic commented Jan 30, 2024

This algorithm is suffering from the problem of trying to bridge the JS and web conventions. We can definitely do better.

But stepping back, there's a bit of a mess in general. "run a classic script" has the following callers:

My proposal:

  • "run a classic script" should behave entirely according to web conventions. I.e., it should return or throw, and should never return completion records (in either success or failure cases).

  • "run a classic script" should only throw if rethrow errors is set.

I think this would work better with what callers expect.

Concretely, I think the changes are then:

  • Step 7.3.3. should return null instead of evaluationStatus.
  • Step 9 should return evaluationStatus.[[Value]] instead of evaluationStatus.
  • Step 10 should return null.
  • "evaluate a javascript: URL" should be updated to use web conventions instead of getting a completion record.

If this makes sense to you, a PR implementing it would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: script
Development

No branches or pull requests

3 participants
@Ms2ger @domenic and others