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

[BUGFIX release] Fix Ember.Object.extend for old IE #3508

Merged
merged 2 commits into from Oct 2, 2013

Conversation

tricknotes
Copy link
Member

In old IE, Ember.Object.extend couldn't extend property that is named the same as a property of Object.prototype.

MyClass = Ember.Object.extend({
  toString: function() {
    return 'MyClass'
  }
});

var object = MyClass.create();

// The following should return `'MyClass'`.
object.toString(); //=> '<(unknown mixin):ember123>'

The cause is that for ~ in loop doesn't enumerate a property of Object.prototype in old IE.
To fix this issue, I fixed Ember.keys to return its own properties and I used it for Ember.Object.extend.

In IE8, `Ember.keys` couldn't return property that named the same as
own prototype property.
@stefanpenner
Copy link
Member

related: this tries to (potentially once did?) fix part of something similar https://github.com/emberjs/ember.js/blob/master/packages/ember-metal/lib/mixin.js#L325-L326

@tricknotes
Copy link
Member Author

You are right! (but I have not do it yet.)

Should I try to apply this fix to similar points on this PR?

wycats added a commit that referenced this pull request Oct 2, 2013
[BUGFIX release] Fix Ember.Object.extend for old IE
@wycats wycats merged commit 4f2a72d into emberjs:master Oct 2, 2013
@tricknotes tricknotes deleted the fix-object-extend-for-old-ie branch October 2, 2013 03:43
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.

None yet

3 participants