Comments (1)
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:
- execute the script element: ignores the return value, and is not prepared to deal with throws
- evaluate a javascript: URL: checks the return value to see if it's a normal completion with a string. Doesn't seem equipped to deal with throws
- timer initialization steps: ignores the return value, and is not prepared to deal with throws
- run a worker: ignores the return value; doesn't seem equipped to deal with throws
- import scripts into worker global scope: ignores the return value, but explicitly wants errors to be rethrown.
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.
from html.
Related Issues (20)
- `html` end tag omission HOT 3
- Navigation: Clarification on `ever populated` flag of DocumentState during apply the history step HOT 3
- Upcoming WHATNOT meeting on 2/8/2024 HOT 2
- Should dir=auto with no strong characters inherit directionality from parent or be ltr? HOT 10
- Navigation: DocumentState request referrer is not set for about:srcdoc
- `<callout>` element for callouts/alerts/admonitions HOT 35
- Proposal: HTML Attribute to state non-consent when scraping for training datasets HOT 1
- Can a task throw exceptions? HOT 2
- Session history step of top level navigable when child navigables traverse history HOT 1
- Should there be an opt-out for declarative shadow roots having `clonable=true`? HOT 27
- Should `<a target="_blank">` and `window.open` consume the transient activation? HOT 2
- `<img sizes="auto, 100px" loading="eager">`: `auto` equates to `100wv` but should ideally be ignored HOT 2
- Constrain OffscreenCanvas with a placeholder canvas element HOT 8
- A way to run code before the next frame HOT 8
- New attribute for avoiding to autocapitalize text input fields HOT 1
- Autocomplete attribute value to indicate form input is third-party data
- Improve API of `insertAdjacent*()` methods HOT 2
- Why does popover hide when the popover attribute changed HOT 4
- Read-only state for buttons? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html.