Is there generic way to detach ArrayBuffer in any browsers?

时间:2019-03-19 14:48:36

标签: javascript

I want to detach arbitrarily ArrayBuffer.
In d8(v8), i can detach ArrayBuffer using %ArrayBufferNeuter(array.buffer);.
But, i don't know how to do it without debugging option like above.
Is there some generic method to detach ArrayBuffer?

2 个答案:

答案 0 :(得分:0)

还没有,但是there is a proposal引入了这种方法。

答案 1 :(得分:0)

function detachBuffer(buffer) {
  try {
    postMessage('', '', [buffer]);
  } catch { }
}