From 1efd9f783ea483bd51aab56e96237f59083624d0 Mon Sep 17 00:00:00 2001 From: Edoardo Cavazza Date: Mon, 6 Nov 2023 11:35:59 +0100 Subject: [PATCH] Use object utilities --- src/Element.js | 4 ++-- src/Node.js | 4 ++-- src/utils.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Element.js b/src/Element.js index ad13c23..49dfb8f 100644 --- a/src/Element.js +++ b/src/Element.js @@ -1,5 +1,5 @@ import { getRealm, getParentRealm } from './Realm.js'; -import { defineProperty } from './utils.js'; +import { defineProperty, getOwnPropertyDescriptors } from './utils.js'; /** * Extends the Element prototype with realm aware methods. @@ -21,7 +21,7 @@ export function extendElement(Element) { before, replaceWith, insertAdjacentElement, - } = Object.getOwnPropertyDescriptors(ElementPrototype); + } = getOwnPropertyDescriptors(ElementPrototype); defineProperty(ElementPrototype, 'append', { /** diff --git a/src/Node.js b/src/Node.js index ae01815..e1b2c2b 100644 --- a/src/Node.js +++ b/src/Node.js @@ -1,6 +1,6 @@ import { createNodeList } from './NodeList.js'; import { getRealm, getParentRealm } from './Realm.js'; -import { defineProperty } from './utils.js'; +import { defineProperty, getOwnPropertyDescriptors } from './utils.js'; /** * Extends the Node prototype with realm aware methods. @@ -21,7 +21,7 @@ export function extendNode(Node) { parentElement, previousSibling, nextSibling, - } = Object.getOwnPropertyDescriptors(NodePrototype); + } = getOwnPropertyDescriptors(NodePrototype); defineProperty(NodePrototype, 'appendChild', { /** diff --git a/src/utils.js b/src/utils.js index 9015ee0..1d65883 100644 --- a/src/utils.js +++ b/src/utils.js @@ -6,4 +6,4 @@ * @typedef {Omit & Required>} ValueDescriptor */ -export const { defineProperty } = Object; +export const { defineProperty, getOwnPropertyDescriptors } = Object;