Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError on instanceof Proxy #43565

Closed
npenin opened this issue Jun 25, 2022 · 1 comment
Closed

TypeError on instanceof Proxy #43565

npenin opened this issue Jun 25, 2022 · 1 comment
Labels
question Issues that look for answers.

Comments

@npenin
Copy link

npenin commented Jun 25, 2022

Version

v16.15.1

Platform

Linux dev 5.18.6-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 22 13:46:18 UTC 2022 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

var x={}
console.log(x instanceof Proxy)

How often does it reproduce? Is there a required condition?

always

What is the expected behavior?

no failure

What do you see instead?

TypeError: Function has non-object prototype 'undefined' in instanceof check
at Function.[Symbol.hasInstance] ()

Additional information

similar issue #35730

@F3n67u F3n67u added the util Issues and PRs related to the built-in util module. label Jun 25, 2022
@BridgeAR
Copy link
Member

This is defined by the spec and not an issue with Node.js. The instanceof check can throw in case the right side has no proper prototype. This is the case for Proxy.

https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-instanceofoperator

@BridgeAR BridgeAR added question Issues that look for answers. and removed util Issues and PRs related to the built-in util module. labels Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants