[cleanup] Change error message for neutered -> detached

Bug: chromium:913887
Change-Id: If533bb85675456b674f79486b06a44e447f40aee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1739371
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63715}
This commit is contained in:
Peter Marshall 2019-09-11 17:45:30 +02:00 committed by Commit Bot
parent 27df753f45
commit 6ad781ccd5
3 changed files with 6 additions and 7 deletions

View File

@ -10,7 +10,6 @@
namespace v8 {
namespace internal {
// TODO(913887): fix the use of 'neuter' in these error messages.
#define MESSAGE_TEMPLATES(T) \
/* Error */ \
T(None, "") \
@ -78,7 +77,7 @@ namespace internal {
T(DebuggerType, "Debugger: Parameters have wrong types.") \
T(DeclarationMissingInitializer, "Missing initializer in % declaration") \
T(DefineDisallowed, "Cannot define property %, object is not extensible") \
T(DetachedOperation, "Cannot perform % on a neutered ArrayBuffer") \
T(DetachedOperation, "Cannot perform % on a detached ArrayBuffer") \
T(DuplicateTemplateProperty, "Object template has duplicate property '%'") \
T(ExtendsValueNotConstructor, \
"Class extends value % is not a constructor or null") \
@ -554,7 +553,7 @@ namespace internal {
T(DataCloneError, "% could not be cloned.") \
T(DataCloneErrorOutOfMemory, "Data cannot be cloned, out of memory.") \
T(DataCloneErrorDetachedArrayBuffer, \
"An ArrayBuffer is neutered and could not be cloned.") \
"An ArrayBuffer is detached and could not be cloned.") \
T(DataCloneErrorSharedArrayBufferTransferred, \
"A SharedArrayBuffer could not be cloned. SharedArrayBuffer must not be " \
"transferred.") \

View File

@ -17,7 +17,7 @@ function Baseline() {
%NeverOptimizeFunction(Baseline);
assertThrows(Baseline, TypeError,
"Cannot perform Array Iterator.prototype.next on a neutered ArrayBuffer");
"Cannot perform Array Iterator.prototype.next on a detached ArrayBuffer");
function Turbo(count = 10000) {
let array = Array(10000);
@ -45,4 +45,4 @@ Turbo(10);
%OptimizeFunctionOnNextCall(Turbo);
assertThrows(Turbo, TypeError,
"Cannot perform Array Iterator.prototype.next on a neutered ArrayBuffer");
"Cannot perform Array Iterator.prototype.next on a detached ArrayBuffer");

View File

@ -166,13 +166,13 @@ for (constructor of typedArrayConstructors) {
const ta = new constructor([1]);
%ArrayBufferDetach(ta.buffer);
ta.find(() => {});
}, "Cannot perform %TypedArray%.prototype.find on a neutered ArrayBuffer", TypeError);
}, "Cannot perform %TypedArray%.prototype.find on a detached ArrayBuffer", TypeError);
test(() => {
const ta = new constructor([1]);
%ArrayBufferDetach(ta.buffer);
ta.findIndex(() => {});
}, "Cannot perform %TypedArray%.prototype.findIndex on a neutered ArrayBuffer", TypeError);
}, "Cannot perform %TypedArray%.prototype.findIndex on a detached ArrayBuffer", TypeError);
}
// kFirstArgumentNotRegExp