From 807a5176540a4ac97a432e27fee65b451bf9b50c Mon Sep 17 00:00:00 2001 From: Sylvain MINA Date: Fri, 5 Jun 2015 15:45:57 +0200 Subject: [PATCH] remove Map/MapWithDefault polyfill, use Ember's ones --- packages/ember-data/lib/adapters/rest-adapter.js | 4 +--- packages/ember-data/lib/system/map.js | 13 ------------- packages/ember-data/lib/system/model/attributes.js | 4 +--- packages/ember-data/lib/system/model/errors.js | 4 +--- .../ember-data/lib/system/record-array-manager.js | 4 +--- packages/ember-data/lib/system/relationships/ext.js | 6 ++---- packages/ember-data/lib/system/store.js | 4 +--- 7 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 packages/ember-data/lib/system/map.js diff --git a/packages/ember-data/lib/adapters/rest-adapter.js b/packages/ember-data/lib/adapters/rest-adapter.js index 6f7b97d4e05..e6ca44eac15 100644 --- a/packages/ember-data/lib/adapters/rest-adapter.js +++ b/packages/ember-data/lib/adapters/rest-adapter.js @@ -9,11 +9,9 @@ import { TimeoutError, AbortError } from 'ember-data/adapters/errors'; -import { - MapWithDefault -} from "ember-data/system/map"; import EmptyObject from "ember-data/system/empty-object"; var get = Ember.get; +var MapWithDefault = Ember.MapWithDefault; import BuildURLMixin from "ember-data/adapters/build-url-mixin"; diff --git a/packages/ember-data/lib/system/map.js b/packages/ember-data/lib/system/map.js deleted file mode 100644 index 1698f962489..00000000000 --- a/packages/ember-data/lib/system/map.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - The Map/MapWithDefault code has been in flux as we try - to catch up with ES6. This is difficult as we support multiple - versions of Ember. - This file is currently here in case we have to polyfill ember's code - across a few releases. As ES6 comes to a close we should have a smaller - and smaller gap in implementations between Ember releases. -*/ -var Map = Ember.Map; -var MapWithDefault = Ember.MapWithDefault; - -export default Map; -export {Map, MapWithDefault}; diff --git a/packages/ember-data/lib/system/model/attributes.js b/packages/ember-data/lib/system/model/attributes.js index e172929561e..5322a29020d 100644 --- a/packages/ember-data/lib/system/model/attributes.js +++ b/packages/ember-data/lib/system/model/attributes.js @@ -1,13 +1,11 @@ import Model from "ember-data/system/model/model"; -import { - Map -} from "ember-data/system/map"; /** @module ember-data */ var get = Ember.get; +var Map = Ember.Map; /** @class Model diff --git a/packages/ember-data/lib/system/model/errors.js b/packages/ember-data/lib/system/model/errors.js index df2ea3a04a8..2c1ffda2d24 100644 --- a/packages/ember-data/lib/system/model/errors.js +++ b/packages/ember-data/lib/system/model/errors.js @@ -3,9 +3,7 @@ var set = Ember.set; var isEmpty = Ember.isEmpty; var makeArray = Ember.makeArray; -import { - MapWithDefault -} from "ember-data/system/map"; +var MapWithDefault = Ember.MapWithDefault; /** @module ember-data diff --git a/packages/ember-data/lib/system/record-array-manager.js b/packages/ember-data/lib/system/record-array-manager.js index 38355ae6cba..80b85f74ca7 100644 --- a/packages/ember-data/lib/system/record-array-manager.js +++ b/packages/ember-data/lib/system/record-array-manager.js @@ -7,9 +7,7 @@ import { FilteredRecordArray, AdapterPopulatedRecordArray } from "ember-data/system/record-arrays"; -import { - MapWithDefault -} from "ember-data/system/map"; +var MapWithDefault = Ember.MapWithDefault; import OrderedSet from "ember-data/system/ordered-set"; var get = Ember.get; diff --git a/packages/ember-data/lib/system/relationships/ext.js b/packages/ember-data/lib/system/relationships/ext.js index 45dedc979e2..3da55e6539a 100644 --- a/packages/ember-data/lib/system/relationships/ext.js +++ b/packages/ember-data/lib/system/relationships/ext.js @@ -3,13 +3,11 @@ import { relationshipFromMeta } from "ember-data/system/relationship-meta"; import Model from "ember-data/system/model"; -import { - Map, - MapWithDefault -} from "ember-data/system/map"; import EmptyObject from "ember-data/system/empty-object"; var get = Ember.get; +var Map = Ember.Map; +var MapWithDefault = Ember.MapWithDefault; var relationshipsDescriptor = Ember.computed(function() { if (Ember.testing === true && relationshipsDescriptor._cacheable === true) { diff --git a/packages/ember-data/lib/system/store.js b/packages/ember-data/lib/system/store.js index 71127c9b7e8..0bc1fcbd2fd 100644 --- a/packages/ember-data/lib/system/store.js +++ b/packages/ember-data/lib/system/store.js @@ -10,9 +10,6 @@ import normalizeModelName from "ember-data/system/normalize-model-name"; import { InvalidError } from 'ember-data/adapters/errors'; -import { - Map -} from "ember-data/system/map"; import { promiseArray, @@ -55,6 +52,7 @@ import InternalModel from "ember-data/system/model/internal-model"; import EmptyObject from "ember-data/system/empty-object"; var Backburner = Ember._Backburner || Ember.Backburner || Ember.__loader.require('backburner')['default'] || Ember.__loader.require('backburner')['Backburner']; +var Map = Ember.Map; //Shim Backburner.join if (!Backburner.prototype.join) {