ember-source 2.4.6 → 2.5.0.beta.1

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: 0d186658626a5fa2f12f0192af6695ba7aa665ec
4
- data.tar.gz: c2d7c2a56d81dc6cfa5f9516ac567f8388824cdc
3
+ metadata.gz: e65e7830106fb22c3868b6c3252bcca93d3f6c9b
4
+ data.tar.gz: bf0770226266774750fcebbba3e1e9979ccd4e6c
5
5
  SHA512:
6
- metadata.gz: 5e076207d0e701ec0031f4570635d6d0936f07f81ab9008b5ed16153c46cec58003ac8ea3fc192c4e819caf1ed441a2a20570073d2e124365a205b1b03d29d92
7
- data.tar.gz: 4898189405bd4633c06d0ac84afacda4ad325ba0c5a30a495103442c8c2efa7ce4d142e3aab838e3b02b8c8bc4decf08208fa1a5af0d5866d4f622e1cc0d7704
6
+ metadata.gz: ce221eb6cc55a0adf13c8c27986c8f31a87b7be9ac2e1f7664839b1e96d4a1a0ce83257c8e72603661fcae358b24c6c71d5a88cfe61e7780796f36142acf5fd3
7
+ data.tar.gz: a44d91cbc6a7ae4afea36298af6dcb6f68a26eed7cca4471e1b358f632d7ab15892537b5c4e82979a60554181930943d8697788a08fdff250d35eebf9c47bc9c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.6
1
+ 2.5.0-beta.1
@@ -6,7 +6,7 @@
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.6
9
+ * @version 2.5.0-beta.1
10
10
  */
11
11
 
12
12
  var enifed, requireModule, require, requirejs, Ember;
@@ -1238,7 +1238,7 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
1238
1238
  twitter2 instanceof Twitter; // => true
1239
1239
  twitter === twitter2; //=> true
1240
1240
  ```
1241
- If singletons are not wanted an optional flag can be provided at lookup.
1241
+ If singletons are not wanted, an optional flag can be provided at lookup.
1242
1242
  ```javascript
1243
1243
  var registry = new Registry();
1244
1244
  var container = registry.container();
@@ -1260,7 +1260,7 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
1260
1260
  },
1261
1261
 
1262
1262
  /**
1263
- Given a fullName return the corresponding factory.
1263
+ Given a fullName, return the corresponding factory.
1264
1264
  @private
1265
1265
  @method lookupFactory
1266
1266
  @param {String} fullName
@@ -1321,9 +1321,8 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
1321
1321
  return container.registry.getOption(fullName, 'singleton') !== false;
1322
1322
  }
1323
1323
 
1324
- function lookup(container, _fullName, _options) {
1325
- var options = _options || {};
1326
- var fullName = _fullName;
1324
+ function lookup(container, fullName) {
1325
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
1327
1326
 
1328
1327
  if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
1329
1328
  if (options.source) {
@@ -1389,10 +1388,10 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
1389
1388
  return hash;
1390
1389
  }
1391
1390
 
1392
- function factoryFor(container, _fullName, _options) {
1393
- var options = _options || {};
1391
+ function factoryFor(container, fullName) {
1392
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
1393
+
1394
1394
  var registry = container.registry;
1395
- var fullName = _fullName;
1396
1395
 
1397
1396
  if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
1398
1397
  if (options.source) {
@@ -1603,14 +1602,14 @@ enifed('container/index', ['exports', 'ember-metal/core', 'container/registry',
1603
1602
  'use strict';
1604
1603
 
1605
1604
  /*
1606
- Public api for the container is still in flux.
1607
- The public api, specified on the application namespace should be considered the stable api.
1605
+ Public API for the container is still in flux.
1606
+ The public API, specified on the application namespace should be considered the stable API.
1608
1607
  // @module container
1609
1608
  @private
1610
1609
  */
1611
1610
 
1612
1611
  /*
1613
- Flag to enable/disable model factory injections (disabled by default)
1612
+ Flag to enable/disable model factory injections (disabled by default).
1614
1613
  If model factory injections are enabled, models should not be
1615
1614
  accessed globally (only through `container.lookupFactory('model:modelName'))`);
1616
1615
  */
@@ -1672,8 +1671,8 @@ enifed('container/owner', ['exports', 'ember-metal/symbol'], function (exports,
1672
1671
  ```
1673
1672
 
1674
1673
  @method getOwner
1675
- @param {Object} object A object with an owner.
1676
- @return {Object} an owner object.
1674
+ @param {Object} object An object with an owner.
1675
+ @return {Object} An owner object.
1677
1676
  @for Ember
1678
1677
  @public
1679
1678
  */
@@ -1687,8 +1686,8 @@ enifed('container/owner', ['exports', 'ember-metal/symbol'], function (exports,
1687
1686
  useful in some testing cases.
1688
1687
 
1689
1688
  @method setOwner
1690
- @param {Object} object A object with an owner.
1691
- @return {Object} an owner object.
1689
+ @param {Object} object An object with an owner.
1690
+ @return {Object} An owner object.
1692
1691
  @for Ember
1693
1692
  @public
1694
1693
  */
@@ -1848,7 +1847,9 @@ enifed('container/registry', ['exports', 'ember-metal/features', 'ember-metal/de
1848
1847
  @param {Function} factory
1849
1848
  @param {Object} options
1850
1849
  */
1851
- register: function (fullName, factory, options) {
1850
+ register: function (fullName, factory) {
1851
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
1852
+
1852
1853
  _emberMetalDebug.assert('fullName must be a proper full name', this.validateFullName(fullName));
1853
1854
 
1854
1855
  if (factory === undefined) {
@@ -1863,7 +1864,7 @@ enifed('container/registry', ['exports', 'ember-metal/features', 'ember-metal/de
1863
1864
 
1864
1865
  delete this._failCache[normalizedName];
1865
1866
  this.registrations[normalizedName] = factory;
1866
- this._options[normalizedName] = options || {};
1867
+ this._options[normalizedName] = options;
1867
1868
  },
1868
1869
 
1869
1870
  /**
@@ -2057,8 +2058,9 @@ enifed('container/registry', ['exports', 'ember-metal/features', 'ember-metal/de
2057
2058
  @param {String} fullName
2058
2059
  @param {Object} options
2059
2060
  */
2060
- options: function (fullName, _options) {
2061
- var options = _options || {};
2061
+ options: function (fullName) {
2062
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
2063
+
2062
2064
  var normalizedName = this.normalize(fullName);
2063
2065
  this._options[normalizedName] = options;
2064
2066
  },
@@ -2548,7 +2550,7 @@ enifed('ember-metal/alias', ['exports', 'ember-metal/debug', 'ember-metal/proper
2548
2550
  return _emberMetalProperty_set.set(obj, keyName, value);
2549
2551
  }
2550
2552
 
2551
- // Backwards compatibility with Ember Data
2553
+ // Backwards compatibility with Ember Data.
2552
2554
  AliasedProperty.prototype._meta = undefined;
2553
2555
  AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta;
2554
2556
  });
@@ -2596,7 +2598,7 @@ enifed("ember-metal/assign", ["exports"], function (exports) {
2596
2598
  return original;
2597
2599
  }
2598
2600
  });
2599
- enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/observer', 'ember-metal/run_loop', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalRun_loop, _emberMetalPath_cache) {
2601
+ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) {
2600
2602
  'use strict';
2601
2603
 
2602
2604
  exports.bind = bind;
@@ -2624,31 +2626,22 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2624
2626
  */
2625
2627
  _emberMetalCore.default.LOG_BINDINGS = false || !!_emberMetalCore.default.ENV.LOG_BINDINGS;
2626
2628
 
2627
- /**
2628
- Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)
2629
- instead of local (`foo.bar.baz`).
2630
-
2631
- @method isGlobalPath
2632
- @for Ember
2633
- @private
2634
- @param {String} path
2635
- @return Boolean
2636
- */
2637
-
2638
- function getWithGlobals(obj, path) {
2639
- return _emberMetalProperty_get.get(_emberMetalPath_cache.isGlobal(path) ? _emberMetalCore.default.lookup : obj, path);
2640
- }
2641
-
2642
2629
  // ..........................................................
2643
2630
  // BINDING
2644
2631
  //
2645
2632
 
2646
2633
  function Binding(toPath, fromPath) {
2647
- this._direction = undefined;
2634
+ // Configuration
2648
2635
  this._from = fromPath;
2649
2636
  this._to = toPath;
2650
- this._readyToSync = undefined;
2651
2637
  this._oneWay = undefined;
2638
+
2639
+ // State
2640
+ this._direction = undefined;
2641
+ this._readyToSync = undefined;
2642
+ this._fromObj = undefined;
2643
+ this._fromPath = undefined;
2644
+ this._toObj = undefined;
2652
2645
  }
2653
2646
 
2654
2647
  /**
@@ -2684,7 +2677,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2684
2677
  you pass when you `connect()` the binding. It follows the same rules as
2685
2678
  `get()` - see that method for more information.
2686
2679
  @method from
2687
- @param {String} path the property path to connect to
2680
+ @param {String} path The property path to connect to.
2688
2681
  @return {Ember.Binding} `this`
2689
2682
  @public
2690
2683
  */
@@ -2701,7 +2694,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2701
2694
  you pass when you `connect()` the binding. It follows the same rules as
2702
2695
  `get()` - see that method for more information.
2703
2696
  @method to
2704
- @param {String|Tuple} path A property path or tuple
2697
+ @param {String|Tuple} path A property path or tuple.
2705
2698
  @return {Ember.Binding} `this`
2706
2699
  @public
2707
2700
  */
@@ -2750,19 +2743,42 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2750
2743
  connect: function (obj) {
2751
2744
  _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
2752
2745
 
2753
- var fromPath = this._from;
2754
- var toPath = this._to;
2755
- _emberMetalProperty_set.trySet(obj, toPath, getWithGlobals(obj, fromPath));
2746
+ var fromObj = undefined,
2747
+ fromPath = undefined;
2748
+
2749
+ // If the binding's "from" path could be interpreted as a global, verify
2750
+ // whether the path refers to a global or not by consulting `Ember.lookup`.
2751
+ if (_emberMetalPath_cache.isGlobalPath(this._from)) {
2752
+ var _name = _emberMetalPath_cache.getFirstKey(this._from);
2753
+ var possibleGlobal = _emberMetalCore.default.lookup[_name];
2754
+
2755
+ if (possibleGlobal) {
2756
+ fromObj = possibleGlobal;
2757
+ fromPath = _emberMetalPath_cache.getTailPath(this._from);
2758
+ }
2759
+ }
2760
+
2761
+ if (fromObj === undefined) {
2762
+ fromObj = obj;
2763
+ fromPath = this._from;
2764
+ }
2765
+
2766
+ _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath));
2756
2767
 
2757
- // add an observer on the object to be notified when the binding should be updated
2758
- _emberMetalObserver.addObserver(obj, fromPath, this, this.fromDidChange);
2768
+ // Add an observer on the object to be notified when the binding should be updated.
2769
+ _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange');
2759
2770
 
2760
- // if the binding is a two-way binding, also set up an observer on the target
2771
+ // If the binding is a two-way binding, also set up an observer on the target.
2761
2772
  if (!this._oneWay) {
2762
- _emberMetalObserver.addObserver(obj, toPath, this, this.toDidChange);
2773
+ _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange');
2763
2774
  }
2764
2775
 
2776
+ _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect');
2777
+
2765
2778
  this._readyToSync = true;
2779
+ this._fromObj = fromObj;
2780
+ this._fromPath = fromPath;
2781
+ this._toObj = obj;
2766
2782
 
2767
2783
  return this;
2768
2784
  },
@@ -2771,25 +2787,22 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2771
2787
  Disconnects the binding instance. Changes will no longer be relayed. You
2772
2788
  will not usually need to call this method.
2773
2789
  @method disconnect
2774
- @param {Object} obj The root object you passed when connecting the binding.
2775
2790
  @return {Ember.Binding} `this`
2776
2791
  @public
2777
2792
  */
2778
- disconnect: function (obj) {
2779
- _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);
2780
-
2781
- var twoWay = !this._oneWay;
2793
+ disconnect: function () {
2794
+ _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj);
2782
2795
 
2783
- // remove an observer on the object so we're no longer notified of
2796
+ // Remove an observer on the object so we're no longer notified of
2784
2797
  // changes that should update bindings.
2785
- _emberMetalObserver.removeObserver(obj, this._from, this, this.fromDidChange);
2798
+ _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange');
2786
2799
 
2787
- // if the binding is two-way, remove the observer from the target as well
2788
- if (twoWay) {
2789
- _emberMetalObserver.removeObserver(obj, this._to, this, this.toDidChange);
2800
+ // If the binding is two-way, remove the observer from the target as well.
2801
+ if (!this._oneWay) {
2802
+ _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange');
2790
2803
  }
2791
2804
 
2792
- this._readyToSync = false; // disable scheduled syncs...
2805
+ this._readyToSync = false; // Disable scheduled syncs...
2793
2806
  return this;
2794
2807
  },
2795
2808
 
@@ -2797,22 +2810,22 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2797
2810
  // PRIVATE
2798
2811
  //
2799
2812
 
2800
- /* called when the from side changes */
2813
+ /* Called when the from side changes. */
2801
2814
  fromDidChange: function (target) {
2802
- this._scheduleSync(target, 'fwd');
2815
+ this._scheduleSync('fwd');
2803
2816
  },
2804
2817
 
2805
- /* called when the to side changes */
2818
+ /* Called when the to side changes. */
2806
2819
  toDidChange: function (target) {
2807
- this._scheduleSync(target, 'back');
2820
+ this._scheduleSync('back');
2808
2821
  },
2809
2822
 
2810
- _scheduleSync: function (obj, dir) {
2823
+ _scheduleSync: function (dir) {
2811
2824
  var existingDir = this._direction;
2812
2825
 
2813
- // if we haven't scheduled the binding yet, schedule it
2826
+ // If we haven't scheduled the binding yet, schedule it.
2814
2827
  if (existingDir === undefined) {
2815
- _emberMetalRun_loop.default.schedule('sync', this, this._sync, obj);
2828
+ _emberMetalRun_loop.default.schedule('sync', this, '_sync');
2816
2829
  this._direction = dir;
2817
2830
  }
2818
2831
 
@@ -2823,44 +2836,46 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2823
2836
  }
2824
2837
  },
2825
2838
 
2826
- _sync: function (obj) {
2839
+ _sync: function () {
2827
2840
  var log = _emberMetalCore.default.LOG_BINDINGS;
2828
2841
 
2829
- // don't synchronize destroyed objects or disconnected bindings
2830
- if (obj.isDestroyed || !this._readyToSync) {
2842
+ var toObj = this._toObj;
2843
+
2844
+ // Don't synchronize destroyed objects or disconnected bindings.
2845
+ if (toObj.isDestroyed || !this._readyToSync) {
2831
2846
  return;
2832
2847
  }
2833
2848
 
2834
- // get the direction of the binding for the object we are
2835
- // synchronizing from
2849
+ // Get the direction of the binding for the object we are
2850
+ // synchronizing from.
2836
2851
  var direction = this._direction;
2837
2852
 
2838
- var fromPath = this._from;
2839
- var toPath = this._to;
2853
+ var fromObj = this._fromObj;
2854
+ var fromPath = this._fromPath;
2840
2855
 
2841
2856
  this._direction = undefined;
2842
2857
 
2843
- // if we're synchronizing from the remote object...
2858
+ // If we're synchronizing from the remote object...
2844
2859
  if (direction === 'fwd') {
2845
- var fromValue = getWithGlobals(obj, this._from);
2860
+ var fromValue = _emberMetalProperty_get.get(fromObj, fromPath);
2846
2861
  if (log) {
2847
- _emberMetalLogger.default.log(' ', this.toString(), '->', fromValue, obj);
2862
+ _emberMetalLogger.default.log(' ', this.toString(), '->', fromValue, fromObj);
2848
2863
  }
2849
2864
  if (this._oneWay) {
2850
- _emberMetalProperty_set.trySet(obj, toPath, fromValue);
2865
+ _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
2851
2866
  } else {
2852
- _emberMetalObserver._suspendObserver(obj, toPath, this, this.toDidChange, function () {
2853
- _emberMetalProperty_set.trySet(obj, toPath, fromValue);
2867
+ _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () {
2868
+ _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
2854
2869
  });
2855
2870
  }
2856
- // if we're synchronizing *to* the remote object
2871
+ // If we're synchronizing *to* the remote object.
2857
2872
  } else if (direction === 'back') {
2858
- var toValue = _emberMetalProperty_get.get(obj, this._to);
2873
+ var toValue = _emberMetalProperty_get.get(toObj, this._to);
2859
2874
  if (log) {
2860
- _emberMetalLogger.default.log(' ', this.toString(), '<-', toValue, obj);
2875
+ _emberMetalLogger.default.log(' ', this.toString(), '<-', toValue, toObj);
2861
2876
  }
2862
- _emberMetalObserver._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {
2863
- _emberMetalProperty_set.trySet(_emberMetalPath_cache.isGlobal(fromPath) ? _emberMetalCore.default.lookup : obj, fromPath, toValue);
2877
+ _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () {
2878
+ _emberMetalProperty_set.trySet(fromObj, fromPath, toValue);
2864
2879
  });
2865
2880
  }
2866
2881
  }
@@ -2901,7 +2916,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2901
2916
  An `Ember.Binding` connects the properties of two objects so that whenever
2902
2917
  the value of one property changes, the other property will be changed also.
2903
2918
 
2904
- ## Automatic Creation of Bindings with `/^*Binding/`-named Properties
2919
+ ## Automatic Creation of Bindings with `/^*Binding/`-named Properties.
2905
2920
 
2906
2921
  You do not usually create Binding objects directly but instead describe
2907
2922
  bindings in your class or object definition using automatic binding
@@ -2950,7 +2965,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
2950
2965
  All of the examples above show you how to configure a custom binding, but the
2951
2966
  result of these customizations will be a binding template, not a fully active
2952
2967
  Binding instance. The binding will actually become active only when you
2953
- instantiate the object the binding belongs to. It is useful however, to
2968
+ instantiate the object the binding belongs to. It is useful, however, to
2954
2969
  understand what actually happens when the binding is activated.
2955
2970
 
2956
2971
  For a binding to function it must have at least a `from` property and a `to`
@@ -3049,7 +3064,6 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
3049
3064
  }
3050
3065
 
3051
3066
  exports.Binding = Binding;
3052
- exports.isGlobalPath = _emberMetalPath_cache.isGlobal;
3053
3067
  });
3054
3068
  // Ember.LOG_BINDINGS
3055
3069
  enifed('ember-metal/cache', ['exports', 'ember-metal/empty_object'], function (exports, _emberMetalEmpty_object) {
@@ -3107,10 +3121,9 @@ enifed('ember-metal/cache', ['exports', 'ember-metal/empty_object'], function (e
3107
3121
  }
3108
3122
  };
3109
3123
  });
3110
- enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/empty_object'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalEmpty_object) {
3124
+ enifed('ember-metal/chains', ['exports', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/empty_object'], function (exports, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalEmpty_object) {
3111
3125
  'use strict';
3112
3126
 
3113
- exports.flushPendingChains = flushPendingChains;
3114
3127
  exports.finishChains = finishChains;
3115
3128
 
3116
3129
  var FIRST_KEY = /^([^\.]+)/;
@@ -3127,9 +3140,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
3127
3140
  return !(isObject(obj) && obj.isDescriptor && obj._volatile === false);
3128
3141
  }
3129
3142
 
3130
- function ChainWatchers(obj) {
3131
- // this obj would be the referencing chain node's parent node's value
3132
- this.obj = obj;
3143
+ function ChainWatchers() {
3133
3144
  // chain nodes that reference a key in this obj by key
3134
3145
  // we only create ChainWatchers when we are going to add them
3135
3146
  // so create this upfront
@@ -3214,29 +3225,8 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
3214
3225
  }
3215
3226
  };
3216
3227
 
3217
- var pendingQueue = [];
3218
-
3219
- // attempts to add the pendingQueue chains again. If some of them end up
3220
- // back in the queue and reschedule is true, schedules a timeout to try
3221
- // again.
3222
-
3223
- function flushPendingChains() {
3224
- if (pendingQueue.length === 0) {
3225
- return;
3226
- }
3227
-
3228
- var queue = pendingQueue;
3229
- pendingQueue = [];
3230
-
3231
- queue.forEach(function (q) {
3232
- return q[0].add(q[1]);
3233
- });
3234
-
3235
- _emberMetalDebug.warn('Watching an undefined global, Ember expects watched globals to be ' + 'setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0, { id: 'ember-metal.chains-flush-pending-chains' });
3236
- }
3237
-
3238
- function makeChainWatcher(obj) {
3239
- return new ChainWatchers(obj);
3228
+ function makeChainWatcher() {
3229
+ return new ChainWatchers();
3240
3230
  }
3241
3231
 
3242
3232
  function addChainWatcher(obj, keyName, node) {
@@ -3359,65 +3349,30 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
3359
3349
  // called on the root node of a chain to setup watchers on the specified
3360
3350
  // path.
3361
3351
  add: function (path) {
3362
- var obj, tuple, key, src, paths;
3363
-
3364
- paths = this._paths;
3352
+ var paths = this._paths;
3365
3353
  paths[path] = (paths[path] || 0) + 1;
3366
3354
 
3367
- obj = this.value();
3368
- tuple = _emberMetalProperty_get.normalizeTuple(obj, path);
3369
-
3370
- // the path was a local path
3371
- if (tuple[0] && tuple[0] === obj) {
3372
- path = tuple[1];
3373
- key = firstKey(path);
3374
- path = path.slice(key.length + 1);
3355
+ var key = firstKey(path);
3356
+ var tail = path.slice(key.length + 1);
3375
3357
 
3376
- // global path, but object does not exist yet.
3377
- // put into a queue and try to connect later.
3378
- } else if (!tuple[0]) {
3379
- pendingQueue.push([this, path]);
3380
- tuple.length = 0;
3381
- return;
3382
-
3383
- // global path, and object already exists
3384
- } else {
3385
- src = tuple[0];
3386
- key = path.slice(0, 0 - (tuple[1].length + 1));
3387
- path = tuple[1];
3388
- }
3389
-
3390
- tuple.length = 0;
3391
- this.chain(key, path, src);
3358
+ this.chain(key, tail);
3392
3359
  },
3393
3360
 
3394
3361
  // called on the root node of a chain to teardown watcher on the specified
3395
3362
  // path
3396
3363
  remove: function (path) {
3397
- var obj, tuple, key, src, paths;
3398
-
3399
- paths = this._paths;
3364
+ var paths = this._paths;
3400
3365
  if (paths[path] > 0) {
3401
3366
  paths[path]--;
3402
3367
  }
3403
3368
 
3404
- obj = this.value();
3405
- tuple = _emberMetalProperty_get.normalizeTuple(obj, path);
3406
- if (tuple[0] === obj) {
3407
- path = tuple[1];
3408
- key = firstKey(path);
3409
- path = path.slice(key.length + 1);
3410
- } else {
3411
- src = tuple[0];
3412
- key = path.slice(0, 0 - (tuple[1].length + 1));
3413
- path = tuple[1];
3414
- }
3369
+ var key = firstKey(path);
3370
+ var tail = path.slice(key.length + 1);
3415
3371
 
3416
- tuple.length = 0;
3417
- this.unchain(key, path);
3372
+ this.unchain(key, tail);
3418
3373
  },
3419
3374
 
3420
- chain: function (key, path, src) {
3375
+ chain: function (key, path) {
3421
3376
  var chains = this._chains;
3422
3377
  var node;
3423
3378
  if (chains === undefined) {
@@ -3427,7 +3382,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
3427
3382
  }
3428
3383
 
3429
3384
  if (node === undefined) {
3430
- node = chains[key] = new ChainNode(this, key, src);
3385
+ node = chains[key] = new ChainNode(this, key, undefined);
3431
3386
  }
3432
3387
 
3433
3388
  node.count++; // count chains...
@@ -3436,7 +3391,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
3436
3391
  if (path) {
3437
3392
  key = firstKey(path);
3438
3393
  path = path.slice(key.length + 1);
3439
- node.chain(key, path); // NOTE: no src means it will observe changes...
3394
+ node.chain(key, path);
3440
3395
  }
3441
3396
  },
3442
3397
 
@@ -3483,25 +3438,21 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
3483
3438
  }
3484
3439
 
3485
3440
  if (affected && this._parent) {
3486
- this._parent.populateAffected(this, this._key, 1, affected);
3441
+ this._parent.populateAffected(this._key, 1, affected);
3487
3442
  }
3488
3443
  },
3489
3444
 
3490
- populateAffected: function (chain, path, depth, affected) {
3445
+ populateAffected: function (path, depth, affected) {
3491
3446
  if (this._key) {
3492
3447
  path = this._key + '.' + path;
3493
3448
  }
3494
3449
 
3495
3450
  if (this._parent) {
3496
- this._parent.populateAffected(this, path, depth + 1, affected);
3451
+ this._parent.populateAffected(path, depth + 1, affected);
3497
3452
  } else {
3498
3453
  if (depth > 1) {
3499
3454
  affected.push(this.value(), path);
3500
3455
  }
3501
- path = 'this.' + path;
3502
- if (this._paths[path] > 0) {
3503
- affected.push(this.value(), path);
3504
- }
3505
3456
  }
3506
3457
  }
3507
3458
  };
@@ -3542,6 +3493,10 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3542
3493
 
3543
3494
  var DEEP_EACH_REGEX = /\.@each\.[^.]+\./;
3544
3495
 
3496
+ // ..........................................................
3497
+ // COMPUTED PROPERTY
3498
+ //
3499
+
3545
3500
  /**
3546
3501
  A computed property transforms an object literal with object's accessor function(s) into a property.
3547
3502
 
@@ -3644,6 +3599,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3644
3599
 
3645
3600
  @class ComputedProperty
3646
3601
  @namespace Ember
3602
+ @constructor
3647
3603
  @public
3648
3604
  */
3649
3605
  function ComputedProperty(config, opts) {
@@ -3802,6 +3758,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3802
3758
  @chainable
3803
3759
  @public
3804
3760
  */
3761
+
3805
3762
  ComputedPropertyPrototype.meta = function (meta) {
3806
3763
  if (arguments.length === 0) {
3807
3764
  return this._meta || {};
@@ -3832,6 +3789,33 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3832
3789
  }
3833
3790
  };
3834
3791
 
3792
+ /**
3793
+ Access the value of the function backing the computed property.
3794
+ If this property has already been cached, return the cached result.
3795
+ Otherwise, call the function passing the property name as an argument.
3796
+
3797
+ ```javascript
3798
+ let Person = Ember.Object.extend({
3799
+ fullName: Ember.computed('firstName', 'lastName', function(keyName) {
3800
+ // the keyName parameter is 'fullName' in this case.
3801
+ return this.get('firstName') + ' ' + this.get('lastName');
3802
+ })
3803
+ });
3804
+
3805
+
3806
+ let tom = Person.create({
3807
+ firstName: 'Tom',
3808
+ lastName: 'Dale'
3809
+ });
3810
+
3811
+ tom.get('fullName') // 'Tom Dale'
3812
+ ```
3813
+
3814
+ @method get
3815
+ @param {String} keyName The key being accessed.
3816
+ @return {Object} The return value of the function backing the CP.
3817
+ @public
3818
+ */
3835
3819
  ComputedPropertyPrototype.get = function (obj, keyName) {
3836
3820
  if (this._volatile) {
3837
3821
  return this._getter.call(obj, keyName);
@@ -3863,6 +3847,54 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3863
3847
  return ret;
3864
3848
  };
3865
3849
 
3850
+ /**
3851
+ Set the value of a computed property. If the function that backs your
3852
+ computed property does not accept arguments then the default action for
3853
+ setting would be to define the property on the current object, and set
3854
+ the value of the property to the value being set.
3855
+
3856
+ Generally speaking if you intend for your computed property to be set
3857
+ you should pass `set(key, value)` function in hash as argument to `Ember.computed()` along with `get(key)` function.
3858
+
3859
+ ```javascript
3860
+ let Person = Ember.Object.extend({
3861
+ // these will be supplied by `create`
3862
+ firstName: null,
3863
+ lastName: null,
3864
+
3865
+ fullName: Ember.computed('firstName', 'lastName', {
3866
+ // getter
3867
+ get() {
3868
+ let firstName = this.get('firstName');
3869
+ let lastName = this.get('lastName');
3870
+
3871
+ return firstName + ' ' + lastName;
3872
+ },
3873
+ // setter
3874
+ set(key, value) {
3875
+ let [firstName, lastName] = value.split(' ');
3876
+
3877
+ this.set('firstName', firstName);
3878
+ this.set('lastName', lastName);
3879
+
3880
+ return value;
3881
+ }
3882
+ })
3883
+ });
3884
+
3885
+ let person = Person.create();
3886
+
3887
+ person.set('fullName', 'Peter Wagenet');
3888
+ person.get('firstName'); // 'Peter'
3889
+ person.get('lastName'); // 'Wagenet'
3890
+ ```
3891
+
3892
+ @method set
3893
+ @param {String} keyName The key being accessed.
3894
+ @param {Object} newValue The new value being assigned.
3895
+ @return {Object} The return value of the function backing the CP.
3896
+ @public
3897
+ */
3866
3898
  ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) {
3867
3899
  if (this._readOnly) {
3868
3900
  this._throwReadOnlyError(obj, keyName);
@@ -4006,7 +4038,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
4006
4038
  this.lastName = 'Jones';
4007
4039
  },
4008
4040
 
4009
- fullName: Ember.computed('firstName', 'lastName', {
4041
+ fullName: Ember.computed({
4010
4042
  get(key) {
4011
4043
  return `${this.get('firstName')} ${this.get('lastName')}`;
4012
4044
  },
@@ -4784,6 +4816,8 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
4784
4816
  Ember may overwrite this namespace and therefore, you should avoid adding any
4785
4817
  new properties.
4786
4818
 
4819
+ You can also use the shorthand `Em` instead of `Ember`.
4820
+
4787
4821
  At the heart of Ember is Ember-Runtime, a set of core functions that provide
4788
4822
  cross-platform compatibility and object property observing. Ember-Runtime is
4789
4823
  small and performance-focused so you can use it alongside other
@@ -4792,7 +4826,7 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
4792
4826
 
4793
4827
  @class Ember
4794
4828
  @static
4795
- @version 2.4.6
4829
+ @version 2.5.0-beta.1
4796
4830
  @public
4797
4831
  */
4798
4832
 
@@ -4834,11 +4868,11 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
4834
4868
 
4835
4869
  @property VERSION
4836
4870
  @type String
4837
- @default '2.4.6'
4871
+ @default '2.5.0-beta.1'
4838
4872
  @static
4839
4873
  @public
4840
4874
  */
4841
- Ember.VERSION = '2.4.6';
4875
+ Ember.VERSION = '2.5.0-beta.1';
4842
4876
 
4843
4877
  /**
4844
4878
  The hash of environment variables used to control various configuration
@@ -5569,7 +5603,7 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
5569
5603
  return func;
5570
5604
  }
5571
5605
  });
5572
- enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) {
5606
+ enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) {
5573
5607
  'use strict';
5574
5608
 
5575
5609
  exports.default = expandProperties;
@@ -5580,7 +5614,6 @@ enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], functi
5580
5614
  */
5581
5615
 
5582
5616
  var SPLIT_REGEX = /\{|\}/;
5583
-
5584
5617
  var END_WITH_EACH_REGEX = /\.@each$/;
5585
5618
 
5586
5619
  /**
@@ -5612,25 +5645,21 @@ enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], functi
5612
5645
  */
5613
5646
 
5614
5647
  function expandProperties(pattern, callback) {
5615
- if (pattern.indexOf(' ') > -1) {
5616
- throw new _emberMetalError.default('Brace expanded properties cannot contain spaces, e.g. \'user.{firstName, lastName}\' should be \'user.{firstName,lastName}\'');
5617
- }
5648
+ _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string');
5649
+ _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1);
5618
5650
 
5619
- if ('string' === typeof pattern) {
5620
- var parts = pattern.split(SPLIT_REGEX);
5621
- var properties = [parts];
5651
+ var parts = pattern.split(SPLIT_REGEX);
5652
+ var properties = [parts];
5622
5653
 
5623
- parts.forEach(function (part, index) {
5624
- if (part.indexOf(',') >= 0) {
5625
- properties = duplicateAndReplace(properties, part.split(','), index);
5626
- }
5627
- });
5654
+ for (var i = 0; i < parts.length; i++) {
5655
+ var part = parts[i];
5656
+ if (part.indexOf(',') >= 0) {
5657
+ properties = duplicateAndReplace(properties, part.split(','), i);
5658
+ }
5659
+ }
5628
5660
 
5629
- properties.forEach(function (property) {
5630
- callback(property.join('').replace(END_WITH_EACH_REGEX, '.[]'));
5631
- });
5632
- } else {
5633
- callback(pattern.replace(END_WITH_EACH_REGEX, '.[]'));
5661
+ for (var i = 0; i < properties.length; i++) {
5662
+ callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]'));
5634
5663
  }
5635
5664
  }
5636
5665
 
@@ -5666,11 +5695,9 @@ enifed('ember-metal/features', ['exports', 'ember-metal/core', 'ember-metal/assi
5666
5695
  @since 1.1.0
5667
5696
  @public
5668
5697
  */
5669
- var KNOWN_FEATURES = {};exports.KNOWN_FEATURES = KNOWN_FEATURES;
5698
+ var FEATURES = _emberMetalAssign.default({}, _emberMetalCore.default.ENV.FEATURES);exports.FEATURES = FEATURES;
5670
5699
  // jshint ignore:line
5671
- var FEATURES = _emberMetalAssign.default(KNOWN_FEATURES, _emberMetalCore.default.ENV.FEATURES);
5672
5700
 
5673
- exports.FEATURES = FEATURES;
5674
5701
  /**
5675
5702
  Determine whether the specified `feature` is enabled. Used by Ember's
5676
5703
  build tools to exclude experimental features from beta/stable builds.
@@ -5744,7 +5771,7 @@ enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], fu
5744
5771
  return ret;
5745
5772
  }
5746
5773
  });
5747
- enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/logger', 'ember-metal/property_get', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/property_set', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/computed_macros', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/libraries', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'backburner'], function (exports, _require, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalAssign, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner) {
5774
+ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/logger', 'ember-metal/property_get', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/property_set', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/computed_macros', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/run_loop', 'ember-metal/libraries', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'backburner'], function (exports, _require, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalAssign, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner) {
5748
5775
  /**
5749
5776
  @module ember
5750
5777
  @submodule ember-metal
@@ -5814,7 +5841,6 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
5814
5841
 
5815
5842
  _emberMetalCore.default.get = _emberMetalProperty_get.get;
5816
5843
  _emberMetalCore.default.getWithDefault = _emberMetalProperty_get.getWithDefault;
5817
- _emberMetalCore.default.normalizeTuple = _emberMetalProperty_get.normalizeTuple;
5818
5844
  _emberMetalCore.default._getPath = _emberMetalProperty_get._getPath;
5819
5845
 
5820
5846
  _emberMetalCore.default.on = _emberMetalEvents.on;
@@ -5852,7 +5878,6 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
5852
5878
  _emberMetalCore.default.watchKey = _emberMetalWatch_key.watchKey;
5853
5879
  _emberMetalCore.default.unwatchKey = _emberMetalWatch_key.unwatchKey;
5854
5880
 
5855
- _emberMetalCore.default.flushPendingChains = _emberMetalChains.flushPendingChains;
5856
5881
  _emberMetalCore.default.removeChainWatcher = _emberMetalChains.removeChainWatcher;
5857
5882
  _emberMetalCore.default._ChainNode = _emberMetalChains.ChainNode;
5858
5883
  _emberMetalCore.default.finishChains = _emberMetalChains.finishChains;
@@ -5888,7 +5913,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
5888
5913
 
5889
5914
  _emberMetalCore.default.bind = _emberMetalBinding.bind;
5890
5915
  _emberMetalCore.default.Binding = _emberMetalBinding.Binding;
5891
- _emberMetalCore.default.isGlobalPath = _emberMetalBinding.isGlobalPath;
5916
+ _emberMetalCore.default.isGlobalPath = _emberMetalPath_cache.isGlobalPath;
5892
5917
 
5893
5918
  _emberMetalCore.default.run = _emberMetalRun_loop.default;
5894
5919
 
@@ -5958,6 +5983,10 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
5958
5983
  }
5959
5984
  }
5960
5985
 
5986
+ _emberMetalDebug.deprecate('Support for the `ember-legacy-views` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { id: 'ember-legacy-views', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' });
5987
+
5988
+ _emberMetalDebug.deprecate('Support for the `ember-legacy-controllers` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_CONTROLLER_SUPPORT, { id: 'ember-legacy-controllers', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_objectcontroller' });
5989
+
5961
5990
  _emberMetalCore.default.create = _emberMetalDebug.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create);
5962
5991
  _emberMetalCore.default.keys = _emberMetalDebug.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys);
5963
5992
 
@@ -9023,9 +9052,9 @@ enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/f
9023
9052
  Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');
9024
9053
 
9025
9054
  // define a computed property
9026
- Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() {
9055
+ Ember.defineProperty(contact, 'fullName', Ember.computed(function() {
9027
9056
  return this.firstName+' '+this.lastName;
9028
- }));
9057
+ }).property('firstName', 'lastName'));
9029
9058
  ```
9030
9059
 
9031
9060
  @private
@@ -9413,7 +9442,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-me
9413
9442
  exports.endPropertyChanges = endPropertyChanges;
9414
9443
  exports.changeProperties = changeProperties;
9415
9444
  });
9416
- enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/error', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalDebug, _emberMetalError, _emberMetalPath_cache) {
9445
+ enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) {
9417
9446
  /**
9418
9447
  @module ember-metal
9419
9448
  */
@@ -9421,12 +9450,9 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
9421
9450
  'use strict';
9422
9451
 
9423
9452
  exports.get = get;
9424
- exports.normalizeTuple = normalizeTuple;
9425
9453
  exports._getPath = _getPath;
9426
9454
  exports.getWithDefault = getWithDefault;
9427
9455
 
9428
- var FIRST_KEY = /^([^\.]+)/;
9429
-
9430
9456
  // ..........................................................
9431
9457
  // GET AND SET
9432
9458
  //
@@ -9492,77 +9518,24 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
9492
9518
  }
9493
9519
  }
9494
9520
 
9495
- /**
9496
- Normalizes a target/path pair to reflect that actual target/path that should
9497
- be observed, etc. This takes into account passing in global property
9498
- paths (i.e. a path beginning with a capital letter not defined on the
9499
- target).
9500
-
9501
- @private
9502
- @method normalizeTuple
9503
- @for Ember
9504
- @param {Object} target The current target. May be `null`.
9505
- @param {String} path A path on the target or a global property path.
9506
- @return {Array} a temporary array with the normalized target/path pair.
9507
- */
9508
-
9509
- function normalizeTuple(target, path) {
9510
- var hasThis = _emberMetalPath_cache.hasThis(path);
9511
- var isGlobal = !hasThis && _emberMetalPath_cache.isGlobal(path);
9512
- var key;
9513
-
9514
- if (!target && !isGlobal) {
9515
- return [undefined, ''];
9516
- }
9517
-
9518
- if (hasThis) {
9519
- path = path.slice(5);
9520
- }
9521
-
9522
- if (!target || isGlobal) {
9523
- target = _emberMetalCore.default.lookup;
9524
- }
9525
-
9526
- if (isGlobal && _emberMetalPath_cache.isPath(path)) {
9527
- key = path.match(FIRST_KEY)[0];
9528
- target = get(target, key);
9529
- path = path.slice(key.length + 1);
9530
- }
9531
-
9532
- // must return some kind of path to be valid else other things will break.
9533
- validateIsPath(path);
9534
-
9535
- return [target, path];
9536
- }
9537
-
9538
- function validateIsPath(path) {
9539
- if (!path || path.length === 0) {
9540
- throw new _emberMetalError.default('Object in path ' + path + ' could not be found or was destroyed.');
9541
- }
9542
- }
9543
-
9544
9521
  function _getPath(root, path) {
9545
- var hasThis, parts, tuple, idx, len;
9522
+ var obj = root;
9523
+ var parts = path.split('.');
9524
+ var len = parts.length;
9546
9525
 
9547
- // detect complicated paths and normalize them
9548
- hasThis = _emberMetalPath_cache.hasThis(path);
9526
+ for (var i = 0; i < len; i++) {
9527
+ if (obj == null) {
9528
+ return obj;
9529
+ }
9549
9530
 
9550
- if (!root || hasThis) {
9551
- tuple = normalizeTuple(root, path);
9552
- root = tuple[0];
9553
- path = tuple[1];
9554
- tuple.length = 0;
9555
- }
9531
+ obj = get(obj, parts[i]);
9556
9532
 
9557
- parts = path.split('.');
9558
- len = parts.length;
9559
- for (idx = 0; root != null && idx < len; idx++) {
9560
- root = get(root, parts[idx]);
9561
- if (root && root.isDestroyed) {
9533
+ if (obj && obj.isDestroyed) {
9562
9534
  return undefined;
9563
9535
  }
9564
9536
  }
9565
- return root;
9537
+
9538
+ return obj;
9566
9539
  }
9567
9540
 
9568
9541
  /**
@@ -9632,7 +9605,7 @@ enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal
9632
9605
  return setPath(obj, keyName, value, tolerant);
9633
9606
  }
9634
9607
 
9635
- _emberMetalDebug.assert('calling set on destroyed object', !obj.isDestroyed);
9608
+ _emberMetalDebug.assert('calling set on destroyed object: ' + _emberMetalUtils.toString(obj) + '.' + keyName + ' = ' + _emberMetalUtils.toString(value), !obj.isDestroyed);
9636
9609
 
9637
9610
  if (desc) {
9638
9611
  desc.set(obj, keyName, value);
@@ -11129,13 +11102,13 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11129
11102
  exports.setValue = setValue;
11130
11103
 
11131
11104
  /*
11132
- Check whether an object is a stream or not
11105
+ Check whether an object is a stream or not.
11133
11106
 
11134
11107
  @private
11135
11108
  @for Ember.stream
11136
11109
  @function isStream
11137
- @param {Object|Stream} object object to check whether it is a stream
11138
- @return {Boolean} `true` if the object is a stream, `false` otherwise
11110
+ @param {Object|Stream} object Object to check whether it is a stream.
11111
+ @return {Boolean} `true` if the object is a stream, `false` otherwise.
11139
11112
  */
11140
11113
 
11141
11114
  function isStream(object) {
@@ -11149,10 +11122,10 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11149
11122
  @public
11150
11123
  @for Ember.stream
11151
11124
  @function subscribe
11152
- @param {Object|Stream} object object or stream to potentially subscribe to
11153
- @param {Function} callback function to run when stream value changes
11125
+ @param {Object|Stream} object Object or stream to potentially subscribe to.
11126
+ @param {Function} callback Function to run when stream value changes.
11154
11127
  @param {Object} [context] the callback will be executed with this context if it
11155
- is provided
11128
+ is provided.
11156
11129
  */
11157
11130
 
11158
11131
  function subscribe(object, callback, context) {
@@ -11168,9 +11141,9 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11168
11141
  @private
11169
11142
  @for Ember.stream
11170
11143
  @function unsubscribe
11171
- @param {Object|Stream} object object or stream to potentially unsubscribe from
11172
- @param {Function} callback function originally passed to `subscribe()`
11173
- @param {Object} [context] object originally passed to `subscribe()`
11144
+ @param {Object|Stream} object Object or stream to potentially unsubscribe from.
11145
+ @param {Function} callback Function originally passed to `subscribe()`.
11146
+ @param {Object} [context] Object originally passed to `subscribe()`.
11174
11147
  */
11175
11148
 
11176
11149
  function unsubscribe(object, callback, context) {
@@ -11180,14 +11153,14 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11180
11153
  }
11181
11154
 
11182
11155
  /*
11183
- Retrieve the value of a stream, or in the case a non-stream object is passed,
11156
+ Retrieve the value of a stream, or in the case where a non-stream object is passed,
11184
11157
  return the object itself.
11185
11158
 
11186
11159
  @private
11187
11160
  @for Ember.stream
11188
11161
  @function read
11189
- @param {Object|Stream} object object to return the value of
11190
- @return the stream's current value, or the non-stream object itself
11162
+ @param {Object|Stream} object Object to return the value of.
11163
+ @return The stream's current value, or the non-stream object itself.
11191
11164
  */
11192
11165
 
11193
11166
  function read(object) {
@@ -11205,7 +11178,7 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11205
11178
  @for Ember.stream
11206
11179
  @function readArray
11207
11180
  @param {Array} array The array to read values from
11208
- @return {Array} a new array of the same length with the values of non-stream
11181
+ @return {Array} A new array of the same length with the values of non-stream
11209
11182
  objects mapped from their original positions untouched, and
11210
11183
  the values of stream objects retaining their original position
11211
11184
  and replaced with the stream's current value.
@@ -11227,8 +11200,8 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11227
11200
  @private
11228
11201
  @for Ember.stream
11229
11202
  @function readHash
11230
- @param {Object} object The hash to read keys and values from
11231
- @return {Object} a new object with the same keys as the passed object. The
11203
+ @param {Object} object The hash to read keys and values from.
11204
+ @return {Object} A new object with the same keys as the passed object. The
11232
11205
  property values in the new object are the original values in
11233
11206
  the case of non-stream objects, and the streams' current
11234
11207
  values in the case of stream objects.
@@ -11243,14 +11216,14 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11243
11216
  }
11244
11217
 
11245
11218
  /*
11246
- Check whether an array contains any stream values
11219
+ Check whether an array contains any stream values.
11247
11220
 
11248
11221
  @private
11249
11222
  @for Ember.stream
11250
11223
  @function scanArray
11251
- @param {Array} array array given to a handlebars helper
11224
+ @param {Array} array Array given to a handlebars helper.
11252
11225
  @return {Boolean} `true` if the array contains a stream/bound value, `false`
11253
- otherwise
11226
+ otherwise.
11254
11227
  */
11255
11228
 
11256
11229
  function scanArray(array) {
@@ -11268,14 +11241,14 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11268
11241
  }
11269
11242
 
11270
11243
  /*
11271
- Check whether a hash has any stream property values
11244
+ Check whether a hash has any stream property values.
11272
11245
 
11273
11246
  @private
11274
11247
  @for Ember.stream
11275
11248
  @function scanHash
11276
- @param {Object} hash "hash" argument given to a handlebars helper
11249
+ @param {Object} hash "hash" argument given to a handlebars helper.
11277
11250
  @return {Boolean} `true` if the object contains a stream/bound value, `false`
11278
- otherwise
11251
+ otherwise.
11279
11252
  */
11280
11253
 
11281
11254
  function scanHash(hash) {
@@ -11296,8 +11269,8 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11296
11269
  this.array = array;
11297
11270
  this.separator = separator;
11298
11271
 
11299
- // used by angle bracket components to detect an attribute was provided
11300
- // as a string literal
11272
+ // Used by angle bracket components to detect an attribute was provided
11273
+ // as a string literal.
11301
11274
  this.isConcat = true;
11302
11275
  },
11303
11276
 
@@ -11312,17 +11285,17 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11312
11285
  });
11313
11286
 
11314
11287
  /*
11315
- Join an array, with any streams replaced by their current values
11288
+ Join an array, with any streams replaced by their current values.
11316
11289
 
11317
11290
  @private
11318
11291
  @for Ember.stream
11319
11292
  @function concat
11320
11293
  @param {Array} array An array containing zero or more stream objects and
11321
- zero or more non-stream objects
11322
- @param {String} separator string to be used to join array elements
11294
+ zero or more non-stream objects.
11295
+ @param {String} separator String to be used to join array elements.
11323
11296
  @return {String} String with array elements concatenated and joined by the
11324
11297
  provided separator, and any stream array members having been
11325
- replaced by the current value of the stream
11298
+ replaced by the current value of the stream.
11326
11299
  */
11327
11300
 
11328
11301
  function concat(array, separator) {
@@ -11462,9 +11435,9 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
11462
11435
  @private
11463
11436
  @for Ember.stream
11464
11437
  @function chain
11465
- @param {Object|Stream} value A stream or non-stream object
11466
- @param {Function} fn function to be run when the stream value changes, or to
11467
- be run once in the case of a non-stream object
11438
+ @param {Object|Stream} value A stream or non-stream object.
11439
+ @param {Function} fn Function to be run when the stream value changes, or to
11440
+ be run once in the case of a non-stream object.
11468
11441
  @return {Object|Stream} In the case of a stream `value` parameter, a new
11469
11442
  stream that will be updated with the return value of
11470
11443
  the provided function `fn`. In the case of a
@@ -11531,6 +11504,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
11531
11504
  exports.apply = apply;
11532
11505
  exports.applyStr = applyStr;
11533
11506
  exports.lookupDescriptor = lookupDescriptor;
11507
+ exports.toString = toString;
11534
11508
  var _uuid = 0;
11535
11509
 
11536
11510
  /**
@@ -11915,7 +11889,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
11915
11889
  // TYPING & ARRAY MESSAGING
11916
11890
  //
11917
11891
 
11918
- var toString = Object.prototype.toString;
11892
+ var objectToString = Object.prototype.toString;
11919
11893
 
11920
11894
  /**
11921
11895
  Forces the passed object to be part of an array. If the object is already
@@ -11979,7 +11953,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
11979
11953
  return '' + obj;
11980
11954
  }
11981
11955
  // overridden toString
11982
- if (typeof obj.toString === 'function' && obj.toString !== toString) {
11956
+ if (typeof obj.toString === 'function' && obj.toString !== objectToString) {
11983
11957
  return obj.toString();
11984
11958
  }
11985
11959
 
@@ -11997,7 +11971,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
11997
11971
  }
11998
11972
 
11999
11973
  if (v && typeof v.toString !== 'function') {
12000
- ret.push(key + ': ' + toString.call(v));
11974
+ ret.push(key + ': ' + objectToString.call(v));
12001
11975
  } else {
12002
11976
  ret.push(key + ': ' + v);
12003
11977
  }
@@ -12079,6 +12053,17 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
12079
12053
  return null;
12080
12054
  }
12081
12055
 
12056
+ // A `toString` util function that supports objects without a `toString`
12057
+ // method, e.g. an object created with `Object.create(null)`.
12058
+
12059
+ function toString(obj) {
12060
+ if (obj && obj.toString) {
12061
+ return obj.toString();
12062
+ } else {
12063
+ return objectToString.call(obj);
12064
+ }
12065
+ }
12066
+
12082
12067
  exports.GUID_KEY = GUID_KEY;
12083
12068
  exports.makeArray = makeArray;
12084
12069
  exports.canInvoke = canInvoke;
@@ -12304,8 +12289,6 @@ enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/wa
12304
12289
  return meta && meta.peekWatching(key) || 0;
12305
12290
  }
12306
12291
 
12307
- watch.flushPending = _emberMetalChains.flushPendingChains;
12308
-
12309
12292
  function unwatch(obj, _keyPath, m) {
12310
12293
  // can't watch length on Array - it is special...
12311
12294
  if (_keyPath === 'length' && Array.isArray(obj)) {
@@ -12575,7 +12558,18 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim
12575
12558
  return spaceship(v, w);
12576
12559
 
12577
12560
  case 'string':
12578
- return spaceship(v.localeCompare(w), 0);
12561
+ // We are comparing Strings using operators instead of `String#localeCompare`
12562
+ // because of unexpected behavior for certain edge cases.
12563
+ // For example `'Z'.localeCompare('a')` returns `1`.
12564
+ //
12565
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare#Description
12566
+ if (v < w) {
12567
+ return -1;
12568
+ } else if (v === w) {
12569
+ return 0;
12570
+ }
12571
+
12572
+ return 1;
12579
12573
 
12580
12574
  case 'array':
12581
12575
  var vLen = v.length;
@@ -14894,19 +14888,8 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
14894
14888
  on the array. Just get an equivalent property on this object and it will
14895
14889
  return an enumerable that maps automatically to the named key on the
14896
14890
  member objects.
14897
- `@each` should only be used in a non-terminal context. Example:
14898
- ```javascript
14899
- myMethod: computed('posts.@each.author', function(){
14900
- ...
14901
- });
14902
- ```
14903
- If you merely want to watch for the array being changed, like an object being
14904
- replaced, added or removed, use `[]` instead of `@each`.
14905
- ```javascript
14906
- myMethod: computed('posts.[]', function(){
14907
- ...
14908
- });
14909
- ```
14891
+ If you merely want to watch for any items being added or removed to the array,
14892
+ use the `[]` property instead of `@each`.
14910
14893
  @property @each
14911
14894
  @public
14912
14895
  */
@@ -15363,7 +15346,6 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get'
15363
15346
  ```
15364
15347
  @property firstObject
15365
15348
  @return {Object} the object or undefined
15366
- @readOnly
15367
15349
  @public
15368
15350
  */
15369
15351
  firstObject: _emberMetalComputed.computed('[]', function () {
@@ -15392,7 +15374,6 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get'
15392
15374
  ```
15393
15375
  @property lastObject
15394
15376
  @return {Object} the last object or undefined
15395
- @readOnly
15396
15377
  @public
15397
15378
  */
15398
15379
  lastObject: _emberMetalComputed.computed('[]', function () {
@@ -17920,8 +17901,9 @@ enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-metal/co
17920
17901
  @return {Boolean} true if the action was sent successfully and did not return false
17921
17902
  @private
17922
17903
  */
17923
- triggerAction: function (opts) {
17924
- opts = opts || {};
17904
+ triggerAction: function () {
17905
+ var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
17906
+
17925
17907
  var action = opts.action || _emberMetalProperty_get.get(this, 'action');
17926
17908
  var target = opts.target || _emberMetalProperty_get.get(this, 'targetObject');
17927
17909
  var actionContext = opts.actionContext;
@@ -18465,7 +18447,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal/debug', 'emb
18465
18447
  if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) {
18466
18448
  var originalValue = this[keyName];
18467
18449
 
18468
- value = _emberMetalAssign.default({}, originalValue, value);
18450
+ value = _emberMetalAssign.default(originalValue, value);
18469
18451
  }
18470
18452
 
18471
18453
  if (desc) {
@@ -19758,14 +19740,14 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'emb
19758
19740
  if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.Array) {
19759
19741
  NativeArray.apply(Array.prototype);
19760
19742
  exports. // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles
19761
- A = A = function (arr) {
19762
- return arr || [];
19743
+ A = A = function () {
19744
+ var arr = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
19745
+ return arr;
19763
19746
  };
19764
19747
  } else {
19765
- exports.A = A = function (arr) {
19766
- if (arr === undefined) {
19767
- arr = [];
19768
- }
19748
+ exports.A = A = function () {
19749
+ var arr = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
19750
+
19769
19751
  return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr);
19770
19752
  };
19771
19753
  }
@@ -21744,6 +21726,8 @@ enifed('rsvp/node', ['exports', 'rsvp/promise', 'rsvp/-internal', 'rsvp/utils'],
21744
21726
 
21745
21727
  exports.default = denodeify;
21746
21728
 
21729
+ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
21730
+
21747
21731
  function Result() {
21748
21732
  this.value = undefined;
21749
21733
  }
@@ -21974,7 +21958,7 @@ enifed('rsvp/node', ['exports', 'rsvp/promise', 'rsvp/-internal', 'rsvp/utils'],
21974
21958
  }
21975
21959
  };
21976
21960
 
21977
- fn.__proto__ = nodeFunc;
21961
+ _defaults(fn, nodeFunc);
21978
21962
 
21979
21963
  return fn;
21980
21964
  }