The alignment work on this branch is solid for the entire ASCII grammar — which is
where the #924 changes live (scheme-relative, path-absolute, file URLs, opaque-path
bases). Across ~1.6 billion differential evaluations, including an exhaustive
enumeration of every ASCII string up to length 6 over a 19-character
structurally-significant alphabet against every base, there is zero divergence.
| // Bunpro N1 Grammar Anki Card Generator | |
| // This script extracts grammar points and example sentences from Bunpro N1 deck | |
| // and formats them for Anki import | |
| // Written by Claude Code. Don't judge me on the code quality. | |
| const fs = require('fs'); | |
| class BunproAnkiGenerator { | |
| constructor() { |
This proposal is being discussed in whatwg/html#10997.
We propose adding a new option to the SharedWorker constructor that serves as a request to extend its lifetime after all current clients have unloaded:
const sharedWorker = new SharedWorker(url, { extendedLifetime: true });The following are currently exposed to windows and workers. They are not exposed to worklets, but in Domenic's opinion, should be:
- AbortController
- AbortSignal (except AbortSignal.timeout)
- addEventListener
- atob
- btoa
- crypto.getRandomValues
- CompressionStream
- CustomEvent
| "use strict"; | |
| const { URL } = require("."); | |
| const inputs = [ | |
| "https://\u0000y", | |
| "https://x/\u0000y", | |
| "https://x/?\u0000y", | |
| "https://x/?#\u0000y" | |
| ]; |
Most APIs which accept binary data need to ensure that the data is not modified while they read from it. (Without loss of generality, let's only analyze ArrayBuffer instances for now.) Modifications can come about due to the API processing the data asynchronously, or due to the API processing the data on some other thread which runs in parallel to the main thread. (E.g., an OS API which reads from the provided ArrayBuffer and writes it to a file.)
On the web platform, APIs generally solve this by immediately making a copy of the incoming data. The code is essentially:
function someAPI(arrayBuffer) {
arrayBuffer = arrayBuffer.slice(); // make a copyTwo origins, A and B, are said to be same site if the following returns true:
- Let siteA be the result of obtaining a site from A.
- Let siteB be the result of obtaining a site from B.
- Return true if siteA equals siteB.
Two origins, A and B, are said to be schemelessly-same site if the following returns true:
- Let siteA be the result of obtaining a site from A.
- Let siteB be the result of obtaining a site from B.
| import { languagesSet } from "./some-library.mjs"; | |
| // Allowed | |
| languagesSet.keys(); | |
| languagesSet.entries(); | |
| languagesSet.forEach(l => console.log); | |
| languagesSet.size; | |
| languagesSet.values(); | |
| // Will throw TypeError |
| // This is a minimal UA sniffer, that only cares about the rendering/JS engine | |
| // name and version, which should be enough to do feature discrimination and | |
| // differential code loading. | |
| // | |
| // This is distinct from things like https://www.npmjs.com/package/ua-parser-js | |
| // which distinguish between different branded browsers that use the same rendering | |
| // engine. That sort of distinction is maybe useful for analytics purposes, but | |
| // for differential code loading it is overcomplicated. | |
| // | |
| // This is meant to demonstrate that UA sniffing is not really that hard if you're |
I am posting this as a gist because I am too lazy to figure out my blog. TODO: move it to https://domenic.me/ one day.
A lot of specifications use the ToString() abstract operation. (What's an abstract operation?) For example, any web specification which uses Web IDL's DOMString type (i.e., its basic string type) will convert incoming values using ToString(). Similarly, various parts of the JS specification itself perform ToString(). One example is the Error constructor, which we will refer to going forward.
If you are trying to implement or polyfill such a specification in JavaScript, how do you do it? For example, given
function ErrorConstructorPolyfill(message) {