Bug 1079844 - Rename the shell builtin 'neuter' function to 'detachArrayBuffer', consistent with the spec name for the operation. r=till
authorJeff Walden <jwalden@mit.edu>
Mon, 25 Jan 2016 14:01:43 -0800
changeset 281730 5c756122e1687d382b550b71a5cbef44722edaa9
parent 281729 332b15daa544d423271116b671499f2bd94d5f9e
child 281731 82fa5db23a4c88406f3dc3c0cc4528d8db6c7e98
push id70898
push userjwalden@mit.edu
push dateTue, 26 Jan 2016 19:18:23 +0000
treeherdermozilla-inbound@82fa5db23a4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1079844
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1079844 - Rename the shell builtin 'neuter' function to 'detachArrayBuffer', consistent with the spec name for the operation. r=till
js/src/builtin/TestingFunctions.cpp
js/src/jit-test/manual-tests/TypedObject-TypeDescrIsArrayType-unknown.js
js/src/jit-test/manual-tests/TypedObject-TypeDescrIsArrayType.js
js/src/jit-test/tests/TypedObject/aggregate-set-neutered.js
js/src/jit-test/tests/TypedObject/atopneuteredbuffer.js
js/src/jit-test/tests/TypedObject/bug1082649.js
js/src/jit-test/tests/TypedObject/neutertypedobj.js
js/src/jit-test/tests/TypedObject/neutertypedobjsizedarray.js
js/src/jit-test/tests/TypedObject/neutertypedobjunsizedarray.js
js/src/jit-test/tests/asm.js/neuter-during-arguments-coercion.js
js/src/jit-test/tests/asm.js/testNeuter.js
js/src/jit-test/tests/basic/testNeutering.js
js/src/jit-test/tests/basic/typed-array-copyWithin.js
js/src/jit-test/tests/ion/inlining/typedarray-data-inlining-neuter-samedata.js
js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js
js/src/jit-test/tests/ion/typedarray-length.js
js/src/jit-test/tests/ion/typedarray-static-load.js
js/src/jit-test/tests/ion/typedarray-static-store.js
js/src/tests/ecma_6/DataView/detach-after-construction.js
js/src/tests/ecma_6/TypedArray/constructor-non-detached.js
js/src/tests/ecma_6/TypedArray/detached-array-buffer-checks.js
js/src/tests/ecma_6/TypedArray/sort_errors.js
js/src/tests/ecma_6/extensions/ArrayBuffer-slice-arguments-neutering.js
js/src/tests/ecma_6/extensions/DataView-construct-arguments-neutering.js
js/src/tests/ecma_6/extensions/DataView-set-arguments-neutering.js
js/src/tests/ecma_6/extensions/TypedArray-set-object-funky-length-neuters.js
js/src/tests/ecma_6/extensions/TypedArray-subarray-arguments-neutering.js
js/src/tests/ecma_6/extensions/element-setting-ToNumber-neuters.js
js/src/tests/ecma_7/TypedObject/map-neutered-midway.js
js/src/tests/js1_8_5/extensions/clone-transferables.js
js/src/tests/js1_8_5/extensions/typedarray-copyWithin-arguments-neutering.js
js/src/tests/js1_8_5/extensions/typedarray-set-neutering.js
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -2045,48 +2045,48 @@ Deserialize(JSContext* cx, unsigned argc
 
     if (hasTransferable)
         obj->discard();
 
     return true;
 }
 
 static bool
-Neuter(JSContext* cx, unsigned argc, Value* vp)
+DetachArrayBuffer(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     if (args.length() != 2) {
-        JS_ReportError(cx, "wrong number of arguments to neuter()");
+        JS_ReportError(cx, "wrong number of arguments to detachArrayBuffer()");
         return false;
     }
 
     RootedObject obj(cx);
     if (!JS_ValueToObject(cx, args[0], &obj))
         return false;
 
     if (!obj) {
-        JS_ReportError(cx, "neuter must be passed an object");
+        JS_ReportError(cx, "detachArrayBuffer must be passed an object");
         return false;
     }
 
     RootedString str(cx, JS::ToString(cx, args[1]));
     if (!str)
         return false;
     JSAutoByteString dataDisposition(cx, str);
     if (!dataDisposition)
         return false;
 
     DetachDataDisposition changeData;
     if (strcmp(dataDisposition.ptr(), "same-data") == 0) {
         changeData = KeepData;
     } else if (strcmp(dataDisposition.ptr(), "change-data") == 0) {
         changeData = ChangeData;
     } else {
-        JS_ReportError(cx, "unknown parameter 2 to neuter()");
+        JS_ReportError(cx, "unknown parameter 2 to detachArrayBuffer()");
         return false;
     }
 
     if (!JS_DetachArrayBuffer(cx, obj, changeData))
         return false;
 
     args.rval().setUndefined();
     return true;
@@ -3485,22 +3485,22 @@ gc::ZealModeHelpText),
 "serialize(data, [transferables])",
 "  Serialize 'data' using JS_WriteStructuredClone. Returns a structured\n"
 "  clone buffer object."),
 
     JS_FN_HELP("deserialize", Deserialize, 1, 0,
 "deserialize(clonebuffer)",
 "  Deserialize data generated by serialize."),
 
-    JS_FN_HELP("neuter", Neuter, 1, 0,
-"neuter(buffer, \"change-data\"|\"same-data\")",
-"  Neuter the given ArrayBuffer object as if it had been transferred to a\n"
-"  WebWorker. \"change-data\" will update the internal data pointer.\n"
-"  \"same-data\" will leave it set to its original value, to mimic eg\n"
-"  asm.js ArrayBuffer neutering."),
+    JS_FN_HELP("detachArrayBuffer", DetachArrayBuffer, 1, 0,
+"detachArrayBuffer(buffer, \"change-data\"|\"same-data\")",
+"  Detach the given ArrayBuffer object from its memory, i.e. as if it\n"
+"  had been transferred to a WebWorker. \"change-data\" will update\n"
+"  the internal data pointer.  \"same-data\" will leave it set to \n"
+"  its original value, mimicking, e.g.,  asm.js ArrayBuffer detaching."),
 
     JS_FN_HELP("helperThreadCount", HelperThreadCount, 0, 0,
 "helperThreadCount()",
 "  Returns the number of helper threads available for off-main-thread tasks."),
 
 #ifdef JS_TRACE_LOGGING
     JS_FN_HELP("startTraceLogger", EnableTraceLogger, 0, 0,
 "startTraceLogger()",
--- a/js/src/jit-test/manual-tests/TypedObject-TypeDescrIsArrayType-unknown.js
+++ b/js/src/jit-test/manual-tests/TypedObject-TypeDescrIsArrayType-unknown.js
@@ -33,17 +33,17 @@
  *
  * The test is only meaningful if inlining actually happens.  Here is
  * how to verify that (manually):
  *
  * Run this with IONFLAGS=logs, generate pdfs with iongraph, and then
  * try running "pdfgrep TypeDescrIsArrayType func*pass00*.pdf", this
  * might net a function that is a likely candidate for manual inspection.
  *
- * (It is sometimes useful to neuter the assert() macro in the
+ * (It is sometimes useful to comment out the assert() macro in the
  * self-hosted code.)
  */
 
 if (!this.TypedObject) {
     print("No TypedObject, skipping");
     quit();
 }
 
--- a/js/src/jit-test/manual-tests/TypedObject-TypeDescrIsArrayType.js
+++ b/js/src/jit-test/manual-tests/TypedObject-TypeDescrIsArrayType.js
@@ -27,17 +27,17 @@
  * The test is only meaningful if inlining actually happens.  Here is
  * how to verify that (manually):
  *
  * Run this test with IONFLAGS=logs, generate pdfs with iongraph, and
  * then try running "pdfgrep TypeDescrIsArrayType func*pass00*.pdf",
  * this might net a function that is a likely candidate for further
  * manual inspection.
  *
- * (It is sometimes useful to neuter the assert() macro in the
+ * (It is sometimes useful to comment out the assert() macro in the
  * self-hosted code.)
  */
 
 if (!this.TypedObject) {
     print("No TypedObject, skipping");
     quit();
 }
 
--- a/js/src/jit-test/tests/TypedObject/aggregate-set-neutered.js
+++ b/js/src/jit-test/tests/TypedObject/aggregate-set-neutered.js
@@ -1,10 +1,10 @@
 // Bug 991981. Check for various quirks when setting a field of a typed object
-// during which set operation the underlying buffer is neutered.
+// during which set operation the underlying buffer is detached.
 
 if (typeof TypedObject === "undefined")
   quit();
 
 load(libdir + "asserts.js")
 
 var StructType = TypedObject.StructType;
 var uint32 = TypedObject.uint32;
@@ -14,14 +14,15 @@ function main(variant)
   var Point = new StructType({ x: uint32, y: uint32 });
   var Line = new StructType({ from: Point, to: Point });
 
   var buf = new ArrayBuffer(16);
   var line = new Line(buf);
 
   assertThrowsInstanceOf(function()
   {
-    line.to = { x: 22, get y() { neuter(buf, variant); return 44; } };
-  }, TypeError, "setting into a neutered buffer is bad mojo");
+    line.to = { x: 22,
+                get y() { detachArrayBuffer(buf, variant); return 44; } };
+  }, TypeError, "setting into a detached buffer is bad mojo");
 }
 
 main("same-data");
 main("change-data");
--- a/js/src/jit-test/tests/TypedObject/atopneuteredbuffer.js
+++ b/js/src/jit-test/tests/TypedObject/atopneuteredbuffer.js
@@ -1,24 +1,24 @@
 // Bug 976697. Check for various quirks when instantiating a typed
-// object atop an already neutered buffer.
+// object atop a detached buffer.
 
 if (typeof TypedObject === "undefined")
   quit();
 
 load(libdir + "asserts.js")
 
 var {StructType, uint32, Object, Any, storage, objectType} = TypedObject;
 
 function main(variant) { // once a C programmer, always a C programmer.
   var Uints = uint32.array(0);
   var Unit = new StructType({});   // Empty struct type
   var buffer = new ArrayBuffer(0); // Empty buffer
   var p = new Unit(buffer);        // OK
-  neuter(buffer, variant);
+  detachArrayBuffer(buffer, variant);
   assertThrowsInstanceOf(() => new Unit(buffer), TypeError,
-                         "Able to instantiate atop neutered buffer");
+                         "Able to instantiate atop detached buffer");
   assertThrowsInstanceOf(() => new Uints(buffer), TypeError,
-                         "Able to instantiate atop neutered buffer");
+                         "Able to instantiate atop detached buffer");
 }
 
 main("same-data");
 main("change-data");
--- a/js/src/jit-test/tests/TypedObject/bug1082649.js
+++ b/js/src/jit-test/tests/TypedObject/bug1082649.js
@@ -1,16 +1,16 @@
 if (typeof TypedObject === "undefined")
   quit();
 
 var {StructType, uint32, storage} = TypedObject;
 var S = new StructType({f: uint32, g: uint32});
 function main(variant) {
   var s = new S({f: 22, g: 44});
-  neuter(storage(s).buffer, variant);
+  detachArrayBuffer(storage(s).buffer, variant);
   print(storage(s).byteOffset);
 }
 try {
     main("same-data");
     assertEq(true, false);
 } catch (e) {
     assertEq(e instanceof TypeError, true);
 }
--- a/js/src/jit-test/tests/TypedObject/neutertypedobj.js
+++ b/js/src/jit-test/tests/TypedObject/neutertypedobj.js
@@ -9,17 +9,17 @@ function readFromS(s) {
 }
 
 function main(variant) {
   var s = new S({f: 22, g: 44});
 
   for (var i = 0; i < 10; i++)
     assertEq(readFromS(s), 66);
 
-  neuter(storage(s).buffer, variant);
+  detachArrayBuffer(storage(s).buffer, variant);
 
   for (var i = 0; i < 10; i++) {
     var ok = false;
 
     try {
       readFromS(s);
     } catch (e) {
       ok = e instanceof TypeError;
--- a/js/src/jit-test/tests/TypedObject/neutertypedobjsizedarray.js
+++ b/js/src/jit-test/tests/TypedObject/neutertypedobjsizedarray.js
@@ -1,11 +1,11 @@
-// Test the case where we neuter an instance of a fixed-sized array.
+// Test the case where we detach the buffer underlying a fixed-sized array.
 // This is a bit of a tricky case because we cannot (necessarily) fold
-// the neuter check into the bounds check, as we obtain the bounds
+// the detached check into the bounds check, as we obtain the bounds
 // directly from the type.
 
 if (!this.hasOwnProperty("TypedObject"))
   quit();
 
 var {StructType, uint32, storage} = TypedObject;
 var S = new StructType({f: uint32, g: uint32});
 var A = S.array(10);
@@ -17,17 +17,17 @@ function readFrom(a) {
 function main(variant) {
   var a = new A();
   a[2].f = 22;
   a[2].g = 44;
 
   for (var i = 0; i < 10; i++)
     assertEq(readFrom(a), 66);
 
-  neuter(storage(a).buffer, variant);
+  detachArrayBuffer(storage(a).buffer, variant);
 
   for (var i = 0; i < 10; i++) {
     var ok = false;
 
     try {
       readFrom(a);
     } catch (e) {
       ok = e instanceof TypeError;
--- a/js/src/jit-test/tests/TypedObject/neutertypedobjunsizedarray.js
+++ b/js/src/jit-test/tests/TypedObject/neutertypedobjunsizedarray.js
@@ -1,10 +1,10 @@
-// Test the case where we neuter an instance of a variable-length array.
-// Here we can fold the neuter check into the bounds check.
+// Test the case where we detach the buffer underlying a variable-length array.
+// Here we can fold the detached check into the bounds check.
 
 if (!this.hasOwnProperty("TypedObject"))
   quit();
 
 var {StructType, uint32, storage} = TypedObject;
 var S = new StructType({f: uint32, g: uint32});
 var A = S.array(10);
 
@@ -15,17 +15,17 @@ function readFrom(a) {
 function main(variant) {
   var a = new A();
   a[2].f = 22;
   a[2].g = 44;
 
   for (var i = 0; i < 10; i++)
     assertEq(readFrom(a), 66);
 
-  neuter(storage(a).buffer, variant);
+  detachArrayBuffer(storage(a).buffer, variant);
 
   for (var i = 0; i < 10; i++) {
     var ok = false;
 
     try {
       readFrom(a);
     } catch (e) {
       ok = e instanceof TypeError;
--- a/js/src/jit-test/tests/asm.js/neuter-during-arguments-coercion.js
+++ b/js/src/jit-test/tests/asm.js/neuter-during-arguments-coercion.js
@@ -18,11 +18,11 @@ if (isAsmJSCompilationAvailable())
 var i32 = new Int32Array(65536);
 var buffer = i32.buffer;
 var set = f(this, null, buffer);
 if (isAsmJSCompilationAvailable())
   assertEq(isAsmJSFunction(set), true);
 
 try
 {
-  set({ valueOf: function() { neuter(buffer, "same-data"); return 17; } });
+  set({ valueOf() { detachArrayBuffer(buffer, "same-data"); return 17; } });
 }
 catch (e) { /* if an exception thrown, swallow */ }
--- a/js/src/jit-test/tests/asm.js/testNeuter.js
+++ b/js/src/jit-test/tests/asm.js/testNeuter.js
@@ -18,25 +18,32 @@ var m = asmCompile('stdlib', 'foreign', 
                        return i32[i>>2]|0
                    }
                    return {get:get, set:set}`);
 
 var buffer = new ArrayBuffer(BUF_MIN);
 var {get, set} = asmLink(m, this, null, buffer);
 set(4, 42);
 assertEq(get(4), 42);
-assertThrowsInstanceOf(() => neuter(buffer, "change-data"), InternalError);
-assertThrowsInstanceOf(() => neuter(buffer, "same-data"), InternalError);
+assertThrowsInstanceOf(() => detachArrayBuffer(buffer, "change-data"),
+                       InternalError);
+assertThrowsInstanceOf(() => detachArrayBuffer(buffer, "same-data"),
+                       InternalError);
 
 var m = asmCompile('stdlib', 'foreign', 'buffer',
                   `"use asm";
                    var i32 = new stdlib.Int32Array(buffer);
                    var ffi = foreign.ffi;
                    function inner(i) {
                        i=i|0;
                        ffi();
                        return i32[i>>2]|0
                    }
                    return inner`);
 
 var buffer = new ArrayBuffer(BUF_MIN);
-function ffi1() { assertThrowsInstanceOf(() => neuter(buffer, "change-data"), InternalError) }
-var inner = asmLink(m, this, {ffi:ffi1}, buffer);
+function ffi1()
+{
+    assertThrowsInstanceOf(() => detachArrayBuffer(buffer, "change-data"),
+                           InternalError);
+}
+
+var inner = asmLink(m, this, {ffi: ffi1}, buffer);
--- a/js/src/jit-test/tests/basic/testNeutering.js
+++ b/js/src/jit-test/tests/basic/testNeutering.js
@@ -1,25 +1,25 @@
 for (var variant of ["same-data", "change-data"]) {
   var ab = new ArrayBuffer(4);
   var i32 = new Int32Array(ab);
   i32[0] = 42;
-  neuter(ab, variant);
+  detachArrayBuffer(ab, variant);
   assertEq(i32.length, 0);
   assertEq(ab.byteLength, 0);
   assertEq(i32[0], undefined);
 
   var ab = new ArrayBuffer(12);
   var i32 = new Int32Array(ab);
   i32[0] = 42;
-  neuter(ab, variant);
+  detachArrayBuffer(ab, variant);
   assertEq(i32.length, 0);
   assertEq(ab.byteLength, 0);
   assertEq(i32[0], undefined);
 
   var ab = new ArrayBuffer(4096);
   var i32 = new Int32Array(ab);
   i32[0] = 42;
-  neuter(ab, variant);
+  detachArrayBuffer(ab, variant);
   assertEq(i32.length, 0);
   assertEq(ab.byteLength, 0);
   assertEq(i32[0], undefined);
 }
--- a/js/src/jit-test/tests/basic/typed-array-copyWithin.js
+++ b/js/src/jit-test/tests/basic/typed-array-copyWithin.js
@@ -167,36 +167,39 @@ for (var constructor of constructors) {
       tarray.copyWithin({ valueOf: function() { throw 42; } });
       throw new Error("expected to throw");
     }
     catch (e)
     {
       assertEq(e, 42, "should have failed converting target to index");
     }
 
-    function neuterAndConvertTo(x) {
-      return { valueOf() { neuter(tarray.buffer, "change-data"); return x; } };
+    function detachAndConvertTo(x) {
+      return { valueOf() {
+                 detachArrayBuffer(tarray.buffer, "change-data");
+                 return x;
+               } };
     }
 
-    // Neutering during argument processing triggers a TypeError.
+    // Detaching during argument processing triggers a TypeError.
     tarray = new constructor([1, 2, 3, 4, 5]);
     try
     {
-      tarray.copyWithin(0, 3, neuterAndConvertTo(4));
+      tarray.copyWithin(0, 3, detachAndConvertTo(4));
       throw new Error("expected to throw");
     }
     catch (e)
     {
       assertEq(e instanceof TypeError, true,
-               "expected throw with neutered array during set");
+               "expected throw with detached buffer during set");
     }
 
     // ...unless no elements are to be copied.
     tarray = new constructor([1, 2, 3, 4, 5]);
-    assertDeepEq(tarray.copyWithin(0, 3, neuterAndConvertTo(3)),
+    assertDeepEq(tarray.copyWithin(0, 3, detachAndConvertTo(3)),
                  new constructor([]));
 
     /* // fails, unclear whether it should, disabling for now
     // test with a proxy object
     var handler = {
       get: function(recipient, name) {
           return recipient[name] + 2;
       }
--- a/js/src/jit-test/tests/ion/inlining/typedarray-data-inlining-neuter-samedata.js
+++ b/js/src/jit-test/tests/ion/inlining/typedarray-data-inlining-neuter-samedata.js
@@ -1,52 +1,52 @@
 var NONINLINABLE_AMOUNT = 40;
 var SIZEOF_INT32 = 4;
 
 var INLINABLE_INT8_AMOUNT = 4;
 
 // Large arrays with non-inline data
 
-// Neutering and replacing data.
+// Detaching and replacing data.
 var ab1 = new ArrayBuffer(NONINLINABLE_AMOUNT * SIZEOF_INT32);
 var ta1 = new Int32Array(ab1);
 for (var i = 0; i < ta1.length; i++)
   ta1[i] = i + 43;
 function q1() { return ta1[NONINLINABLE_AMOUNT - 1]; }
 assertEq(q1(), NONINLINABLE_AMOUNT - 1 + 43);
 assertEq(q1(), NONINLINABLE_AMOUNT - 1 + 43);
-neuter(ab1, "change-data");
+detachArrayBuffer(ab1, "change-data");
 assertEq(q1(), undefined);
 
-// Neutering preserving data pointer.
+// Detaching preserving data pointer.
 var ab2 = new ArrayBuffer(NONINLINABLE_AMOUNT * SIZEOF_INT32);
 var ta2 = new Int32Array(ab2);
 for (var i = 0; i < ta2.length; i++)
   ta2[i] = i + 77;
 function q2() { return ta2[NONINLINABLE_AMOUNT - 1]; }
 assertEq(q2(), NONINLINABLE_AMOUNT - 1 + 77);
 assertEq(q2(), NONINLINABLE_AMOUNT - 1 + 77);
-neuter(ab2, "same-data");
+detachArrayBuffer(ab2, "same-data");
 assertEq(q2(), undefined);
 
 // Small arrays with inline data
 
-// Neutering and replacing data.
+// Detaching and replacing data.
 var ab3 = new ArrayBuffer(INLINABLE_INT8_AMOUNT);
 var ta3 = new Int8Array(ab3);
 for (var i = 0; i < ta3.length; i++)
   ta3[i] = i + 13;
 function q3() { return ta3[INLINABLE_INT8_AMOUNT - 1]; }
 assertEq(q3(), INLINABLE_INT8_AMOUNT - 1 + 13);
 assertEq(q3(), INLINABLE_INT8_AMOUNT - 1 + 13);
-neuter(ab3, "change-data");
+detachArrayBuffer(ab3, "change-data");
 assertEq(q3(), undefined);
 
-// Neutering preserving data pointer.
+// Detaching preserving data pointer.
 var ab4 = new ArrayBuffer(4);
 var ta4 = new Int8Array(ab4);
 for (var i = 0; i < ta4.length; i++)
   ta4[i] = i + 17;
 function q4() { return ta4[INLINABLE_INT8_AMOUNT - 1]; }
 assertEq(q4(), INLINABLE_INT8_AMOUNT - 1 + 17);
 assertEq(q4(), INLINABLE_INT8_AMOUNT - 1 + 17);
-neuter(ab4, "same-data");
+detachArrayBuffer(ab4, "same-data");
 assertEq(q4(), undefined);
--- a/js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js
+++ b/js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js
@@ -1,42 +1,42 @@
 var INLINE_INT8_AMOUNT = 4;
 var OUT_OF_LINE_INT8_AMOUNT = 237;
 
 // Small and inline
 
-// Neutering and replacing data.
+// Detaching and replacing data.
 var ab1 = new ArrayBuffer(INLINE_INT8_AMOUNT);
 var ta1 = new Int8Array(ab1);
 function q1() { return ta1.length; }
 q1();
 q1();
-neuter(ab1, "change-data");
+detachArrayBuffer(ab1, "change-data");
 assertEq(q1(), 0);
 
-// Neutering preserving data pointer.
+// Detaching preserving data pointer.
 var ab2 = new ArrayBuffer(INLINE_INT8_AMOUNT);
 var ta2 = new Int8Array(ab2);
 function q2() { return ta2.length; }
 q2();
 q2();
-neuter(ab2, "same-data");
+detachArrayBuffer(ab2, "same-data");
 assertEq(q2(), 0);
 
 // Large and out-of-line
 
-// Neutering and replacing data.
+// Detaching and replacing data.
 var ab3 = new ArrayBuffer(OUT_OF_LINE_INT8_AMOUNT);
 var ta3 = new Int8Array(ab3);
 function q3() { return ta3.length; }
 q3();
 q3();
-neuter(ab3, "change-data");
+detachArrayBuffer(ab3, "change-data");
 assertEq(q3(), 0);
 
-// Neutering preserving data pointer.
+// Detaching preserving data pointer.
 var ab4 = new ArrayBuffer(OUT_OF_LINE_INT8_AMOUNT);
 var ta4 = new Int8Array(ab4);
 function q4() { return ta4.length; }
 q4();
 q4();
-neuter(ab4, "same-data");
+detachArrayBuffer(ab4, "same-data");
 assertEq(q4(), 0);
--- a/js/src/jit-test/tests/ion/typedarray-length.js
+++ b/js/src/jit-test/tests/ion/typedarray-length.js
@@ -1,25 +1,25 @@
-function neuterEventually(arr, i, variant)
+function detachArrayBufferEventually(arr, i, variant)
 {
   with (arr)
   {
     // prevent inlining
   }
 
   if (i === 2000)
-    neuter(arr.buffer, variant);
+    detachArrayBuffer(arr.buffer, variant);
 }
 
 function test(variant)
 {
   var buf = new ArrayBuffer(1000);
   var ta = new Int8Array(buf);
 
   for (var i = 0; i < 2500; i++)
   {
-    neuterEventually(ta, i, variant);
+    detachArrayBufferEventually(ta, i, variant);
     assertEq(ta.length, i >= 2000 ? 0 : 1000);
   }
 }
 
 test("change-data");
 test("same-data");
--- a/js/src/jit-test/tests/ion/typedarray-static-load.js
+++ b/js/src/jit-test/tests/ion/typedarray-static-load.js
@@ -2,11 +2,11 @@ var buffer = new ArrayBuffer(512 * 1024)
 var ta = new Uint8Array(buffer);
 
 function load() { return ta[0x1234]; }
 
 load();
 load();
 load();
 
-neuter(buffer, "change-data");
+detachArrayBuffer(buffer, "change-data");
 
 load();
--- a/js/src/jit-test/tests/ion/typedarray-static-store.js
+++ b/js/src/jit-test/tests/ion/typedarray-static-store.js
@@ -2,11 +2,11 @@ var buffer = new ArrayBuffer(512 * 1024)
 var ta = new Uint8Array(buffer);
 
 function store() { ta[0x1234] = 42; }
 
 store();
 store();
 store();
 
-neuter(buffer, "change-data");
+detachArrayBuffer(buffer, "change-data");
 
 store();
--- a/js/src/tests/ecma_6/DataView/detach-after-construction.js
+++ b/js/src/tests/ecma_6/DataView/detach-after-construction.js
@@ -1,13 +1,13 @@
-// |reftest| skip-if(!xulRuntime.shell)
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer
 
-for (var neuterArg of ['change-data', 'same-data']) {
+for (var detachArg of ['change-data', 'same-data']) {
     var buf = new ArrayBuffer([1,2]);
     var bufView = new DataView(buf);
 
-    neuter(buf, neuterArg);
+    detachArrayBuffer(buf, detachArg);
 
-    assertThrowsInstanceOf(()=>bufView.getInt8(0), TypeError);
+    assertThrowsInstanceOf(() => bufView.getInt8(0), TypeError);
 }
 
 if (typeof reportCompare === 'function')
-    reportCompare(0,0,"OK");
+    reportCompare(0, 0, "OK");
--- a/js/src/tests/ecma_6/TypedArray/constructor-non-detached.js
+++ b/js/src/tests/ecma_6/TypedArray/constructor-non-detached.js
@@ -1,29 +1,29 @@
-// |reftest| skip-if(!xulRuntime.shell)
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer
 
 const constructors = [
     Int8Array,
     Uint8Array,
     Uint8ClampedArray,
     Int16Array,
     Uint16Array,
     Int32Array,
     Uint32Array,
     Float32Array,
     Float64Array
 ];
 
 for (var constructor of constructors) {
-    for (var neuterType of ["change-data", "same-data"]) {
+    for (var detachType of ["change-data", "same-data"]) {
         var buf = new constructor();
-        neuter(buf.buffer, neuterType);
-        assertThrowsInstanceOf(()=> new constructor(buf), TypeError);
+        detachArrayBuffer(buf.buffer, detachType);
+        assertThrowsInstanceOf(() => new constructor(buf), TypeError);
 
         var buffer = new ArrayBuffer();
-        neuter(buffer, neuterType);
-        assertThrowsInstanceOf(()=> new constructor(buffer), TypeError);
+        detachArrayBuffer(buffer, detachType);
+        assertThrowsInstanceOf(() => new constructor(buffer), TypeError);
     }
 }
 
 
 if (typeof reportCompare === "function")
     reportCompare(true, true);
--- a/js/src/tests/ecma_6/TypedArray/detached-array-buffer-checks.js
+++ b/js/src/tests/ecma_6/TypedArray/detached-array-buffer-checks.js
@@ -1,16 +1,16 @@
-// |reftest| skip-if(!xulRuntime.shell)
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer
 
 // Nearly every %TypedArray%.prototype method should throw a TypeError when called
 // atop a detached array buffer. Here we check verify that this holds true for
 // all relevant functions.
 let buffer = new ArrayBuffer(32);
 let array  = new Int32Array(buffer);
-neuter(buffer, "change-data");
+detachArrayBuffer(buffer, "change-data");
 
 // A nice poisoned callable to ensure that we fail on a detached buffer check
 // before a method attempts to do anything with its arguments.
 var POISON = (function() {
     var internalTarget = {};
     var throwForAllTraps =
     new Proxy(internalTarget, { get(target, prop, receiver) {
         assertEq(target, internalTarget);
@@ -29,17 +29,17 @@ assertThrowsInstanceOf(() => {
     array.entries();
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
     array.fill(POISON);
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
-    array.filter((x) => x);
+    array.filter(POISON);
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
     array.find(POISON);
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
     array.findIndex(POISON);
@@ -53,17 +53,17 @@ assertThrowsInstanceOf(() => {
     array.indexOf(POISON);
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
     array.includes(POISON);
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
-    array.join();
+    array.join(POISON);
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
     array.keys();
 }, TypeError);
 
 assertThrowsInstanceOf(() => {
     array.lastIndexOf(POISON);
--- a/js/src/tests/ecma_6/TypedArray/sort_errors.js
+++ b/js/src/tests/ecma_6/TypedArray/sort_errors.js
@@ -1,15 +1,15 @@
-// |reftest| skip-if(!xulRuntime.shell)
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer
 
 // Ensure that TypedArrays throw when attempting to sort a detached ArrayBuffer
 assertThrowsInstanceOf(() => {
     let buffer = new ArrayBuffer(32);
     let array  = new Int32Array(buffer);
-    neuter(buffer, "change-data");
+    detachArrayBuffer(buffer, "change-data");
     array.sort();
 }, TypeError);
 
 // Ensure that TypedArray.prototype.sort will not sort non-TypedArrays
 assertThrowsInstanceOf(() => {
     let array = [4, 3, 2, 1];
     Int32Array.prototype.sort.call(array);
 }, TypeError);
--- a/js/src/tests/ecma_6/extensions/ArrayBuffer-slice-arguments-neutering.js
+++ b/js/src/tests/ecma_6/extensions/ArrayBuffer-slice-arguments-neutering.js
@@ -1,81 +1,81 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var gTestfile = "ArrayBuffer-slice-arguments-neutering.js";
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 991981;
 var summary =
   "ArrayBuffer.prototype.slice shouldn't misbehave horribly if " +
-  "index-argument conversion neuters the ArrayBuffer being sliced";
+  "index-argument conversion detaches the ArrayBuffer being sliced";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 function testStart(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var start =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         gc();
         return 0x800;
       }
     };
 
   var ok = false;
   try
   {
     ab.slice(start);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testStart("change-data");
 testStart("same-data");
 
 function testEnd(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var end =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         gc();
         return 0x1000;
       }
     };
 
   var ok = false;
   try
   {
     ab.slice(0x800, end);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "byteLength weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for byteLength weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for byteLength weirdness");
 }
 testEnd("change-data");
 testEnd("same-data");
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/tests/ecma_6/extensions/DataView-construct-arguments-neutering.js
+++ b/js/src/tests/ecma_6/extensions/DataView-construct-arguments-neutering.js
@@ -1,81 +1,81 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var gTestfile = "DataView-construct-arguments-neutering.js";
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 991981;
 var summary =
   "new DataView(...) shouldn't misbehave horribly if index-argument " +
-  "conversion neuters the ArrayBuffer to be viewed";
+  "conversion detaches the ArrayBuffer to be viewed";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 function testByteOffset(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var start =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         gc();
         return 0x800;
       }
     };
 
   var ok = false;
   try
   {
     new DataView(ab, start);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "byteOffset weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for byteOffset weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for byteOffset weirdness");
 }
 testByteOffset("change-data");
 testByteOffset("same-data");
 
 function testByteLength(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var len =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         gc();
         return 0x800;
       }
     };
 
   var ok = false;
   try
   {
     new DataView(ab, 0x800, len);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "byteLength weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for byteLength weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for byteLength weirdness");
 }
 testByteLength("change-data");
 testByteLength("same-data");
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/tests/ecma_6/extensions/DataView-set-arguments-neutering.js
+++ b/js/src/tests/ecma_6/extensions/DataView-set-arguments-neutering.js
@@ -1,20 +1,20 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var gTestfile = "DataView-set-arguments-neutering.js";
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 991981;
 var summary =
   "DataView.prototype.set* methods shouldn't misbehave horribly if " +
-  "index-argument conversion neuters the ArrayBuffer being modified";
+  "index-argument conversion detaches the ArrayBuffer being modified";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 function testIndex(dataType)
@@ -22,64 +22,64 @@ function testIndex(dataType)
   var ab = new ArrayBuffer(0x1000);
 
   var dv = new DataView(ab);
 
   var start =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         gc();
         return 0xFFF;
       }
     };
 
   var ok = false;
   try
   {
     dv.setUint8(start, 0x42);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "should have thrown");
-  assertEq(ab.byteLength, 0, "should have been neutered correctly");
+  assertEq(ab.byteLength, 0, "should have been detached correctly");
 }
 testIndex("change-data");
 testIndex("same-data");
 
 function testValue(dataType)
 {
   var ab = new ArrayBuffer(0x100000);
 
   var dv = new DataView(ab);
 
   var value =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         gc();
         return 0x42;
       }
     };
 
   var ok = false;
   try
   {
     dv.setUint8(0xFFFFF, value);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "should have thrown");
-  assertEq(ab.byteLength, 0, "should have been neutered correctly");
+  assertEq(ab.byteLength, 0, "should have been detached correctly");
 }
 testValue("change-data");
 testValue("same-data");
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/tests/ecma_6/extensions/TypedArray-set-object-funky-length-neuters.js
+++ b/js/src/tests/ecma_6/extensions/TypedArray-set-object-funky-length-neuters.js
@@ -1,20 +1,21 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var gTestfile = "set-object-funky-length-neuters.js";
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 991981;
 var summary =
-  "%TypedArray.set(object with funky length property, numeric offset) " +
-  "shouldn't misbehave if the funky length property neuters this typed array";
+  "%TypedArray%.prototype.set(object w/funky length property, offset) " +
+  "shouldn't misbehave if the funky length property detaches this typed " +
+  "array's buffer";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 var ctors = [Int8Array, Uint8Array, Uint8ClampedArray,
@@ -35,17 +36,17 @@ ctors.forEach(function(TypedArray) {
         4: 37,
         5: 9,
         6: 72,
         7: 31,
         8: 22,
         9: 0,
         get length()
         {
-          neuter(buf, dataHandling);
+          detachArrayBuffer(buf, dataHandling);
           return 10;
         }
       };
 
       var passed = false;
       try
       {
         ta.set(arraylike, 0x1234);
--- a/js/src/tests/ecma_6/extensions/TypedArray-subarray-arguments-neutering.js
+++ b/js/src/tests/ecma_6/extensions/TypedArray-subarray-arguments-neutering.js
@@ -1,113 +1,113 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var gTestfile = "TypedArray-subarray-arguments-neutering.js";
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 991981;
 var summary =
   "%TypedArray.prototype.subarray shouldn't misbehave horribly if " +
-  "index-argument conversion neuters the underlying ArrayBuffer";
+  "index-argument conversion detaches the underlying ArrayBuffer";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 function testBegin(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var begin =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         return 0x800;
       }
     };
 
   var ta = new Uint8Array(ab);
 
   var ok = false;
   try
   {
     ta.subarray(begin);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testBegin("change-data");
 testBegin("same-data");
 
 function testBeginWithEnd(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var begin =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         return 0x800;
       }
     };
 
   var ta = new Uint8Array(ab);
 
   var ok = false;
   try
   {
     ta.subarray(begin, 0x1000);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testBeginWithEnd("change-data");
 testBeginWithEnd("same-data");
 
 function testEnd(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var end =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         return 0x1000;
       }
     };
 
   var ta = new Uint8Array(ab);
 
   var ok = false;
   try
   {
     ta.subarray(0x800, end);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testEnd("change-data");
 testEnd("same-data");
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/tests/ecma_6/extensions/element-setting-ToNumber-neuters.js
+++ b/js/src/tests/ecma_6/extensions/element-setting-ToNumber-neuters.js
@@ -1,40 +1,40 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 "use strict"; // make test fail when limitation below is fixed
 
 var gTestfile = 'element-setting-ToNumber-neuters.js';
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 1001547;
 var summary =
-  "Don't assert assigning into memory neutered while converting the value to " +
+  "Don't assert assigning into memory detached while converting the value to " +
   "assign into a number";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 // Technically per current spec the element-sets should throw in strict mode,
 // but we just silently do nothing for now, somewhat due to limitations of our
 // internal MOP (which can't easily say "try this special behavior, else fall
 // back on normal logic"), somewhat because it's consistent with current
 // behavior (as of this test's addition) for out-of-bounds sets.
 
 var ab1 = new ArrayBuffer(64);
 var ta1 = new Uint32Array(ab1);
-ta1[4] = { valueOf: function() { neuter(ab1, "change-data"); return 5; } };
+ta1[4] = { valueOf() { detachArrayBuffer(ab1, "change-data"); return 5; } };
 
 var ab2 = new ArrayBuffer(64);
 var ta2 = new Uint32Array(ab2);
-ta2[4] = { valueOf: function() { neuter(ab2, "same-data"); return 5; } };
+ta2[4] = { valueOf() { detachArrayBuffer(ab2, "same-data"); return 5; } };
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
 
 print("Tests complete");
--- a/js/src/tests/ecma_7/TypedObject/map-neutered-midway.js
+++ b/js/src/tests/ecma_7/TypedObject/map-neutered-midway.js
@@ -1,36 +1,37 @@
-// |reftest| skip-if(!this.hasOwnProperty("TypedObject")||!xulRuntime.shell) -- needs TypedObject, neuter()
+// |reftest| skip-if(!this.hasOwnProperty("TypedObject")||!xulRuntime.shell) -- needs TypedObject, detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var BUGNUMBER = 991981;
 var summary =
-  "Behavior of mapping from an array neutered midway through mapping";
+  "Behavior of mapping from an array whose buffer is detached midway through " +
+  "mapping";
 
 function mapOneDimArrayOfUint8(dataHandling)
 {
   var FourByteArray = TypedObject.uint8.array(4);
   var FourByteArrayArray = FourByteArray.array(4);
 
   var buf = new ArrayBuffer(16);
   var arr = new FourByteArrayArray(buf);
 
   var count = 0;
   assertThrowsInstanceOf(function()
   {
     arr.map(function(v)
     {
       if (count++ > 0)
-        neuter(buf, dataHandling);
+        detachArrayBuffer(buf, dataHandling);
       return new FourByteArray();
     });
-  }, TypeError, "mapping of a neutered object worked?");
+  }, TypeError, "mapping of a detached object worked?");
 }
 
 function runTests()
 {
   print(BUGNUMBER + ": " + summary);
 
   mapOneDimArrayOfUint8("change-data");
   mapOneDimArrayOfUint8("same-data");
--- a/js/src/tests/js1_8_5/extensions/clone-transferables.js
+++ b/js/src/tests/js1_8_5/extensions/clone-transferables.js
@@ -28,59 +28,69 @@ function test() {
             var buf = new ArrayBuffer(size);
             var old_arr = new ctor(buf);
             assertEq(buf.byteLength, size);
             assertEq(buf, old_arr.buffer);
             if (!dataview)
                 assertEq(old_arr.length, size / old_arr.BYTES_PER_ELEMENT);
 
             var copy_arr = deserialize(serialize(old_arr, [ buf ]));
-            assertEq(buf.byteLength, 0, "donor array buffer should be neutered");
-            if (!dataview)
-                assertEq(old_arr.length, 0, "donor typed array should be neutered");
+            assertEq(buf.byteLength, 0,
+                     "donor array buffer should be detached");
+            if (!dataview) {
+                assertEq(old_arr.length, 0,
+                         "donor typed array should be detached");
+            }
             assertEq(copy_arr.buffer.byteLength == size, true);
             if (!dataview)
                 assertEq(copy_arr.length, size / old_arr.BYTES_PER_ELEMENT);
 
             buf = null;
             old_arr = null;
             gc(); // Tickle the ArrayBuffer -> view management
         }
 
         for (var ctor of constructors) {
             var dataview = (ctor === DataView);
 
             var buf = new ArrayBuffer(size);
             var old_arr = new ctor(buf);
             var dv = new DataView(buf); // Second view
             var copy_arr = deserialize(serialize(old_arr, [ buf ]));
-            assertEq(buf.byteLength, 0, "donor array buffer should be neutered");
-            assertEq(old_arr.byteLength, 0, "donor typed array should be neutered");
-            if (!dataview)
-                assertEq(old_arr.length, 0, "donor typed array should be neutered");
-            assertEq(dv.byteLength, 0, "all views of donor array buffer should be neutered");
+            assertEq(buf.byteLength, 0,
+                     "donor array buffer should be detached");
+            assertEq(old_arr.byteLength, 0,
+                     "donor typed array should be detached");
+            if (!dataview) {
+                assertEq(old_arr.length, 0,
+                         "donor typed array should be detached");
+            }
+            assertEq(dv.byteLength, 0,
+                     "all views of donor array buffer should have zero " +
+                     "length because their underlying buffer is detached");
 
             buf = null;
             old_arr = null;
             gc(); // Tickle the ArrayBuffer -> view management
         }
 
         // Mutate the buffer during the clone operation. The modifications should be visible.
         if (size >= 4) {
             old = new ArrayBuffer(size);
             var view = new Int32Array(old);
             view[0] = 1;
             var mutator = { get foo() { view[0] = 2; } };
             var copy = deserialize(serialize([ old, mutator ], [old]));
             var viewCopy = new Int32Array(copy[0]);
-            assertEq(view.length, 0); // Neutered
+            assertEq(view.length, 0); // Underlying buffer now detached.
             assertEq(viewCopy[0], 2);
         }
 
-        // Neuter the buffer during the clone operation. Should throw an exception.
+        // Detach the buffer during the clone operation. Should throw an
+        // exception.
         if (size >= 4) {
             old = new ArrayBuffer(size);
             var mutator = {
                 get foo() {
                     deserialize(serialize(old, [old]));
                 }
             };
             // The throw is not yet implemented, bug 919259.
--- a/js/src/tests/js1_8_5/extensions/typedarray-copyWithin-arguments-neutering.js
+++ b/js/src/tests/js1_8_5/extensions/typedarray-copyWithin-arguments-neutering.js
@@ -1,113 +1,113 @@
-// |reftest| skip-if(!xulRuntime.shell) -- needs neuter()
+// |reftest| skip-if(!xulRuntime.shell) -- needs detachArrayBuffer()
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  */
 
 var gTestfile = "typedarray-copyWithin-arguments-neutering.js";
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 991981;
 var summary =
   "%TypedArray.prototype.copyWithin shouldn't misbehave horribly if " +
-  "index-argument conversion neuters the underlying ArrayBuffer";
+  "index-argument conversion detaches the underlying ArrayBuffer";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
 function testBegin(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var begin =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         return 0x800;
       }
     };
 
   var ta = new Uint8Array(ab);
 
   var ok = false;
   try
   {
     ta.copyWithin(0, begin, 0x1000);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testBegin("change-data");
 testBegin("same-data");
 
 function testEnd(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var end =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         return 0x1000;
       }
     };
 
   var ta = new Uint8Array(ab);
 
   var ok = false;
   try
   {
     ta.copyWithin(0, 0x800, end);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testEnd("change-data");
 testEnd("same-data");
 
 function testDest(dataType)
 {
   var ab = new ArrayBuffer(0x1000);
 
   var dest =
     {
       valueOf: function()
       {
-        neuter(ab, dataType);
+        detachArrayBuffer(ab, dataType);
         return 0;
       }
     };
 
   var ta = new Uint8Array(ab);
 
   var ok = false;
   try
   {
     ta.copyWithin(dest, 0x800, 0x1000);
   }
   catch (e)
   {
     ok = true;
   }
   assertEq(ok, true, "start weirdness should have thrown");
-  assertEq(ab.byteLength, 0, "neutering should work for start weirdness");
+  assertEq(ab.byteLength, 0, "detaching should work for start weirdness");
 }
 testDest("change-data");
 testDest("same-data");
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/tests/js1_8_5/extensions/typedarray-set-neutering.js
+++ b/js/src/tests/js1_8_5/extensions/typedarray-set-neutering.js
@@ -25,17 +25,17 @@ var src1 = [ 10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              ];
 Object.defineProperty(src1, 4, {
   get: function () {
-    neuter(ab1, "change-data");
+    detachArrayBuffer(ab1, "change-data");
     gc();
     return 200;
   }
 });
 
 a1.set(src1);
 
 // Not really needed
@@ -53,17 +53,17 @@ var src2 = [ 10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              10, 20, 30, 40,
              ];
 Object.defineProperty(src2, 4, {
   get: function () {
-    neuter(ab2, "same-data");
+    detachArrayBuffer(ab2, "same-data");
     gc();
     return 200;
   }
 });
 
 a2.set(src2);
 
 // Not really needed