mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 07:44:48 -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
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isDetachedBuffer(O) {
|
||||
if (O.byteLength !== 0) {
|
||||
return false;
|
||||
}
|
||||
// TODO(marcosc90) remove isFakeDetached once transferArrayBuffer
|
||||
// actually detaches the buffer
|
||||
return ReflectHas(O, isFakeDetached) ||
|
||||
core.ops.op_arraybuffer_was_detached(O);
|
||||
return O.byteLength === 0 && ops.op_arraybuffer_was_detached(O);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -225,9 +217,7 @@
|
|||
* @returns {ArrayBufferLike}
|
||||
*/
|
||||
function transferArrayBuffer(O) {
|
||||
const v = ops.op_transfer_arraybuffer(O);
|
||||
O[isFakeDetached] = true;
|
||||
return v;
|
||||
return ops.op_transfer_arraybuffer(O);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue