Skip to content

Avoid using Object.create for sham-less IE8 compatibility#139

Closed
sophiebits wants to merge 1 commit intofacebook:masterfrom
sophiebits:ie8-fixes
Closed

Avoid using Object.create for sham-less IE8 compatibility#139
sophiebits wants to merge 1 commit intofacebook:masterfrom
sophiebits:ie8-fixes

Conversation

@sophiebits
Copy link
Collaborator

Instead of using Object.create, just shuffle the prototypes around so that we don't need to include es5-sham.

@zpao
Copy link
Member

zpao commented Jul 1, 2013

Personally, I would prefer to try to write forward thinking JS and backwards support with shims/shams, rather than inlining those workarounds.

The SyntheticMouseEvents change we should definitely take though since that's just pure correctness and not an IE8 issue. Can you pull that out to a separate PR so it can be merged independently?

@sophiebits
Copy link
Collaborator Author

I guess so. :) Figured putting them together would improve the former's chances of getting accepted. ;)

@sophiebits
Copy link
Collaborator Author

Done. I'm personally in favor of not using Object.create because

  1. the description of es5-sham on https://github.com/kriskowal/es5-shim doesn't instill confidence in its correctness
  2. the alternative code is super simple and is pretty standard for doing inheritance in JS, and
  3. (I don't want to include es5-sham if I don't have to)

Instead of using Object.create, just shuffle the prototypes around so that we don't need to include es5-sham.
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