mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
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;
|
var i = 0;
|
||||||
assert.throws(TypeError, () => {
|
assert.throws(TypeError, () => {
|
||||||
for (let key of typedArray.keys()) {
|
for (let key of typedArray.keys()) {
|
||||||
$262.detachArrayBuffer(typedArray.buffer);
|
$DETACHBUFFER(typedArray.buffer);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -18,9 +18,7 @@ Object.defineProperties(obj, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isWritable(obj, "prop")) {
|
verifyNotWritable(obj, "prop");
|
||||||
$ERROR('Expected obj["prop"] not to be writable.');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!obj.hasOwnProperty("prop")) {
|
if (!obj.hasOwnProperty("prop")) {
|
||||||
$ERROR('Expected obj.hasOwnProperty("prop") to be true, actually ' + obj.hasOwnProperty("prop"));
|
$ERROR('Expected obj.hasOwnProperty("prop") to be true, actually ' + obj.hasOwnProperty("prop"));
|
||||||
|
@ -36,7 +36,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
{
|
{
|
||||||
value: {
|
value: {
|
||||||
valueOf: function() {
|
valueOf: function() {
|
||||||
$262.detachArrayBuffer(ta.buffer);
|
$DETACHBUFFER(ta.buffer);
|
||||||
return 42n;
|
return 42n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
{
|
{
|
||||||
value: {
|
value: {
|
||||||
valueOf: function() {
|
valueOf: function() {
|
||||||
$262.detachArrayBuffer(ta.buffer);
|
$DETACHBUFFER(ta.buffer);
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Reflect.set(ta, 0, {
|
Reflect.set(ta, 0, {
|
||||||
valueOf: function() {
|
valueOf: function() {
|
||||||
$262.detachArrayBuffer(ta.buffer);
|
$DETACHBUFFER(ta.buffer);
|
||||||
return 42n;
|
return 42n;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -32,7 +32,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Reflect.set(ta, 0, {
|
Reflect.set(ta, 0, {
|
||||||
valueOf: function() {
|
valueOf: function() {
|
||||||
$262.detachArrayBuffer(ta.buffer);
|
$DETACHBUFFER(ta.buffer);
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user