Skip to content

Commit

Permalink
Shim backburner join until we are sure Ember has it
Browse files Browse the repository at this point in the history
  • Loading branch information
igorT committed Dec 18, 2014
1 parent 2511ac8 commit 7538aea
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,31 @@ import { Model } from "ember-data/system/model";
//Stanley told me to do this
var Backburner = Ember.__loader.require('backburner')['default'] || Ember.__loader.require('backburner')['Backburner'];

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

Backburner.prototype.join = function(target, method /*, args */) {
if (this.currentInstance) {
if (!method) {
method = target;
target = null;
}

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

return method.apply(target, slice.call(arguments, 2));
} else {
return this.run.apply(this, arguments);
}
};
}


var get = Ember.get;
var set = Ember.set;
Expand Down

0 comments on commit 7538aea

Please sign in to comment.