Skip to content

Commit

Permalink
Merge pull request #5501 from twokul/super-fix
Browse files Browse the repository at this point in the history
[BUGFIX release] Makes sure that internal properties do not leak onto created objects.
  • Loading branch information
rwjblue committed Aug 27, 2014
2 parents 99af3c0 + ed0f4ee commit 72099aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/ember-runtime/lib/system/core_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,7 @@ CoreObject.reopen({
cache._computedProperties = undefined;
}
}

this._super();
}
});


export default CoreObject;
18 changes: 18 additions & 0 deletions packages/ember-runtime/tests/system/object/create_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,21 @@ test("created objects should not share a guid with their superclass", function()

ok(guidFor(objA) !== guidFor(objB), "two instances do not share a guid");
});

test("ensure internal properties do not leak", function(){
var obj = EmberObject.create({
firstName: 'Joe',
lastName: 'Black'
});

var expectedProperties = ['firstName', 'lastName'];
var actualProperties = [];

for (var name in obj) {
if (obj.hasOwnProperty(name)) {
actualProperties.push(name);
}
}

deepEqual(actualProperties, expectedProperties, 'internal properties do not leak');
});

0 comments on commit 72099aa

Please sign in to comment.