Skip to content

instanceof Object fails? #1769

@jods4

Description

@jods4

Running a webapp inside JSDOM, I observe the following test failing:

let input: HTMLInputElement = ...; // got this from the DOM
let ok = input instanceof Object; // true in a browser, false in JSDOM

Does it make any sense?

I observe that the prototype chain of the "fake" HTMLInputElement goes to a fake Object and not the real Node one, but shouldn't the Object in the code above also point to the same fake object?

To be clear: this code is running inside the webapp+JSDOM, not in the main Node code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions