You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any ECMAScript-based application runtime environment that implements the subset of Web Platform APIs outlined in this Standard.
86
+
Any ECMAScript-based runtime environment that implements this Standard. Web Browsers provide a Web-interoperable Runtime.
87
87
88
-
While this term is intentionally broad to also encompass Web Browsers, the primary focus here is on outlining expectations for non-browser runtimes.
88
+
The term "Web-interoperable Runtime" is intentionally broad. The primary focus of this Standard is web server runtimes.
89
89
90
90
Common API Index {#api-index}
91
91
=========================
92
92
93
-
All <a>Web-interoperable Runtimes</a> conforming to this Standard shall implement each of the following <a>Web Platform</a> APIs. These should be implemented in accordance with their normative requirements except where modified here. Where any conforming runtime environment chooses (either by necessity or otherwise) to diverge from a normative requirement of the specification, clear explanations of such divergence shall be made clearly and readily available in the documentation.
93
+
All <a>Web-interoperable Runtimes</a> conforming to this Standard shall implement each of the following <a>Web Platform</a> APIs. These should be implemented in accordance with their normative requirements except where modified here. Where any runtime environment must diverge from a normative requirement for technical or structural reasons, clear documentation shall be provided. Documentation shall include both explanation and impact of deviation.
94
94
95
95
All of the following interfaces shall be exposed on the global object accessible through `globalThis`, unless otherwise specified in this Standard:
96
96
@@ -176,7 +176,7 @@ All of the following methods and properties shall be exposed on the global objec
Web-interoperable runtimes that support workers shall also expose {{WorkerGlobalScope/onerror}},
179
+
If web-interoperable runtimes support workers, they shall also expose {{WorkerGlobalScope/onerror}},
180
180
{{WorkerGlobalScope/onunhandledrejection}}, {{WorkerGlobalScope/onrejectionhandled}} and
181
181
{{WorkerGlobalScope/self}} on the worker's `globalThis`,
182
182
unless otherwise specified in this Standard. [[!HTML]]
@@ -186,7 +186,7 @@ The Global Scope {#global-scope}
186
186
187
187
The exact type of the global scope (`globalThis`) can vary across runtimes. Most Web Platform APIs are defined in terms that assume Web Browser environments that specifically expose types like {{Window}}, {{WorkerGlobalScope}}, and so forth. To simplify conformance, all interfaces, methods, and properties defined by this Standard shall be exposed on the runtime's relevant global scope (e.g., `globalThis.crypto`, `globalThis.ReadableStream`, etc).
188
188
189
-
With many runtimes, adding a new global-scoped property can introduce breaking changes when the new global conflicts with existing application code. Many Web Platform APIs define global properties using [=read only|the `readonly` attribute=]. [[!WEBIDL]] To avoid introducing breaking changes, runtimes conforming to this Standard may choose to ignore the `readonly` attribute for properties being added to the global scope. This allows users of these runtimes to delete or overwrite these properties if they conflict with existing application code.
189
+
With many runtimes, adding a new global-scoped property can introduce breaking changes when the new global conflicts with existing application code. Many Web Platform APIs define global properties using [=read only|the `readonly` attribute=]. [[!WEBIDL]] To avoid introducing breaking changes, runtimes conforming to this Standard may omit the `readonly` attribute for properties being added to the global scope. This allows users of these runtimes to delete or overwrite these properties if they conflict with existing application code.
190
190
191
191
The global object on {{Window}}-like and worker environments should always be an instance of {{EventTarget}}. Web-interoperable runtimes should follow the <a>report an exception</a> algorithm, and the JavaScript <a href="https://tc39.es/ecma262/#sec-host-promise-rejection-tracker">HostPromiseRejectionTracker</a> host hook, as defined in [[!HTML]]. This includes firing the {{Window/error}}, {{Window/unhandledrejection}} and {{Window/rejectionhandled}} events on the global object.
192
192
@@ -205,6 +205,6 @@ The [=default `User-Agent` value=] is provided such that application code can re
205
205
product-version = token
206
206
</pre>
207
207
208
-
The [=default `User-Agent` value=] should be treated as a single, complete, opaque, unstructured value. It is recommended that the value be limited to a single `product` token excluding the optional `product-version`. The value should not include any `comment` components.
208
+
The [=default `User-Agent` value=] should be treated by application code as a single, complete, opaque, unstructured value. It is recommended that the value be limited to a single `product` token excluding the optional `product-version`. The value should not include any `comment` components.
209
209
210
210
Note: For instance, `navigator.userAgent` could be set to `'MyRuntime'`.
0 commit comments