detachArrayBuffer.js 513 B

12345678910111213141516
  1. // Copyright (C) 2016 the V8 project authors. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. description: |
  5. A function used in the process of asserting correctness of TypedArray objects.
  6. $262.detachArrayBuffer is defined by a host.
  7. ---*/
  8. function $DETACHBUFFER(buffer) {
  9. if (!$262 || typeof $262.detachArrayBuffer !== "function") {
  10. throw new Test262Error("No method available to detach an ArrayBuffer");
  11. }
  12. $262.detachArrayBuffer(buffer);
  13. }