ace: Use `globalThis` instead of non-strict default context

This is necessary before `'use strict';` can be added to the top of
the file.
list-test-fix
Richard Hansen 2021-01-28 20:53:15 -05:00 committed by John McLear
parent 3c2e0f0e16
commit 8668017c62
1 changed files with 4 additions and 4 deletions

View File

@ -255,13 +255,13 @@ plugins.ensure(function () {\n\
iframeHTML.push('</head><body id="innerdocbody" class="innerdocbody" role="application" class="syntax" spellcheck="false">&nbsp;</body></html>');
// Expose myself to global for my child frame.
const thisFunctionsName = 'ChildAccessibleAce2Editor';
(function () { return this; }())[thisFunctionsName] = Ace2Editor;
// eslint-disable-next-line node/no-unsupported-features/es-builtins
const gt = typeof globalThis === 'object' ? globalThis : window;
gt.ChildAccessibleAce2Editor = Ace2Editor;
const outerScript = `\
editorId = ${JSON.stringify(info.id)};\n\
editorInfo = parent[${JSON.stringify(thisFunctionsName)}].registry[editorId];\n\
editorInfo = parent.ChildAccessibleAce2Editor.registry[editorId];\n\
window.onload = function () {\n\
window.onload = null;\n\
setTimeout(function () {\n\