Skip to content

Commit

Permalink
Fix Ember global deprecation
Browse files Browse the repository at this point in the history
A minimal fix for #600. We should probably follow through with the
refactor suggested by @rwjblue in #600 but that can be done later.
  • Loading branch information
chancancode committed Jun 2, 2021
1 parent 3e02036 commit 7c6d5b6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions assets/browser-fetch.js.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
(function (originalGlobal) {
define('fetch', ['exports'], function(exports) {
if (!require.has('ember')) {
define('ember', ['exports'], function(exports) {
exports['default'] = originalGlobal.Ember;
});
}

define('fetch', ['exports', 'ember'], function(exports, Ember) {
'use strict';
var Promise = originalGlobal.Ember.RSVP.Promise;
var Ember__default = 'default' in Ember ? Ember['default'] : Ember;
var Promise = Ember__default.RSVP.Promise;
var supportProps = [
'FormData',
'FileReader',
Expand Down Expand Up @@ -49,8 +56,8 @@
return result;
}

if (originalGlobal.Ember.Test) {
originalGlobal.Ember.Test.registerWaiter(function() {
if (Ember__default.Test) {
Ember__default.Test.registerWaiter(function() {
return pending === 0;
});

Expand Down

0 comments on commit 7c6d5b6

Please sign in to comment.