I was checking ejs layout code of sails.js and saw the line that says delete window.self
<% /* Delete the global `self` to help avoid client-side bugs.
(see https://developer.mozilla.org/en-US/docs/Web/API/Window/self) */ %>
<script>delete window.self;</script>
I tried searching for to find an answer of why would we delete the window.self but could not find an answer. What is the rationale behind adding this line?
Edit: The code exist at line no. 137 here: https://github.com/mikermcneil/ration/blob/master/views/layouts/layout.ejs