mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
chore: add FinalizationRegistry
and WeakRef
to primordials (#11735)
Because it was possible to disable those with a runtime flag, they were
not available through primordials. The flag has since been removed
upstream.
Refs: d59db06bf5
This commit is contained in:
parent
5d24ddf9b2
commit
7e5698fb2e
1 changed files with 18 additions and 22 deletions
|
@ -206,8 +206,7 @@
|
||||||
"Date",
|
"Date",
|
||||||
"Error",
|
"Error",
|
||||||
"EvalError",
|
"EvalError",
|
||||||
// TODO(lucacasonato): not present in snapshots. Why?
|
"FinalizationRegistry",
|
||||||
// "FinalizationRegistry",
|
|
||||||
"Float32Array",
|
"Float32Array",
|
||||||
"Float64Array",
|
"Float64Array",
|
||||||
"Function",
|
"Function",
|
||||||
|
@ -231,8 +230,7 @@
|
||||||
"Uint8Array",
|
"Uint8Array",
|
||||||
"Uint8ClampedArray",
|
"Uint8ClampedArray",
|
||||||
"WeakMap",
|
"WeakMap",
|
||||||
// TODO(lucacasonato): not present in snapshots. Why?
|
"WeakRef",
|
||||||
// "WeakRef",
|
|
||||||
"WeakSet",
|
"WeakSet",
|
||||||
].forEach((name) => {
|
].forEach((name) => {
|
||||||
const original = globalThis[name];
|
const original = globalThis[name];
|
||||||
|
@ -410,25 +408,23 @@
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO(lucacasonato): not present in snapshots. Why?
|
primordials.SafeFinalizationRegistry = makeSafe(
|
||||||
// primordials.SafeFinalizationRegistry = makeSafe(
|
FinalizationRegistry,
|
||||||
// FinalizationRegistry,
|
class SafeFinalizationRegistry extends FinalizationRegistry {
|
||||||
// class SafeFinalizationRegistry extends FinalizationRegistry {
|
constructor(cleanupCallback) {
|
||||||
// constructor(cleanupCallback) {
|
super(cleanupCallback);
|
||||||
// super(cleanupCallback);
|
}
|
||||||
// }
|
},
|
||||||
// },
|
);
|
||||||
// );
|
|
||||||
|
|
||||||
// TODO(lucacasonato): not present in snapshots. Why?
|
primordials.SafeWeakRef = makeSafe(
|
||||||
// primordials.SafeWeakRef = makeSafe(
|
WeakRef,
|
||||||
// WeakRef,
|
class SafeWeakRef extends WeakRef {
|
||||||
// class SafeWeakRef extends WeakRef {
|
constructor(target) {
|
||||||
// constructor(target) {
|
super(target);
|
||||||
// super(target);
|
}
|
||||||
// }
|
},
|
||||||
// },
|
);
|
||||||
// );
|
|
||||||
|
|
||||||
const SafePromise = makeSafe(
|
const SafePromise = makeSafe(
|
||||||
Promise,
|
Promise,
|
||||||
|
|
Loading…
Reference in a new issue