[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:
parent
27df753f45
commit
6ad781ccd5
@ -10,7 +10,6 @@
|
|||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
// TODO(913887): fix the use of 'neuter' in these error messages.
|
|
||||||
#define MESSAGE_TEMPLATES(T) \
|
#define MESSAGE_TEMPLATES(T) \
|
||||||
/* Error */ \
|
/* Error */ \
|
||||||
T(None, "") \
|
T(None, "") \
|
||||||
@ -78,7 +77,7 @@ namespace internal {
|
|||||||
T(DebuggerType, "Debugger: Parameters have wrong types.") \
|
T(DebuggerType, "Debugger: Parameters have wrong types.") \
|
||||||
T(DeclarationMissingInitializer, "Missing initializer in % declaration") \
|
T(DeclarationMissingInitializer, "Missing initializer in % declaration") \
|
||||||
T(DefineDisallowed, "Cannot define property %, object is not extensible") \
|
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(DuplicateTemplateProperty, "Object template has duplicate property '%'") \
|
||||||
T(ExtendsValueNotConstructor, \
|
T(ExtendsValueNotConstructor, \
|
||||||
"Class extends value % is not a constructor or null") \
|
"Class extends value % is not a constructor or null") \
|
||||||
@ -554,7 +553,7 @@ namespace internal {
|
|||||||
T(DataCloneError, "% could not be cloned.") \
|
T(DataCloneError, "% could not be cloned.") \
|
||||||
T(DataCloneErrorOutOfMemory, "Data cannot be cloned, out of memory.") \
|
T(DataCloneErrorOutOfMemory, "Data cannot be cloned, out of memory.") \
|
||||||
T(DataCloneErrorDetachedArrayBuffer, \
|
T(DataCloneErrorDetachedArrayBuffer, \
|
||||||
"An ArrayBuffer is neutered and could not be cloned.") \
|
"An ArrayBuffer is detached and could not be cloned.") \
|
||||||
T(DataCloneErrorSharedArrayBufferTransferred, \
|
T(DataCloneErrorSharedArrayBufferTransferred, \
|
||||||
"A SharedArrayBuffer could not be cloned. SharedArrayBuffer must not be " \
|
"A SharedArrayBuffer could not be cloned. SharedArrayBuffer must not be " \
|
||||||
"transferred.") \
|
"transferred.") \
|
||||||
|
@ -17,7 +17,7 @@ function Baseline() {
|
|||||||
%NeverOptimizeFunction(Baseline);
|
%NeverOptimizeFunction(Baseline);
|
||||||
|
|
||||||
assertThrows(Baseline, TypeError,
|
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) {
|
function Turbo(count = 10000) {
|
||||||
let array = Array(10000);
|
let array = Array(10000);
|
||||||
@ -45,4 +45,4 @@ Turbo(10);
|
|||||||
%OptimizeFunctionOnNextCall(Turbo);
|
%OptimizeFunctionOnNextCall(Turbo);
|
||||||
|
|
||||||
assertThrows(Turbo, TypeError,
|
assertThrows(Turbo, TypeError,
|
||||||
"Cannot perform Array Iterator.prototype.next on a neutered ArrayBuffer");
|
"Cannot perform Array Iterator.prototype.next on a detached ArrayBuffer");
|
||||||
|
@ -166,13 +166,13 @@ for (constructor of typedArrayConstructors) {
|
|||||||
const ta = new constructor([1]);
|
const ta = new constructor([1]);
|
||||||
%ArrayBufferDetach(ta.buffer);
|
%ArrayBufferDetach(ta.buffer);
|
||||||
ta.find(() => {});
|
ta.find(() => {});
|
||||||
}, "Cannot perform %TypedArray%.prototype.find on a neutered ArrayBuffer", TypeError);
|
}, "Cannot perform %TypedArray%.prototype.find on a detached ArrayBuffer", TypeError);
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
const ta = new constructor([1]);
|
const ta = new constructor([1]);
|
||||||
%ArrayBufferDetach(ta.buffer);
|
%ArrayBufferDetach(ta.buffer);
|
||||||
ta.findIndex(() => {});
|
ta.findIndex(() => {});
|
||||||
}, "Cannot perform %TypedArray%.prototype.findIndex on a neutered ArrayBuffer", TypeError);
|
}, "Cannot perform %TypedArray%.prototype.findIndex on a detached ArrayBuffer", TypeError);
|
||||||
}
|
}
|
||||||
|
|
||||||
// kFirstArgumentNotRegExp
|
// kFirstArgumentNotRegExp
|
||||||
|
Loading…
Reference in New Issue
Block a user