ember-source 2.4.0.beta.2 → 2.4.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d248ec7455a8ff0d33802b918af36a160af5001
4
- data.tar.gz: 549b3ce547a79457548187d6e3181f42d9436e6b
3
+ metadata.gz: db9ffc0eaf20f0b6dcd04c3e75fafb1e3494a2e2
4
+ data.tar.gz: 696528ff7f1a389f8ed677ab0e640f3ac0c0ccbd
5
5
  SHA512:
6
- metadata.gz: fc86947a332e9a0323d9309dc75ac569f2db8ccbd4b046a28ed76ccfbf4578168274fd71281a7e00bbe43a9ab440f31511b68370c83cc5abc80078c4f9d19cf1
7
- data.tar.gz: 786ea74b6f413c9058710a390f5213c2aeef33216c1305eb27c70620ee1f45c47deda711638c5062c5a21a922aa9cc2b70f76a6e6d3fc1ea21f9c22638fff987
6
+ metadata.gz: 64d226462e1309659a8d3ec01b6c728a2ebf7258eb72c2420e22c73ceadc28c30a232f79bf137d346d344d288530d7ceb3de06fac2ec0b7f4c0ed8e0f53c74bc
7
+ data.tar.gz: 68adc98fd7983493c1f03f84cb81a4df9238f75bb00d3142239d8c9b4ef896a4de216cee820595b8f33ccc8e72a6cd5141e9360c3749ad3a5be51bcbf9d39c61
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.0-beta.2
1
+ 2.4.0-beta.3
@@ -1,12 +1,12 @@
1
1
  ;(function() {
2
2
  /*!
3
3
  * @overview Ember - JavaScript Application Framework
4
- * @copyright Copyright 2011-2015 Tilde Inc. and contributors
4
+ * @copyright Copyright 2011-2016 Tilde Inc. and contributors
5
5
  * Portions Copyright 2006-2011 Strobe Inc.
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 2.4.0-beta.2
9
+ * @version 2.4.0-beta.3
10
10
  */
11
11
 
12
12
  var enifed, requireModule, require, requirejs, Ember;
@@ -212,20 +212,24 @@ enifed('backburner/deferred-action-queues', ['exports', 'backburner/utils', 'bac
212
212
  enifed('backburner/platform', ['exports'], function (exports) {
213
213
  'use strict';
214
214
 
215
- var platform;
215
+ var GlobalContext;
216
216
 
217
217
  /* global self */
218
218
  if (typeof self === 'object') {
219
- platform = self;
219
+ GlobalContext = self;
220
220
 
221
221
  /* global global */
222
222
  } else if (typeof global === 'object') {
223
- platform = global;
224
- } else {
225
- throw new Error('no global: `self` or `global` found');
226
- }
223
+ GlobalContext = global;
227
224
 
228
- exports.default = platform;
225
+ /* global window */
226
+ } else if (typeof window === 'object') {
227
+ GlobalContext = window;
228
+ } else {
229
+ throw new Error('no global: `self`, `global` nor `window` was found');
230
+ }
231
+
232
+ exports.default = GlobalContext;
229
233
  });
230
234
  enifed('backburner/queue', ['exports', 'backburner/utils'], function (exports, _backburnerUtils) {
231
235
  'use strict';
@@ -468,7 +472,6 @@ enifed('backburner/utils', ['exports'], function (exports) {
468
472
  exports.isFunction = isFunction;
469
473
  exports.isNumber = isNumber;
470
474
  exports.isCoercableNumber = isCoercableNumber;
471
- exports.wrapInTryCatch = wrapInTryCatch;
472
475
  var NUMBER = /\d+/;
473
476
 
474
477
  function each(collection, callback) {
@@ -477,14 +480,6 @@ enifed('backburner/utils', ['exports'], function (exports) {
477
480
  }
478
481
  }
479
482
 
480
- // Date.now is not available in browsers < IE9
481
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility
482
- var now = Date.now || function () {
483
- return new Date().getTime();
484
- };
485
-
486
- exports.now = now;
487
-
488
483
  function isString(suspect) {
489
484
  return typeof suspect === 'string';
490
485
  }
@@ -500,16 +495,6 @@ enifed('backburner/utils', ['exports'], function (exports) {
500
495
  function isCoercableNumber(number) {
501
496
  return isNumber(number) || NUMBER.test(number);
502
497
  }
503
-
504
- function wrapInTryCatch(func) {
505
- return function () {
506
- try {
507
- return func.apply(this, arguments);
508
- } catch (e) {
509
- throw e;
510
- }
511
- };
512
- }
513
498
  });
514
499
  enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'backburner/binary-search', 'backburner/deferred-action-queues'], function (exports, _backburnerUtils, _backburnerPlatform, _backburnerBinarySearch, _backburnerDeferredActionQueues) {
515
500
  'use strict';
@@ -530,10 +515,16 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
530
515
  begin: []
531
516
  };
532
517
 
518
+ var _this = this;
519
+ this._boundClearItems = function () {
520
+ clearItems();
521
+ };
522
+
533
523
  this._timerTimeoutId = undefined;
534
524
  this._timers = [];
535
525
 
536
- var _this = this;
526
+ this._platform = this.options._platform || _backburnerPlatform.default;
527
+
537
528
  this._boundRunExpiredTimers = function () {
538
529
  _this._runExpiredTimers();
539
530
  };
@@ -870,7 +861,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
870
861
  }
871
862
  }
872
863
 
873
- var executeAt = _backburnerUtils.now() + parseInt(wait, 10);
864
+ var executeAt = Date.now() + parseInt(wait, 10);
874
865
 
875
866
  if (_backburnerUtils.isString(method)) {
876
867
  method = target[method];
@@ -936,7 +927,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
936
927
  return this._throttlers[index];
937
928
  } // throttled
938
929
 
939
- timer = _backburnerPlatform.default.setTimeout(function () {
930
+ timer = this._platform.setTimeout(function () {
940
931
  if (!immediate) {
941
932
  backburner.run.apply(backburner, args);
942
933
  }
@@ -981,10 +972,10 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
981
972
  if (index > -1) {
982
973
  debouncee = this._debouncees[index];
983
974
  this._debouncees.splice(index, 1);
984
- clearTimeout(debouncee[2]);
975
+ this._platform.clearTimeout(debouncee[2]);
985
976
  }
986
977
 
987
- timer = _backburnerPlatform.default.setTimeout(function () {
978
+ timer = this._platform.setTimeout(function () {
988
979
  if (!immediate) {
989
980
  backburner.run.apply(backburner, args);
990
981
  }
@@ -1006,17 +997,17 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1006
997
  },
1007
998
 
1008
999
  cancelTimers: function () {
1009
- _backburnerUtils.each(this._throttlers, clearItems);
1000
+ _backburnerUtils.each(this._throttlers, this._boundClearItems);
1010
1001
  this._throttlers = [];
1011
1002
 
1012
- _backburnerUtils.each(this._debouncees, clearItems);
1003
+ _backburnerUtils.each(this._debouncees, this._boundClearItems);
1013
1004
  this._debouncees = [];
1014
1005
 
1015
1006
  this._clearTimerTimeout();
1016
1007
  this._timers = [];
1017
1008
 
1018
1009
  if (this._autorun) {
1019
- clearTimeout(this._autorun);
1010
+ this._platform.clearTimeout(this._autorun);
1020
1011
  this._autorun = null;
1021
1012
  }
1022
1013
  },
@@ -1065,7 +1056,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1065
1056
 
1066
1057
  if (item[2] === timer[2]) {
1067
1058
  array.splice(index, 1);
1068
- clearTimeout(timer[2]);
1059
+ this._platform.clearTimeout(timer[2]);
1069
1060
  return true;
1070
1061
  }
1071
1062
  }
@@ -1079,7 +1070,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1079
1070
  },
1080
1071
 
1081
1072
  _scheduleExpiredTimers: function () {
1082
- var n = _backburnerUtils.now();
1073
+ var n = Date.now();
1083
1074
  var timers = this._timers;
1084
1075
  var i = 0;
1085
1076
  var l = timers.length;
@@ -1105,7 +1096,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1105
1096
  if (!this._timerTimeoutId) {
1106
1097
  return;
1107
1098
  }
1108
- clearTimeout(this._timerTimeoutId);
1099
+ this._platform.clearTimeout(this._timerTimeoutId);
1109
1100
  this._timerTimeoutId = undefined;
1110
1101
  },
1111
1102
 
@@ -1114,9 +1105,9 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1114
1105
  return;
1115
1106
  }
1116
1107
  var minExpiresAt = this._timers[0];
1117
- var n = _backburnerUtils.now();
1108
+ var n = Date.now();
1118
1109
  var wait = Math.max(0, minExpiresAt - n);
1119
- this._timerTimeoutId = setTimeout(this._boundRunExpiredTimers, wait);
1110
+ this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait);
1120
1111
  }
1121
1112
  };
1122
1113
 
@@ -1130,7 +1121,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1130
1121
 
1131
1122
  function createAutorun(backburner) {
1132
1123
  backburner.begin();
1133
- backburner._autorun = _backburnerPlatform.default.setTimeout(function () {
1124
+ backburner._autorun = backburner._platform.setTimeout(function () {
1134
1125
  backburner._autorun = null;
1135
1126
  backburner.end();
1136
1127
  });
@@ -1160,7 +1151,7 @@ enifed('backburner', ['exports', 'backburner/utils', 'backburner/platform', 'bac
1160
1151
  }
1161
1152
 
1162
1153
  function clearItems(item) {
1163
- clearTimeout(item[2]);
1154
+ this._platform.clearTimeout(item[2]);
1164
1155
  }
1165
1156
  });
1166
1157
  enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/dictionary', 'ember-metal/features', 'container/owner', 'ember-runtime/mixins/container_proxy', 'ember-metal/symbol'], function (exports, _emberMetalCore, _emberMetalDebug, _emberMetalDictionary, _emberMetalFeatures, _containerOwner, _emberRuntimeMixinsContainer_proxy, _emberMetalSymbol) {
@@ -4884,7 +4875,7 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
4884
4875
 
4885
4876
  @class Ember
4886
4877
  @static
4887
- @version 2.4.0-beta.2
4878
+ @version 2.4.0-beta.3
4888
4879
  @public
4889
4880
  */
4890
4881
 
@@ -4926,11 +4917,11 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
4926
4917
 
4927
4918
  @property VERSION
4928
4919
  @type String
4929
- @default '2.4.0-beta.2'
4920
+ @default '2.4.0-beta.3'
4930
4921
  @static
4931
4922
  @public
4932
4923
  */
4933
- Ember.VERSION = '2.4.0-beta.2';
4924
+ Ember.VERSION = '2.4.0-beta.3';
4934
4925
 
4935
4926
  /**
4936
4927
  The hash of environment variables used to control various configuration
@@ -7311,6 +7302,7 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
7311
7302
  */
7312
7303
  var members = {
7313
7304
  cache: ownMap,
7305
+ weak: ownMap,
7314
7306
  watching: inheritedMap,
7315
7307
  mixins: inheritedMap,
7316
7308
  bindings: inheritedMap,
@@ -7325,6 +7317,7 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
7325
7317
 
7326
7318
  function Meta(obj, parentMeta) {
7327
7319
  this._cache = undefined;
7320
+ this._weak = undefined;
7328
7321
  this._watching = undefined;
7329
7322
  this._mixins = undefined;
7330
7323
  this._bindings = undefined;
@@ -7409,7 +7402,7 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
7409
7402
  };
7410
7403
 
7411
7404
  Meta.prototype['clear' + capitalized] = function () {
7412
- this[key] = new _emberMetalEmpty_object.default();
7405
+ this[key] = undefined;
7413
7406
  };
7414
7407
 
7415
7408
  Meta.prototype['deleteFrom' + capitalized] = function (subkey) {
@@ -8469,11 +8462,10 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
8469
8462
  seen[_emberMetalUtils.guidFor(mixin)] = true;
8470
8463
 
8471
8464
  if (mixin.properties) {
8472
- var props = mixin.properties;
8473
- for (var key in props) {
8474
- if (props.hasOwnProperty(key)) {
8475
- ret[key] = true;
8476
- }
8465
+ var props = Object.keys(mixin.properties);
8466
+ for (var i = 0; i < props.length; i++) {
8467
+ var key = props[i];
8468
+ ret[key] = true;
8477
8469
  }
8478
8470
  } else if (mixin.mixins) {
8479
8471
  mixin.mixins.forEach(function (x) {
@@ -8485,13 +8477,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
8485
8477
  MixinPrototype.keys = function () {
8486
8478
  var keys = {};
8487
8479
  var seen = {};
8488
- var ret = [];
8480
+
8489
8481
  _keys(keys, this, seen);
8490
- for (var key in keys) {
8491
- if (keys.hasOwnProperty(key)) {
8492
- ret.push(key);
8493
- }
8494
- }
8482
+ var ret = Object.keys(keys);
8495
8483
  return ret;
8496
8484
  };
8497
8485
 
@@ -12459,6 +12447,101 @@ enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/wa
12459
12447
  }
12460
12448
  }
12461
12449
  });
12450
+ enifed('ember-metal/weak_map', ['exports', 'ember-metal/debug', 'ember-metal/utils', 'ember-metal/meta'], function (exports, _emberMetalDebug, _emberMetalUtils, _emberMetalMeta) {
12451
+ 'use strict';
12452
+
12453
+ exports.default = WeakMap;
12454
+
12455
+ var id = 0;
12456
+ function UNDEFINED() {}
12457
+
12458
+ /*
12459
+ * @private
12460
+ * @class Ember.WeakMap
12461
+ *
12462
+ * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects).
12463
+ *
12464
+ * There is a small but important caveat. This implementation assumes that the
12465
+ * weak map will live longer (in the sense of garbage collection) than all of its
12466
+ * keys, otherwise it is possible to leak the values stored in the weak map. In
12467
+ * practice, most use cases satisfy this limitation which is why it is included
12468
+ * in ember-metal.
12469
+ */
12470
+
12471
+ function WeakMap() {
12472
+ _emberMetalDebug.assert('Invoking the WeakMap constructor with arguments is not supported at this time', arguments.length === 0);
12473
+
12474
+ this._id = _emberMetalUtils.GUID_KEY + id++;
12475
+ }
12476
+
12477
+ /*
12478
+ * @method get
12479
+ * @param key {Object | Function}
12480
+ * @return {Any} stored value
12481
+ */
12482
+ WeakMap.prototype.get = function (obj) {
12483
+ var meta = _emberMetalMeta.peekMeta(obj);
12484
+ if (meta) {
12485
+ var map = meta.readableWeak();
12486
+ if (map) {
12487
+ if (map[this._id] === UNDEFINED) {
12488
+ return undefined;
12489
+ }
12490
+
12491
+ return map[this._id];
12492
+ }
12493
+ }
12494
+ };
12495
+
12496
+ /*
12497
+ * @method set
12498
+ * @param key {Object | Function}
12499
+ * @param value {Any}
12500
+ * @return {WeakMap} the weak map
12501
+ */
12502
+ WeakMap.prototype.set = function (obj, value) {
12503
+ _emberMetalDebug.assert('Uncaught TypeError: Invalid value used as weak map key', obj && (typeof obj === 'object' || typeof obj === 'function'));
12504
+
12505
+ if (value === undefined) {
12506
+ value = UNDEFINED;
12507
+ }
12508
+
12509
+ _emberMetalMeta.meta(obj).writableWeak()[this._id] = value;
12510
+
12511
+ return this;
12512
+ };
12513
+
12514
+ /*
12515
+ * @method has
12516
+ * @param key {Object | Function}
12517
+ * @return {boolean} if the key exists
12518
+ */
12519
+ WeakMap.prototype.has = function (obj) {
12520
+ var meta = _emberMetalMeta.peekMeta(obj);
12521
+ if (meta) {
12522
+ var map = meta.readableWeak();
12523
+ if (map) {
12524
+ return map[this._id] !== undefined;
12525
+ }
12526
+ }
12527
+
12528
+ return false;
12529
+ };
12530
+
12531
+ /*
12532
+ * @method delete
12533
+ * @param key {Object | Function}
12534
+ * @return {boolean} if the key was deleted
12535
+ */
12536
+ WeakMap.prototype.delete = function (obj) {
12537
+ if (this.has(obj)) {
12538
+ delete _emberMetalMeta.meta(obj).writableWeak()[this._id];
12539
+ return true;
12540
+ } else {
12541
+ return false;
12542
+ }
12543
+ };
12544
+ });
12462
12545
  enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) {
12463
12546
  'use strict';
12464
12547
 
@@ -12605,7 +12688,7 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim
12605
12688
  }
12606
12689
  }
12607
12690
  });
12608
- enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/computed', 'ember-metal/observer', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-metal/is_none', 'ember-metal/get_properties'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalError, _emberMetalComputed, _emberMetalObserver, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberMetalIs_none, _emberMetalGet_properties) {
12691
+ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/computed', 'ember-metal/observer', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-metal/is_none', 'ember-metal/get_properties', 'ember-metal/weak_map'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalError, _emberMetalComputed, _emberMetalObserver, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberMetalIs_none, _emberMetalGet_properties, _emberMetalWeak_map) {
12609
12692
  /**
12610
12693
  @module ember
12611
12694
  @submodule ember-runtime
@@ -12675,7 +12758,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
12675
12758
  }
12676
12759
 
12677
12760
  /**
12678
- A computed property that returns the sum of the value
12761
+ A computed property that returns the sum of the values
12679
12762
  in the dependent array.
12680
12763
 
12681
12764
  @method sum
@@ -13268,67 +13351,83 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
13268
13351
  var cp = new _emberMetalComputed.ComputedProperty(function (key) {
13269
13352
  var _this5 = this;
13270
13353
 
13271
- function didChange() {
13272
- this.notifyPropertyChange(key);
13273
- }
13274
-
13275
- var items = itemsKey === '@this' ? this : _emberMetalProperty_get.get(this, itemsKey);
13354
+ var itemsKeyIsAtThis = itemsKey === '@this';
13276
13355
  var sortProperties = _emberMetalProperty_get.get(this, sortPropertiesKey);
13277
13356
 
13278
- if (items === null || typeof items !== 'object') {
13279
- return _emberRuntimeSystemNative_array.A();
13280
- }
13357
+ _emberMetalDebug.assert('The sort definition for \'' + key + '\' on ' + this + ' must be a function or an array of strings', _emberRuntimeUtils.isArray(sortProperties) && sortProperties.every(function (s) {
13358
+ return typeof s === 'string';
13359
+ }));
13281
13360
 
13282
- // TODO: Ideally we'd only do this if things have changed
13283
- if (cp._sortPropObservers) {
13284
- cp._sortPropObservers.forEach(function (args) {
13285
- return _emberMetalObserver.removeObserver.apply(null, args);
13361
+ var normalizedSortProperties = normalizeSortProperties(sortProperties);
13362
+
13363
+ // Add/remove property observers as required.
13364
+ var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetalWeak_map.default());
13365
+ var activeObservers = activeObserversMap.get(this);
13366
+
13367
+ if (activeObservers) {
13368
+ activeObservers.forEach(function (args) {
13369
+ _emberMetalObserver.removeObserver.apply(null, args);
13286
13370
  });
13287
13371
  }
13288
13372
 
13289
- cp._sortPropObservers = [];
13290
-
13291
- if (!_emberRuntimeUtils.isArray(sortProperties)) {
13292
- return items;
13373
+ function sortPropertyDidChange() {
13374
+ this.notifyPropertyChange(key);
13293
13375
  }
13294
13376
 
13295
- // Normalize properties
13296
- var normalizedSort = sortProperties.map(function (p) {
13297
- var _p$split = p.split(':');
13377
+ activeObservers = normalizedSortProperties.map(function (_ref) {
13378
+ var prop = _ref[0];
13298
13379
 
13299
- var prop = _p$split[0];
13300
- var direction = _p$split[1];
13380
+ var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop;
13381
+ var args = [_this5, path, sortPropertyDidChange];
13382
+ _emberMetalObserver.addObserver.apply(null, args);
13383
+ return args;
13384
+ });
13301
13385
 
13302
- direction = direction || 'asc';
13386
+ activeObserversMap.set(this, activeObservers);
13303
13387
 
13304
- return [prop, direction];
13305
- });
13388
+ // Sort and return the array.
13389
+ var items = itemsKeyIsAtThis ? this : _emberMetalProperty_get.get(this, itemsKey);
13306
13390
 
13307
- // TODO: Ideally we'd only do this if things have changed
13308
- // Add observers
13309
- normalizedSort.forEach(function (prop) {
13310
- var args = [_this5, itemsKey + '.@each.' + prop[0], didChange];
13311
- cp._sortPropObservers.push(args);
13312
- _emberMetalObserver.addObserver.apply(null, args);
13313
- });
13391
+ if (_emberRuntimeUtils.isArray(items)) {
13392
+ return sortByNormalizedSortProperties(items, normalizedSortProperties);
13393
+ } else {
13394
+ return _emberRuntimeSystemNative_array.A();
13395
+ }
13396
+ });
13314
13397
 
13315
- return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) {
13316
- for (var i = 0; i < normalizedSort.length; ++i) {
13317
- var _normalizedSort$i = normalizedSort[i];
13318
- var prop = _normalizedSort$i[0];
13319
- var direction = _normalizedSort$i[1];
13398
+ cp._activeObserverMap = undefined;
13320
13399
 
13321
- var result = _emberRuntimeCompare.default(_emberMetalProperty_get.get(itemA, prop), _emberMetalProperty_get.get(itemB, prop));
13322
- if (result !== 0) {
13323
- return direction === 'desc' ? -1 * result : result;
13324
- }
13325
- }
13400
+ return cp.property(sortPropertiesKey + '.[]').readOnly();
13401
+ }
13326
13402
 
13327
- return 0;
13328
- }));
13403
+ function normalizeSortProperties(sortProperties) {
13404
+ return sortProperties.map(function (p) {
13405
+ var _p$split = p.split(':');
13406
+
13407
+ var prop = _p$split[0];
13408
+ var direction = _p$split[1];
13409
+
13410
+ direction = direction || 'asc';
13411
+
13412
+ return [prop, direction];
13329
13413
  });
13414
+ }
13415
+
13416
+ function sortByNormalizedSortProperties(items, normalizedSortProperties) {
13417
+ return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) {
13418
+ for (var i = 0; i < normalizedSortProperties.length; i++) {
13419
+ var _normalizedSortProperties$i = normalizedSortProperties[i];
13420
+ var prop = _normalizedSortProperties$i[0];
13421
+ var direction = _normalizedSortProperties$i[1];
13422
+
13423
+ var result = _emberRuntimeCompare.default(_emberMetalProperty_get.get(itemA, prop), _emberMetalProperty_get.get(itemB, prop));
13424
+ if (result !== 0) {
13425
+ return direction === 'desc' ? -1 * result : result;
13426
+ }
13427
+ }
13330
13428
 
13331
- return cp.property(itemsKey + '.[]', sortPropertiesKey + '.[]').readOnly();
13429
+ return 0;
13430
+ }));
13332
13431
  }
13333
13432
  });
13334
13433
  enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal/debug', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetalDebug, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) {
@@ -14395,6 +14494,10 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14395
14494
  //
14396
14495
  'use strict';
14397
14496
 
14497
+ exports.addArrayObserver = addArrayObserver;
14498
+ exports.removeArrayObserver = removeArrayObserver;
14499
+ exports.objectAt = objectAt;
14500
+
14398
14501
  function arrayObserversHelper(obj, target, opts, operation, notify) {
14399
14502
  var willChange = opts && opts.willChange || 'arrayWillChange';
14400
14503
  var didChange = opts && opts.didChange || 'arrayDidChange';
@@ -14414,6 +14517,22 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14414
14517
  return obj;
14415
14518
  }
14416
14519
 
14520
+ function addArrayObserver(array, target, opts) {
14521
+ return arrayObserversHelper(array, target, opts, _emberMetalEvents.addListener, false);
14522
+ }
14523
+
14524
+ function removeArrayObserver(array, target, opts) {
14525
+ return arrayObserversHelper(array, target, opts, _emberMetalEvents.removeListener, true);
14526
+ }
14527
+
14528
+ function objectAt(content, idx) {
14529
+ if (content.objectAt) {
14530
+ return content.objectAt(idx);
14531
+ }
14532
+
14533
+ return content[idx];
14534
+ }
14535
+
14417
14536
  // ..........................................................
14418
14537
  // ARRAY
14419
14538
  //
@@ -14506,16 +14625,16 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14506
14625
  @public
14507
14626
  */
14508
14627
  objectsAt: function (indexes) {
14509
- var self = this;
14628
+ var _this = this;
14510
14629
 
14511
14630
  return indexes.map(function (idx) {
14512
- return self.objectAt(idx);
14631
+ return objectAt(_this, idx);
14513
14632
  });
14514
14633
  },
14515
14634
 
14516
14635
  // overrides Ember.Enumerable version
14517
14636
  nextObject: function (idx) {
14518
- return this.objectAt(idx);
14637
+ return objectAt(this, idx);
14519
14638
  },
14520
14639
 
14521
14640
  /**
@@ -14538,11 +14657,11 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14538
14657
  }),
14539
14658
 
14540
14659
  firstObject: _emberMetalComputed.computed(function () {
14541
- return this.objectAt(0);
14660
+ return objectAt(this, 0);
14542
14661
  }),
14543
14662
 
14544
14663
  lastObject: _emberMetalComputed.computed(function () {
14545
- return this.objectAt(_emberMetalProperty_get.get(this, 'length') - 1);
14664
+ return objectAt(this, _emberMetalProperty_get.get(this, 'length') - 1);
14546
14665
  }),
14547
14666
 
14548
14667
  // optimized version from Enumerable
@@ -14588,7 +14707,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14588
14707
  }
14589
14708
 
14590
14709
  while (beginIndex < endIndex) {
14591
- ret[ret.length] = this.objectAt(beginIndex++);
14710
+ ret[ret.length] = objectAt(this, beginIndex++);
14592
14711
  }
14593
14712
 
14594
14713
  return ret;
@@ -14627,7 +14746,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14627
14746
  }
14628
14747
 
14629
14748
  for (idx = startAt; idx < len; idx++) {
14630
- if (this.objectAt(idx) === object) {
14749
+ if (objectAt(this, idx) === object) {
14631
14750
  return idx;
14632
14751
  }
14633
14752
  }
@@ -14668,7 +14787,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14668
14787
  }
14669
14788
 
14670
14789
  for (idx = startAt; idx >= 0; idx--) {
14671
- if (this.objectAt(idx) === object) {
14790
+ if (objectAt(this, idx) === object) {
14672
14791
  return idx;
14673
14792
  }
14674
14793
  }
@@ -14703,7 +14822,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14703
14822
  */
14704
14823
 
14705
14824
  addArrayObserver: function (target, opts) {
14706
- return arrayObserversHelper(this, target, opts, _emberMetalEvents.addListener, false);
14825
+ return addArrayObserver(this, target, opts);
14707
14826
  },
14708
14827
 
14709
14828
  /**
@@ -14718,7 +14837,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14718
14837
  @public
14719
14838
  */
14720
14839
  removeArrayObserver: function (target, opts) {
14721
- return arrayObserversHelper(this, target, opts, _emberMetalEvents.removeListener, true);
14840
+ return removeArrayObserver(this, target, opts);
14722
14841
  },
14723
14842
 
14724
14843
  /**
@@ -14773,7 +14892,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14773
14892
  lim = startIdx + removeAmt;
14774
14893
 
14775
14894
  for (var idx = startIdx; idx < lim; idx++) {
14776
- removing.push(this.objectAt(idx));
14895
+ removing.push(objectAt(this, idx));
14777
14896
  }
14778
14897
  } else {
14779
14898
  removing = removeAmt;
@@ -14820,7 +14939,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14820
14939
  lim = startIdx + addAmt;
14821
14940
 
14822
14941
  for (var idx = startIdx; idx < lim; idx++) {
14823
- adding.push(this.objectAt(idx));
14942
+ adding.push(objectAt(this, idx));
14824
14943
  }
14825
14944
  } else {
14826
14945
  adding = addAmt;
@@ -14838,12 +14957,12 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14838
14957
  var cachedFirst = _emberMetalComputed.cacheFor(this, 'firstObject');
14839
14958
  var cachedLast = _emberMetalComputed.cacheFor(this, 'lastObject');
14840
14959
 
14841
- if (this.objectAt(0) !== cachedFirst) {
14960
+ if (objectAt(this, 0) !== cachedFirst) {
14842
14961
  _emberMetalProperty_events.propertyWillChange(this, 'firstObject');
14843
14962
  _emberMetalProperty_events.propertyDidChange(this, 'firstObject');
14844
14963
  }
14845
14964
 
14846
- if (this.objectAt(length - 1) !== cachedLast) {
14965
+ if (objectAt(this, length - 1) !== cachedLast) {
14847
14966
  _emberMetalProperty_events.propertyWillChange(this, 'lastObject');
14848
14967
  _emberMetalProperty_events.propertyDidChange(this, 'lastObject');
14849
14968
  }
@@ -16606,7 +16725,7 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_g
16606
16725
  return null;
16607
16726
  }
16608
16727
 
16609
- var ret = this.objectAt(len - 1);
16728
+ var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1);
16610
16729
  this.removeAt(len - 1, 1);
16611
16730
  return ret;
16612
16731
  },
@@ -16628,7 +16747,7 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_g
16628
16747
  return null;
16629
16748
  }
16630
16749
 
16631
- var ret = this.objectAt(0);
16750
+ var ret = _emberRuntimeMixinsArray.objectAt(this, 0);
16632
16751
  this.removeAt(0);
16633
16752
  return ret;
16634
16753
  },
@@ -16731,7 +16850,7 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_g
16731
16850
  removeObject: function (obj) {
16732
16851
  var loc = _emberMetalProperty_get.get(this, 'length') || 0;
16733
16852
  while (--loc >= 0) {
16734
- var curObject = this.objectAt(loc);
16853
+ var curObject = _emberRuntimeMixinsArray.objectAt(this, loc);
16735
16854
 
16736
16855
  if (curObject === obj) {
16737
16856
  this.removeAt(loc);
@@ -16913,8 +17032,9 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal/debug', 'embe
16913
17032
 
16914
17033
  ## Observing Property Changes
16915
17034
 
16916
- You typically observe property changes simply by adding the `observes`
16917
- call to the end of your method declarations in classes that you write.
17035
+ You typically observe property changes simply by using the `Ember.observer`
17036
+ function in classes that you write.
17037
+
16918
17038
  For example:
16919
17039
 
16920
17040
  ```javascript
@@ -17939,7 +18059,7 @@ enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/nam
17939
18059
 
17940
18060
  exports.default = _emberRuntimeSystemNamespace.default.extend();
17941
18061
  });
17942
- enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-runtime/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/error', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-metal/alias'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalProperty_events, _emberMetalError, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberMetalAlias) {
18062
+ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-runtime/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/error', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-metal/alias', 'ember-runtime/mixins/array'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalProperty_events, _emberMetalError, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberMetalAlias, _emberRuntimeMixinsArray) {
17943
18063
  'use strict';
17944
18064
 
17945
18065
  /**
@@ -18024,7 +18144,7 @@ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'emb
18024
18144
  @private
18025
18145
  */
18026
18146
  objectAtContent: function (idx) {
18027
- return _emberMetalProperty_get.get(this, 'arrangedContent').objectAt(idx);
18147
+ return _emberRuntimeMixinsArray.objectAt(_emberMetalProperty_get.get(this, 'arrangedContent'), idx);
18028
18148
  },
18029
18149
 
18030
18150
  /**
@@ -18058,7 +18178,7 @@ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'emb
18058
18178
  var content = _emberMetalProperty_get.get(this, 'content');
18059
18179
 
18060
18180
  if (content) {
18061
- content.removeArrayObserver(this, {
18181
+ _emberRuntimeMixinsArray.removeArrayObserver(content, this, {
18062
18182
  willChange: 'contentArrayWillChange',
18063
18183
  didChange: 'contentArrayDidChange'
18064
18184
  });
@@ -18106,7 +18226,7 @@ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'emb
18106
18226
  if (content) {
18107
18227
  _emberMetalDebug.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof content, _emberRuntimeUtils.isArray(content) || content.isDestroyed);
18108
18228
 
18109
- content.addArrayObserver(this, {
18229
+ _emberRuntimeMixinsArray.addArrayObserver(content, this, {
18110
18230
  willChange: 'contentArrayWillChange',
18111
18231
  didChange: 'contentArrayDidChange'
18112
18232
  });
@@ -18141,7 +18261,7 @@ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'emb
18141
18261
  if (arrangedContent) {
18142
18262
  _emberMetalDebug.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof arrangedContent, _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed);
18143
18263
 
18144
- arrangedContent.addArrayObserver(this, {
18264
+ _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, {
18145
18265
  willChange: 'arrangedContentArrayWillChange',
18146
18266
  didChange: 'arrangedContentArrayDidChange'
18147
18267
  });
@@ -18152,7 +18272,7 @@ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'emb
18152
18272
  var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
18153
18273
 
18154
18274
  if (arrangedContent) {
18155
- arrangedContent.removeArrayObserver(this, {
18275
+ _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, {
18156
18276
  willChange: 'arrangedContentArrayWillChange',
18157
18277
  didChange: 'arrangedContentArrayDidChange'
18158
18278
  });
@@ -18225,7 +18345,7 @@ enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/debug', 'emb
18225
18345
  // Get a list of indices in original content to remove
18226
18346
  for (i = start; i < start + len; i++) {
18227
18347
  // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent
18228
- indices.push(content.indexOf(arrangedContent.objectAt(i)));
18348
+ indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i)));
18229
18349
  }
18230
18350
 
18231
18351
  // Replace in reverse order since indices will change
@@ -19142,7 +19262,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal/debug', 'emb
19142
19262
  @return {String} string representation
19143
19263
  @public
19144
19264
  */
19145
- enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/empty_object'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalObserver, _emberMetalProperty_events, _emberMetalEmpty_object) {
19265
+ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/empty_object', 'ember-runtime/mixins/array'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalObserver, _emberMetalProperty_events, _emberMetalEmpty_object, _emberRuntimeMixinsArray) {
19146
19266
  'use strict';
19147
19267
 
19148
19268
  /**
@@ -19243,7 +19363,7 @@ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/debug', 'embe
19243
19363
 
19244
19364
  function addObserverForContentKey(content, keyName, proxy, idx, loc) {
19245
19365
  while (--loc >= idx) {
19246
- var item = content.objectAt(loc);
19366
+ var item = _emberRuntimeMixinsArray.objectAt(content, loc);
19247
19367
  if (item) {
19248
19368
  _emberMetalDebug.assert('When using @each to observe the array ' + content + ', the array must return an object', typeof item === 'object');
19249
19369
  _emberMetalObserver._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
@@ -19254,7 +19374,7 @@ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/debug', 'embe
19254
19374
 
19255
19375
  function removeObserverForContentKey(content, keyName, proxy, idx, loc) {
19256
19376
  while (--loc >= idx) {
19257
- var item = content.objectAt(loc);
19377
+ var item = _emberRuntimeMixinsArray.objectAt(content, loc);
19258
19378
  if (item) {
19259
19379
  _emberMetalObserver._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
19260
19380
  _emberMetalObserver.removeObserver(item, keyName, proxy, 'contentKeyDidChange');