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

There's no Object.prototype.__proto__ #26664

Closed
AFatNiBBa opened this issue Oct 31, 2024 · 2 comments
Closed

There's no Object.prototype.__proto__ #26664

AFatNiBBa opened this issue Oct 31, 2024 · 2 comments
Labels
question a question about the use of Deno

Comments

@AFatNiBBa
Copy link

Version: Deno 2.0.4

I'm working with legacy packages that make use of Object.prototype.__proto__, which is not defined in deno.
This polyfill is needed

Object.defineProperty(Object.prototype, "__proto__", {
    enumerable: false,
    configurable: true,
    get() { return Object.getPrototypeOf(this); },
    set(v) { Object.setPrototypeOf(this, v); }
});
@bartlomieju
Copy link
Member

It's disabled by default in Deno due to security reasons. You can enable it with --unstable-unsafe-proto flag.

@bartlomieju bartlomieju added the question a question about the use of Deno label Oct 31, 2024
@dsherret
Copy link
Member

You can also specify:

{
  "unstable": ["unsafe-proto"]
}

in a deno.json file.

Read more:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question a question about the use of Deno
Projects
None yet
Development

No branches or pull requests

3 participants