-
Notifications
You must be signed in to change notification settings - Fork 80
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
new Object().constructor === Object
returns false
#899
Comments
Just ran into this too. Easier reproduction:
|
I think this is the root cause of this issue flightcontrolhq/superjson#302, would appreciate an answer from the maintainers :) |
+1 |
Schniz
added a commit
that referenced
this issue
Nov 28, 2024
this resolves #899 with a caveat that an object that was created outside of the VM will obviously won't satisfy this requirement. However, it will still be `instaceof Object` which is interesting. I am not sure it'll be easy to solve.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
new Object().constructor === Object
returnsfalse
in Next.js with edge runtime enabled.A clear and concise description of the behavior.
new Object().constructor === Object
should returntrue
.A clear and concise description of what you expected to happen (or code).
new Object().constructor === Object
should returntrue
Workaround:
new Object().constructor === Object.prototype.constructor
With other objects like
Date
it works:new Date().constructor === Date
returnstrue
Steps to reproduce:
export const runtime='edge'
topage.tsx
console.log(new Object().constructor === Object)
topage.tsx
next dev
The text was updated successfully, but these errors were encountered: