[stringify/url] prevent an infinite loop of infinity looping

This commit is contained in:
Spencer Alger 2015-05-04 13:53:14 -07:00
parent 8dbd8f903c
commit e05c7bdd45

View file

@ -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';
}
};
describe('', function () {
before(function () {
Object.prototype.cantStopMeNow = {
toString: function () {
return 'fail';
},
cantStopMeNow: null
};
});
var url = new Url({ template: '{{ cantStopMeNow }}' });
expect(url.convert('url', 'text')).to.be('');
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;
});
});
});
});