SelfDefendingTemplate.ts 649 B

12345678910111213141516171819202122
  1. /**
  2. * SelfDefendingTemplate. Enters code in infinity loop.
  3. *
  4. * @returns {string}
  5. */
  6. export function SelfDefendingTemplate (): string {
  7. return `
  8. const {selfDefendingFunctionName} = {callControllerFunctionName}(this, function () {
  9. const test = function () {
  10. const regExp = test
  11. .constructor('return /" + this + "/')()
  12. .constructor('^([^ ]+( +[^ ]+)+)+[^ ]}');
  13. return !regExp.test({selfDefendingFunctionName});
  14. };
  15. return test();
  16. });
  17. {selfDefendingFunctionName}();
  18. `;
  19. }