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

Replace __proto__ with modern ways #2

Open
mooz opened this issue Apr 3, 2012 · 1 comment
Open

Replace __proto__ with modern ways #2

mooz opened this issue Apr 3, 2012 · 1 comment

Comments

@mooz
Copy link
Member

mooz commented Apr 3, 2012

For now, UxU uses __proto__ pseudo property to achieve inheritance, which is not standardized in current ECMAScript specification (Both 3 and 5).

In draft version of ECMAScript6 specification, __proto__ pseudo property is specified in Annex B. That is, __proto__ implementation is required in web browsers but not required in ECMAScript engine itself.

UxU targets not only web browsers, but also ECMAScript engine itself. To this end, we should replace __proto__ pseudo property with modern ways with Object.create().

@dotnetwise
Copy link

I don't recommend that at all.
__proto__ is way faster and it will be standardized in ECMAScript6 anyways.
Beside Object.create is way slower!

This is used on .inheritWith flavor of this library and that is what makes it even faster!

However, make sure you have a fallback to browsers non supporting __proto__ such as IE<=10

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

No branches or pull requests

2 participants