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

[CLEANUP] Remove shim for Backburner.join #4171

Merged
merged 1 commit into from
Feb 19, 2016
Merged
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
43 changes: 1 addition & 42 deletions addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,51 +57,10 @@ import isEnabled from 'ember-data/-private/features';

export let badIdFormatAssertion = '`id` has to be non-empty string or number';

var Backburner = Ember._Backburner || Ember.Backburner || Ember.__loader.require('backburner')['default'] || Ember.__loader.require('backburner')['Backburner'];
const Backburner = Ember._Backburner;
var Map = Ember.Map;
var isArray = Array.isArray || Ember.isArray;

//Shim Backburner.join
if (!Backburner.prototype.join) {
var isString = function(suspect) {
return typeof suspect === 'string';
};

Backburner.prototype.join = function(/*target, method, args */) {
var method, target;

if (this.currentInstance) {
var length = arguments.length;
if (length === 1) {
method = arguments[0];
target = null;
} else {
target = arguments[0];
method = arguments[1];
}

if (isString(method)) {
method = target[method];
}

if (length === 1) {
return method();
} else if (length === 2) {
return method.call(target);
} else {
var args = new Array(length - 2);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i + 2];
}
return method.apply(target, args);
}
} else {
return this.run.apply(this, arguments);
}
};
}


//Get the materialized model from the internalModel/promise that returns
//an internal model and return it in a promiseObject. Useful for returning
//from find methods
Expand Down