mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[stringify/url] prevent an infinite loop of infinity looping
This commit is contained in:
parent
8dbd8f903c
commit
e05c7bdd45
1 changed files with 17 additions and 9 deletions
|
@ -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;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue