From eae3f3a386dbdce87e7ff172405d986f25f8de2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:15:54 +0200 Subject: [PATCH] Replace createIsHTMLDDA with $262.IsHTMLDDA --- .../sm/Iterator/prototype/every/coerce-result-to-boolean.js | 2 +- .../sm/Iterator/prototype/filter/coerce-result-to-boolean.js | 2 +- .../sm/Iterator/prototype/find/coerce-result-to-boolean.js | 2 +- .../sm/Iterator/prototype/some/coerce-result-to-boolean.js | 2 +- test/staging/sm/Reflect/defineProperty.js | 4 +--- test/staging/sm/expressions/nullish-coalescing.js | 2 +- test/staging/sm/generators/yield-star-throw-htmldda.js | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/test/staging/sm/Iterator/prototype/every/coerce-result-to-boolean.js b/test/staging/sm/Iterator/prototype/every/coerce-result-to-boolean.js index 1363de3338..0e5954dced 100644 --- a/test/staging/sm/Iterator/prototype/every/coerce-result-to-boolean.js +++ b/test/staging/sm/Iterator/prototype/every/coerce-result-to-boolean.js @@ -31,6 +31,6 @@ assert.sameValue([NaN].values().every(fn), false); assert.sameValue([-0].values().every(fn), false); assert.sameValue([0n].values().every(fn), false); -const htmlDDA = createIsHTMLDDA(); +const htmlDDA = $262.IsHTMLDDA; assert.sameValue([htmlDDA].values().every(fn), false); diff --git a/test/staging/sm/Iterator/prototype/filter/coerce-result-to-boolean.js b/test/staging/sm/Iterator/prototype/filter/coerce-result-to-boolean.js index dd257a4e13..1c21e5296c 100644 --- a/test/staging/sm/Iterator/prototype/filter/coerce-result-to-boolean.js +++ b/test/staging/sm/Iterator/prototype/filter/coerce-result-to-boolean.js @@ -22,7 +22,7 @@ for (const value of [...truthyValues].values().filter(x => x)) { } // All falsy values are filtered out. -const falsyValues = [false, 0, '', null, undefined, NaN, -0, 0n, createIsHTMLDDA()]; +const falsyValues = [false, 0, '', null, undefined, NaN, -0, 0n, $262.IsHTMLDDA]; const result = falsyValues.values().filter(x => x).next(); assert.sameValue(result.done, true); assert.sameValue(result.value, undefined); diff --git a/test/staging/sm/Iterator/prototype/find/coerce-result-to-boolean.js b/test/staging/sm/Iterator/prototype/find/coerce-result-to-boolean.js index 9da0314ead..64f59989bb 100644 --- a/test/staging/sm/Iterator/prototype/find/coerce-result-to-boolean.js +++ b/test/staging/sm/Iterator/prototype/find/coerce-result-to-boolean.js @@ -35,6 +35,6 @@ assert.sameValue([array].values().find(fn), array); let object = {}; assert.sameValue([object].values().find(fn), object); -const htmlDDA = createIsHTMLDDA(); +const htmlDDA = $262.IsHTMLDDA; assert.sameValue([htmlDDA].values().find(fn), undefined); diff --git a/test/staging/sm/Iterator/prototype/some/coerce-result-to-boolean.js b/test/staging/sm/Iterator/prototype/some/coerce-result-to-boolean.js index 3978d36a3d..cb0778895e 100644 --- a/test/staging/sm/Iterator/prototype/some/coerce-result-to-boolean.js +++ b/test/staging/sm/Iterator/prototype/some/coerce-result-to-boolean.js @@ -31,6 +31,6 @@ assert.sameValue([NaN].values().some(fn), false); assert.sameValue([-0].values().some(fn), false); assert.sameValue([0n].values().some(fn), false); -const htmlDDA = createIsHTMLDDA(); +const htmlDDA = $262.IsHTMLDDA; assert.sameValue([htmlDDA].values().some(fn), false); diff --git a/test/staging/sm/Reflect/defineProperty.js b/test/staging/sm/Reflect/defineProperty.js index 0f459f3461..2af09288bc 100644 --- a/test/staging/sm/Reflect/defineProperty.js +++ b/test/staging/sm/Reflect/defineProperty.js @@ -132,9 +132,7 @@ assert.sameValue(Reflect.defineProperty(obj, "prop", {set: g}), false); assert.sameValue(Reflect.defineProperty(obj, "prop", {set: s}), true); // no-op // Proxy defineProperty handler method that returns false -var falseValues = [false, 0, -0, "", NaN, null, undefined]; -if (typeof createIsHTMLDDA === "function") - falseValues.push(createIsHTMLDDA()); +var falseValues = [false, 0, -0, "", NaN, null, undefined, $262.IsHTMLDDA]; var value; proxy = new Proxy({}, { defineProperty(t, id, desc) { diff --git a/test/staging/sm/expressions/nullish-coalescing.js b/test/staging/sm/expressions/nullish-coalescing.js index a068ac1bfb..668f7a9271 100644 --- a/test/staging/sm/expressions/nullish-coalescing.js +++ b/test/staging/sm/expressions/nullish-coalescing.js @@ -54,7 +54,7 @@ function testBasicCases() { shouldBe(([] ?? 3) instanceof Array, true); shouldBe((['hi'] ?? 3)[0], 'hi'); // test document.all, which has odd behavior - shouldBe(typeof(createIsHTMLDDA() ?? 3), "undefined"); + shouldBe(typeof($262.IsHTMLDDA ?? 3), "undefined"); } for (let i = 0; i < 1e5; i++) diff --git a/test/staging/sm/generators/yield-star-throw-htmldda.js b/test/staging/sm/generators/yield-star-throw-htmldda.js index a669de7994..d48d81d261 100644 --- a/test/staging/sm/generators/yield-star-throw-htmldda.js +++ b/test/staging/sm/generators/yield-star-throw-htmldda.js @@ -24,7 +24,7 @@ var it = g({ next() { return {done: false}; }, - throw: createIsHTMLDDA(), + throw: $262.IsHTMLDDA, return() { calledReturn = true; return {done: false};