Remove unnecessary tests if assert.sameValue is defined

This commit is contained in:
André Bargull 2025-04-30 14:16:12 +02:00 committed by Philip Chimento
parent 61286de40c
commit 0426d82c35
6 changed files with 6 additions and 18 deletions

View File

@ -8,6 +8,7 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
// Function#caller restrictions as proposed by // Function#caller restrictions as proposed by
// https://github.com/claudepache/es-legacy-function-reflection/ // https://github.com/claudepache/es-legacy-function-reflection/
@ -32,7 +33,3 @@ assert.sameValue([0].map(caller)[0], null);
assert.sameValue(function*() { assert.sameValue(function*() {
yield caller(); yield caller();
}().next().value, null); }().next().value, null);
if (typeof assert.sameValue === "function") {
}

View File

@ -8,6 +8,7 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
let values = [ let values = [
[-0, undefined, "0e+0"], [-0, undefined, "0e+0"],
[-0, 0, "0e+0"], [-0, 0, "0e+0"],
@ -122,6 +123,3 @@ let values = [
for (let [val, prec, expected] of values) { for (let [val, prec, expected] of values) {
assert.sameValue(Number.prototype.toExponential.call(val, prec), expected); assert.sameValue(Number.prototype.toExponential.call(val, prec), expected);
} }
if (typeof assert.sameValue === "function") {
}

View File

@ -8,6 +8,7 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
let values = [ let values = [
[-0, undefined, "0"], [-0, undefined, "0"],
[-0, 0, "0"], [-0, 0, "0"],
@ -122,6 +123,3 @@ let values = [
for (let [val, prec, expected] of values) { for (let [val, prec, expected] of values) {
assert.sameValue(Number.prototype.toFixed.call(val, prec), expected); assert.sameValue(Number.prototype.toFixed.call(val, prec), expected);
} }
if (typeof assert.sameValue === "function") {
}

View File

@ -8,6 +8,7 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
let values = [ let values = [
[-0, undefined, "0"], [-0, undefined, "0"],
[-0, 1, "0"], [-0, 1, "0"],
@ -104,6 +105,3 @@ let values = [
for (let [val, prec, expected] of values) { for (let [val, prec, expected] of values) {
assert.sameValue(Number.prototype.toPrecision.call(val, prec), expected); assert.sameValue(Number.prototype.toPrecision.call(val, prec), expected);
} }
if (typeof assert.sameValue === "function") {
}

View File

@ -12,7 +12,6 @@ esid: pending
if (typeof disassemble === "function") { if (typeof disassemble === "function") {
var code = disassemble(() => { x: 2+2; }); var code = disassemble(() => { x: 2+2; });
if (typeof assert.sameValue === "function")
assert.sameValue(true, /Int8 4/.test(code)); assert.sameValue(true, /Int8 4/.test(code));
} }

View File

@ -8,7 +8,5 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
assert.sameValue(Object.getOwnPropertyNames(this).includes('globalThis'), true);
if (typeof assert.sameValue === "function") { assert.sameValue(Object.getOwnPropertyNames(this).includes('globalThis'), true);
}