Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: capricorn86/happy-dom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v13.7.2
Choose a base ref
...
head repository: capricorn86/happy-dom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1bd90205d67aa78de52ea5d1ebb3c8f8db2364af
Choose a head ref
  • 5 commits
  • 3 files changed
  • 2 contributors

Commits on Mar 1, 2024

  1. fix: [#1285] Prevent contains from accessing properties of undefined …

    …arguments
    rofly committed Mar 1, 2024
    Copy the full SHA
    36ce7ed View commit details

Commits on Mar 10, 2024

  1. Merge branch 'master' into master

    capricorn86 authored Mar 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    97833b3 View commit details
  2. Merge pull request #1286 from rofly/master

    fix: [#1285] Prevent contains from accessing properties of undefined args
    capricorn86 authored Mar 10, 2024
    Copy the full SHA
    39d8c45 View commit details
  3. chore: [#1272] Fixes problem with the release

    capricorn86 committed Mar 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e0eddad View commit details
  4. Merge pull request #1292 from capricorn86/fix-release-2

    chore: [#1272] Fixes problem with the release
    capricorn86 authored Mar 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1bd9020 View commit details
Showing with 9 additions and 6 deletions.
  1. +0 −5 .github/workflows/release.yml
  2. +4 −1 packages/happy-dom/src/nodes/node/Node.ts
  3. +5 −0 packages/happy-dom/test/nodes/node/Node.test.ts
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -4,11 +4,6 @@ on:
pull_request:
types: [closed]

permissions:
contents: write
actions: read
pull-requests: write

jobs:
check-next-version:
runs-on: ubuntu-latest
5 changes: 4 additions & 1 deletion packages/happy-dom/src/nodes/node/Node.ts
Original file line number Diff line number Diff line change
@@ -297,7 +297,10 @@ export default class Node extends EventTarget implements INode {
* @param otherNode Node to test with.
* @returns "true" if this node contains the other node.
*/
public contains(otherNode: INode): boolean {
public contains(otherNode: INode | undefined): boolean {
if (otherNode === undefined) {
return false;
}
return NodeUtility.isInclusiveAncestor(this, otherNode);
}

5 changes: 5 additions & 0 deletions packages/happy-dom/test/nodes/node/Node.test.ts
Original file line number Diff line number Diff line change
@@ -330,6 +330,11 @@ describe('Node', () => {

expect(div.contains(null)).toBe(false);
});
it('Returns "false" if match node is undefined.', () => {
const div = document.createElement('div');

expect(div.contains(undefined)).toBe(false);
});
});

describe('getRootNode()', () => {