Commit 6a143fd0 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cleanup] Rename uses of 'neuter' to 'detach'

Ongoing cleanup to use the same term everywhere.

Bug: chromium:913887
Change-Id: Ifc4d4de0c2dfd9f1150e61d64cf7f91cf923aa24
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1738865Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63101}
parent 708995b6
......@@ -58,7 +58,7 @@ namespace data_view {
}
}
macro WasNeutered(view: JSArrayBufferView): bool {
macro WasDetached(view: JSArrayBufferView): bool {
return IsDetachedBuffer(view.buffer);
}
......@@ -86,9 +86,9 @@ namespace data_view {
js-implicit context: Context, receiver: Object)(...arguments): Number {
const dataView: JSDataView = ValidateDataView(
context, receiver, 'get DataView.prototype.byte_length');
if (WasNeutered(dataView)) {
if (WasDetached(dataView)) {
// TODO(bmeurer): According to the ES6 spec, we should throw a TypeError
// here if the JSArrayBuffer of the {dataView} was neutered.
// here if the JSArrayBuffer of the {dataView} was detached.
return 0;
}
return Convert<Number>(dataView.byte_length);
......@@ -99,9 +99,9 @@ namespace data_view {
js-implicit context: Context, receiver: Object)(...arguments): Number {
const dataView: JSDataView = ValidateDataView(
context, receiver, 'get DataView.prototype.byte_offset');
if (WasNeutered(dataView)) {
if (WasDetached(dataView)) {
// TODO(bmeurer): According to the ES6 spec, we should throw a TypeError
// here if the JSArrayBuffer of the {dataView} was neutered.
// here if the JSArrayBuffer of the {dataView} was detached.
return 0;
}
return Convert<Number>(dataView.byte_offset);
......
......@@ -55,7 +55,7 @@ if (this.Worker) {
// Clone SharedArrayBuffer
w.postMessage(sab);
assertEquals(16, sab.byteLength); // ArrayBuffer should not be neutered.
assertEquals(16, sab.byteLength); // ArrayBuffer should not be detached.
// Spinwait for the worker to update ta[0]
var ta0;
......@@ -65,7 +65,7 @@ if (this.Worker) {
w.terminate();
assertEquals(16, sab.byteLength); // Still not neutered.
assertEquals(16, sab.byteLength); // Still not detached.
})();
(function TestCloneMulti() {
......
......@@ -147,12 +147,12 @@ if (this.Worker) {
// Clone ArrayBuffer
var ab1 = createArrayBuffer(16);
w.postMessage(ab1);
assertEquals(16, ab1.byteLength); // ArrayBuffer should not be neutered.
assertEquals(16, ab1.byteLength); // ArrayBuffer should not be detached.
// Transfer ArrayBuffer
var ab2 = createArrayBuffer(32);
w.postMessage(ab2, [ab2]);
assertEquals(0, ab2.byteLength); // ArrayBuffer should be neutered.
assertEquals(0, ab2.byteLength); // ArrayBuffer should be detached.
// Attempting to transfer the same ArrayBuffer twice should throw.
assertThrows(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment