mirror of https://github.com/tc39/test262.git
Update tests to use APIs defined by included files
The `$DETACHBUFFER` function is the preferred mechanism for detaching array buffers. Likewise, `verifyNotWritable` is the preferred mechanism for asserting lack of writability.
This commit is contained in:
parent
f26c2a11bd
commit
1e4e524251
|
@ -18,7 +18,7 @@ testWithTypedArrayConstructors(TA => {
|
|||
var i = 0;
|
||||
assert.throws(TypeError, () => {
|
||||
for (let key of typedArray.keys()) {
|
||||
$262.detachArrayBuffer(typedArray.buffer);
|
||||
$DETACHBUFFER(typedArray.buffer);
|
||||
i++;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,9 +18,7 @@ Object.defineProperties(obj, {
|
|||
}
|
||||
});
|
||||
|
||||
if (isWritable(obj, "prop")) {
|
||||
$ERROR('Expected obj["prop"] not to be writable.');
|
||||
}
|
||||
verifyNotWritable(obj, "prop");
|
||||
|
||||
if (!obj.hasOwnProperty("prop")) {
|
||||
$ERROR('Expected obj.hasOwnProperty("prop") to be true, actually ' + obj.hasOwnProperty("prop"));
|
||||
|
|
|
@ -36,7 +36,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||
{
|
||||
value: {
|
||||
valueOf: function() {
|
||||
$262.detachArrayBuffer(ta.buffer);
|
||||
$DETACHBUFFER(ta.buffer);
|
||||
return 42n;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||
{
|
||||
value: {
|
||||
valueOf: function() {
|
||||
$262.detachArrayBuffer(ta.buffer);
|
||||
$DETACHBUFFER(ta.buffer);
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||
assert.throws(TypeError, function() {
|
||||
Reflect.set(ta, 0, {
|
||||
valueOf: function() {
|
||||
$262.detachArrayBuffer(ta.buffer);
|
||||
$DETACHBUFFER(ta.buffer);
|
||||
return 42n;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -32,7 +32,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||
assert.throws(TypeError, function() {
|
||||
Reflect.set(ta, 0, {
|
||||
valueOf: function() {
|
||||
$262.detachArrayBuffer(ta.buffer);
|
||||
$DETACHBUFFER(ta.buffer);
|
||||
return 42;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue