diff --git a/addon/-private/system/model/errors.js b/addon/-private/system/model/errors.js index 9642e8eee16..42dd3d1c9a3 100644 --- a/addon/-private/system/model/errors.js +++ b/addon/-private/system/model/errors.js @@ -1,12 +1,7 @@ import Ember from 'ember'; import { deprecate, warn } from '@ember/debug'; -const get = Ember.get; -const set = Ember.set; -const isEmpty = Ember.isEmpty; -const makeArray = Ember.makeArray; - -const MapWithDefault = Ember.MapWithDefault; +const { get, set, isEmpty, makeArray, MapWithDefault } = Ember; /** @module ember-data diff --git a/addon/-private/system/record-array-manager.js b/addon/-private/system/record-array-manager.js index d0bd9783287..bf8e4fbd3d4 100644 --- a/addon/-private/system/record-array-manager.js +++ b/addon/-private/system/record-array-manager.js @@ -449,7 +449,7 @@ export default class RecordArrayManager { destroy() { this.isDestroying = true; - Ember.run.schedule('actions', this, this.willDestroy); + emberRun.schedule('actions', this, this.willDestroy); } } diff --git a/addon/adapters/rest.js b/addon/adapters/rest.js index 534e948cdeb..6ab765533ea 100644 --- a/addon/adapters/rest.js +++ b/addon/adapters/rest.js @@ -23,10 +23,10 @@ import { instrument } from 'ember-data/-debug'; import { warn, deprecate } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; - const { MapWithDefault, - get + get, + run } = Ember; const Promise = Ember.RSVP.Promise; @@ -1061,7 +1061,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, { hash.success = function(payload, textStatus, jqXHR) { heimdall.stop(token); let response = ajaxSuccess(adapter, jqXHR, payload, requestData); - Ember.run.join(null, resolve, response); + run.join(null, resolve, response); }; hash.error = function(jqXHR, textStatus, errorThrown) { @@ -1071,7 +1071,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, { errorThrown }; let error = ajaxError(adapter, jqXHR, requestData, responseData); - Ember.run.join(null, reject, error); + run.join(null, reject, error); }; adapter._ajaxRequest(hash); @@ -1442,12 +1442,12 @@ if (isEnabled('ds-improved-ajax')) { let { method, url } = request; let requestData = { method, url }; - return new Ember.RSVP.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { hash.success = function(payload, textStatus, jqXHR) { heimdall.stop(token); let response = ajaxSuccess(adapter, jqXHR, payload, requestData); - Ember.run.join(null, resolve, response); + run.join(null, resolve, response); }; hash.error = function(jqXHR, textStatus, errorThrown) { @@ -1457,7 +1457,7 @@ if (isEnabled('ds-improved-ajax')) { errorThrown }; let error = ajaxError(adapter, jqXHR, requestData, responseData); - Ember.run.join(null, reject, error); + run.join(null, reject, error); }; instrument(function() { diff --git a/addon/serializers/embedded-records-mixin.js b/addon/serializers/embedded-records-mixin.js index b082dec85eb..e640b4d5b7e 100644 --- a/addon/serializers/embedded-records-mixin.js +++ b/addon/serializers/embedded-records-mixin.js @@ -1,9 +1,8 @@ import Ember from 'ember'; import { warn } from '@ember/debug'; -const get = Ember.get; -const set = Ember.set; -const camelize = Ember.String.camelize; +const { get, set } = Ember; +const { camelize } = Ember.String; /** ## Using Embedded Records diff --git a/addon/serializers/rest.js b/addon/serializers/rest.js index 57c9b7e2824..c85e07c8e16 100644 --- a/addon/serializers/rest.js +++ b/addon/serializers/rest.js @@ -10,7 +10,7 @@ import { DEBUG } from '@glimmer/env'; import JSONSerializer from "../serializers/json"; import { coerceId, modelHasAttributeOrRelationshipNamedType, normalizeModelName, isEnabled } from '../-private'; -let camelize = Ember.String.camelize; +const { camelize } = Ember.String; /** Normally, applications will use the `RESTSerializer` by implementing