Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use prop destructor for Ember dependencies #5039

Merged
merged 1 commit into from
Jun 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions addon/-private/system/model/errors.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/system/record-array-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
14 changes: 7 additions & 7 deletions addon/adapters/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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() {
Expand Down
5 changes: 2 additions & 3 deletions addon/serializers/embedded-records-mixin.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion addon/serializers/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down