Skip to content

Commit

Permalink
Use object utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Nov 6, 2023
1 parent ee9a517 commit 1efd9f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Element.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -21,7 +21,7 @@ export function extendElement(Element) {
before,
replaceWith,
insertAdjacentElement,
} = Object.getOwnPropertyDescriptors(ElementPrototype);
} = getOwnPropertyDescriptors(ElementPrototype);

defineProperty(ElementPrototype, 'append', {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/Node.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -21,7 +21,7 @@ export function extendNode(Node) {
parentElement,
previousSibling,
nextSibling,
} = Object.getOwnPropertyDescriptors(NodePrototype);
} = getOwnPropertyDescriptors(NodePrototype);

defineProperty(NodePrototype, 'appendChild', {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* @typedef {Omit<PropertyDescriptor, 'value'> & Required<Pick<PropertyDescriptor, 'value'>>} ValueDescriptor
*/

export const { defineProperty } = Object;
export const { defineProperty, getOwnPropertyDescriptors } = Object;

0 comments on commit 1efd9f7

Please sign in to comment.