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

fix: Do not inherit app object from Object prototype #1153

Merged
merged 2 commits into from
Jan 2, 2019
Merged

Conversation

daffl
Copy link
Member

@daffl daffl commented Jan 2, 2019

It appears that some browsers (or plugins or something) override the Object prototype, specifically the init property, which we use to call to initialize the application (causing .init is not a function errors). The best way to avoid this is to inherit from null instead of the Object prototype.

@daffl daffl merged commit ed8c2e4 into master Jan 2, 2019
@daffl daffl deleted the null-object-app branch January 2, 2019 22:26

function createApplication () {
const app = {};
const app = Object.create(baseObject);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would not be enough to do that?

const app = Object.create(null);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so, too but Uberproto tries to get the Prototype when mixing into the app object, gets null and blows up so I needed to add another one to the chain.

@daffl daffl mentioned this pull request Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants