Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Detached Array Buffer semantics, follow-ups. #2915
Comments
|
@rkirsling I have a few questions, each of which assumes the following: function detach(ab) {
if (ArrayBuffer.transfer) {
ArrayBuffer.transfer(ab);
} else if (ArrayBuffer.detach) {
ArrayBuffer.detach(ab);
} else if (typeof detachArrayBuffer === "function") {
detachArrayBuffer(ab);
} else if (typeof transferArrayBuffer === "function") {
transferArrayBuffer(ab)
} else if (typeof Worker === "function") {
try {
eval("%ArrayBufferDetach(ab)")
} catch (e) {
try {
var w = new Worker("", {type: "string"});
w.postMessage(ab, [ab]);
w.terminate();
} catch (e) {
var w = new Worker("", {type: "classic"});
w.postMessage(ab, [ab]);
w.terminate();
}
}
} else {
throw new TypeError("cannot detach array buffer");
}
}
let u8 = new Uint8Array([0xFF, 0xFF, 0xFF, 0xFF]);
detach(u8.buffer);
let a = [0xFF, 0xFF, 0xFF, 0xFF];
a.length = 0;
Similarly, |
|
I think I answered my own question—those expectations are when detachment occurs after |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

From @rkirsling
I'll make these updates during my 12/9 work day.