mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
refactor(ext/streams): remove fake detached (#16431)
Removed "fake detached" logic since it's no longer needed after [#16294](https://github.com/denoland/deno/pull/16294) landed
This commit is contained in:
parent
6ac603ec88
commit
de580cedd2
1 changed files with 2 additions and 12 deletions
|
@ -187,20 +187,12 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isFakeDetached = Symbol("<<detached>>");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ArrayBufferLike} O
|
* @param {ArrayBufferLike} O
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function isDetachedBuffer(O) {
|
function isDetachedBuffer(O) {
|
||||||
if (O.byteLength !== 0) {
|
return O.byteLength === 0 && ops.op_arraybuffer_was_detached(O);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// TODO(marcosc90) remove isFakeDetached once transferArrayBuffer
|
|
||||||
// actually detaches the buffer
|
|
||||||
return ReflectHas(O, isFakeDetached) ||
|
|
||||||
core.ops.op_arraybuffer_was_detached(O);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -225,9 +217,7 @@
|
||||||
* @returns {ArrayBufferLike}
|
* @returns {ArrayBufferLike}
|
||||||
*/
|
*/
|
||||||
function transferArrayBuffer(O) {
|
function transferArrayBuffer(O) {
|
||||||
const v = ops.op_transfer_arraybuffer(O);
|
return ops.op_transfer_arraybuffer(O);
|
||||||
O[isFakeDetached] = true;
|
|
||||||
return v;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue