From 37ebe00a151c28761f98350e0963878205382067 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 14 May 2025 12:34:01 -0700 Subject: [PATCH] Remove usage of Object.hasOwn in helper files Instead use the easily available old-fashioned way, calling the method on Object.prototype. --- harness/asyncHelpers.js | 2 +- harness/temporalHelpers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/harness/asyncHelpers.js b/harness/asyncHelpers.js index 4763838afc..163d2b47bb 100644 --- a/harness/asyncHelpers.js +++ b/harness/asyncHelpers.js @@ -15,7 +15,7 @@ defines: [asyncTest, assert.throwsAsync] * @returns {void} */ function asyncTest(testFunc) { - if (!Object.hasOwn(globalThis, "$DONE")) { + if (!Object.prototype.hasOwnProperty.call(globalThis, "$DONE")) { throw new Test262Error("asyncTest called without async flag"); } if (typeof testFunc !== "function") { diff --git a/harness/temporalHelpers.js b/harness/temporalHelpers.js index be21846e74..657a580f37 100644 --- a/harness/temporalHelpers.js +++ b/harness/temporalHelpers.js @@ -133,7 +133,7 @@ var TemporalHelpers = { assert.sameValue(eraName, undefined); return undefined; } - assert(Object.hasOwn(TemporalHelpers.CalendarEras, calendarId)); + assert(Object.prototype.hasOwnProperty.call(TemporalHelpers.CalendarEras, calendarId)); if (eraName === undefined) { return undefined;