Closed johnhenry closed 2 years ago
Hey! 👋 This is an issue with how Miniflare (the local Workers simulator that powers wrangler pages dev
) works that we probably can't fix without breaking other things. See https://github.com/cloudflare/miniflare/issues/109#issuecomment-986089909 for an explanation of the problem.
As mentioned there, we could add an option that lets you choose which behaviour you want:
proxy
: Miniflare's current behaviour, instanceof
always succeeds, but prototype checks don'tinside
: we do nothing, objects created inside the workers context pass instanceof
and prototype checksoutside
: we pass Object
in from the parent context, objects created in the workers context fail instanceof
and prototype checks, but things created outside pass
I'm running into an issue where I believe default prototype for objects is incorrect. That is,
Object.getPrototypeOf({})
is notObject.prototype
.Based on the spec, I'm not entirely sure that this should be the case; but running this code:
returns:
true
in the browser and on cloudflareworkers.comfalse
when runningwrangler pages dev