mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Prior to this commit, the tests for the linter partially depended on project files. This coupling risks churn in the tests: if the needs of the project change (e.g. a harness file is modified), then the linter tests would need to be updated. It also made the tests more difficult to understand because the input was both larger and more complicated than necessary to exercise the relevant functionality. Execute the tests in the context of the fixture directory and introduce minimal support files that serve the same purpose as the corresponding project files.
17 lines
537 B
JavaScript
17 lines
537 B
JavaScript
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
description: |
|
|
A function used in the process of asserting correctness of TypedArray objects.
|
|
|
|
$262.detachArrayBuffer is defined by a host.
|
|
defines: [$DETACHBUFFER]
|
|
---*/
|
|
|
|
function $DETACHBUFFER(buffer) {
|
|
if (!$262 || typeof $262.detachArrayBuffer !== "function") {
|
|
throw new Test262Error("No method available to detach an ArrayBuffer");
|
|
}
|
|
$262.detachArrayBuffer(buffer);
|
|
}
|