-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,37 +141,6 @@ function loadEmberDebug() { | |
let minimumVersion = config.emberVersionsSupported[0].replace(/\./g, '-'); | ||
let xhr; | ||
|
||
/* istanbul ignore next */ | ||
function loadEmberDebugInWebpage() { | ||
const waitForEmberLoad = new Promise((resolve) => { | ||
if (window.requireModule) { | ||
const has = | ||
window.requireModule.has || | ||
function has(id) { | ||
return !!( | ||
window.requireModule.entries[id] || | ||
window.requireModule.entries[id + '/index'] | ||
); | ||
}; | ||
if (has('ember')) { | ||
return resolve(); | ||
} | ||
} | ||
|
||
/** | ||
* NOTE: if the above (for some reason) fails and the consuming app has | ||
* deprecation-workflow's throwOnUnhandled: true | ||
* or set `ember-global`'s handler to 'throw' | ||
* and is using at least `[email protected]` | ||
* | ||
* this will throw an exception in the consuming project | ||
*/ | ||
if (window.Ember) return resolve(); | ||
|
||
window.addEventListener('Ember', resolve, { once: true }); | ||
}); | ||
waitForEmberLoad.then(() => 'replace-with-ember-debug'); | ||
} | ||
return new Promise((resolve) => { | ||
if (!emberDebug) { | ||
xhr = new XMLHttpRequest(); | ||
|
@@ -183,16 +152,6 @@ function loadEmberDebug() { | |
if (xhr.readyState === 4) { | ||
if (xhr.status === 200) { | ||
emberDebug = xhr.responseText; | ||
// prepare for usage in replace, dollar signs are part of special replacement patterns... | ||
// wrap in curly braces to be usable in arrow function | ||
emberDebug = '{' + emberDebug.replace(/\$/g, '$$$$') + '}'; | ||
emberDebug = | ||
'(' + | ||
loadEmberDebugInWebpage | ||
.toString() | ||
// Use regex to support different cases in dev and prod builds | ||
.replace(/['"]replace-with-ember-debug['"];*/, emberDebug) + | ||
')()'; | ||
resolve(emberDebug); | ||
} | ||
} | ||
|