Remove unnecessary checks for functions

This commit is contained in:
André Bargull 2025-04-30 14:16:16 +02:00 committed by Philip Chimento
parent b096b30f60
commit 47ba37f098
3 changed files with 142 additions and 147 deletions

View File

@ -212,12 +212,10 @@ TestGenerator(
["fee", "fi", "fo", "fum", undefined]); ["fee", "fi", "fo", "fum", undefined]);
// GC. // GC.
if (typeof gc == 'function') {
TestGenerator(function* g16() { yield "baz"; $262.gc(); yield "qux"; }, TestGenerator(function* g16() { yield "baz"; $262.gc(); yield "qux"; },
["baz", "qux", undefined], ["baz", "qux", undefined],
"foo", "foo",
["baz", "qux", undefined]); ["baz", "qux", undefined]);
}
// Receivers. // Receivers.
TestGenerator( TestGenerator(

View File

@ -13,7 +13,7 @@ esid: pending
features: [Symbol] features: [Symbol]
---*/ ---*/
if ("entries" in Object) { assert.sameValue("entries" in Object, true);
assert.sameValue(Object.entries.length, 1); assert.sameValue(Object.entries.length, 1);
var o, entries; var o, entries;
@ -97,5 +97,3 @@ if ("entries" in Object) {
assert.sameValue(ownKeysCallCount, 1); assert.sameValue(ownKeysCallCount, 1);
assert.deepEqual(entries, [["c", 3], ["a", 1]]); assert.deepEqual(entries, [["c", 3], ["a", 1]]);
assert.deepEqual(getOwnPropertyDescriptorCalls, ["c", "a"]); assert.deepEqual(getOwnPropertyDescriptorCalls, ["c", "a"]);
}

View File

@ -12,7 +12,8 @@ description: |
esid: pending esid: pending
features: [Symbol] features: [Symbol]
---*/ ---*/
if ("values" in Object) {
assert.sameValue("values" in Object, true);
assert.sameValue(Object.values.length, 1); assert.sameValue(Object.values.length, 1);
var o, values; var o, values;
@ -96,5 +97,3 @@ if ("values" in Object) {
assert.sameValue(ownKeysCallCount, 1); assert.sameValue(ownKeysCallCount, 1);
assert.compareArray(values, [3, 1]); assert.compareArray(values, [3, 1]);
assert.compareArray(getOwnPropertyDescriptorCalls, ["c", "a"]); assert.compareArray(getOwnPropertyDescriptorCalls, ["c", "a"]);
}