Skip to content

Commit

Permalink
[stringify/url] prevent an infinite loop of infinity looping
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Alger committed May 4, 2015
1 parent 8dbd8f9 commit e05c7bd
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions test/unit/specs/components/stringify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,25 @@ define(function (require) {
expect(url.convert('url', 'text')).to.be('');
});

it('does not get values from the prototype chain', function () {
Object.prototype.cantStopMeNow = {
toString: function () {
return 'fail';
}
};

var url = new Url({ template: '{{ cantStopMeNow }}' });
expect(url.convert('url', 'text')).to.be('');
});
describe('', function () {
before(function () {
Object.prototype.cantStopMeNow = {
toString: function () {
return 'fail';
},
cantStopMeNow: null
};
});

it('does not get values from the prototype chain', function () {
var url = new Url({ template: '{{ cantStopMeNow }}' });
expect(url.convert('url', 'text')).to.be('');
});

after(function () {
delete Object.prototype.cantStopMeNow;
});
});
});
});

Expand Down

0 comments on commit e05c7bd

Please sign in to comment.