GlobalVariableTemplate1.ts 356 B

12345678910111213141516
  1. /**
  2. * @returns {string}
  3. */
  4. export function GlobalVariableTemplate1 (): string {
  5. return `
  6. let that;
  7. try {
  8. const getGlobal = Function('return (function() ' + '{}.constructor("return this")( )' + ');');
  9. that = getGlobal();
  10. } catch (e) {
  11. that = window;
  12. }
  13. `;
  14. }