ember-source 1.9.1 → 1.10.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ember-source might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83ee192c23c80bc7f965ca53c3ccc7db0c4904da
4
- data.tar.gz: 07d2fca0d32dc20170ba591f488b298d52368f7e
3
+ metadata.gz: 5e4c5359d10304310ca5519bd49ea188fc61bc82
4
+ data.tar.gz: 44f6da92b4b1b287c252f4f36e8bca279890c7bf
5
5
  SHA512:
6
- metadata.gz: b8b71dcc9d2667cf2c559dd70b44e8d7e59b7a9759bc0868e3a5dd19194d400b85c6abeb86ce9a4af54a1a43cc77352ea8b1fc70efa90951ca3fecb3b7e88f28
7
- data.tar.gz: fc80c14a5c87b591c34323b0a22b44245acc2585ac2b311f25658e3cd089bb62c1aa606e2fdf2a918fcad0c6db274de1e0654ade335c9c677ab2eddfaa9b6d26
6
+ metadata.gz: c26640239bfd200a8375239c098658b6f4f05ac15265872097c3010ca92b7dac2a1b1b8ccb23a509fd8ef1627a8e6bcb6f42d6c75483c48e2630279c23b17aea
7
+ data.tar.gz: 032900a90d19d5df14476814357441a8d64017fd40f1385c6e7219c829dac96451663819cb11c1beb984d42ac73a55592c6e8c95dc9dec8688f042e6f35c43a0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.1
1
+ 1.10.0-beta.1
@@ -5,7 +5,7 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 1.9.1
8
+ * @version 1.10.0-beta.1
9
9
  */
10
10
 
11
11
  (function() {
@@ -32,7 +32,7 @@ var define, requireModule, require, requirejs, Ember;
32
32
  seen[name] = {};
33
33
 
34
34
  if (!registry[name]) {
35
- throw new Error("Could not find module " + name);
35
+ throw new Error('Could not find module ' + name);
36
36
  }
37
37
 
38
38
  var mod = registry[name];
@@ -56,9 +56,11 @@ var define, requireModule, require, requirejs, Ember;
56
56
  };
57
57
 
58
58
  function resolve(child, name) {
59
- if (child.charAt(0) !== '.') { return child; }
60
- var parts = child.split("/");
61
- var parentBase = name.split("/").slice(0, -1);
59
+ if (child.charAt(0) !== '.') {
60
+ return child;
61
+ }
62
+ var parts = child.split('/');
63
+ var parentBase = name.split('/').slice(0, -1);
62
64
 
63
65
  for (var i=0, l=parts.length; i<l; i++) {
64
66
  var part = parts[i];
@@ -68,12 +70,16 @@ var define, requireModule, require, requirejs, Ember;
68
70
  else { parentBase.push(part); }
69
71
  }
70
72
 
71
- return parentBase.join("/");
73
+ return parentBase.join('/');
72
74
  }
73
75
 
74
76
  requirejs._eak_seen = registry;
75
77
 
76
- Ember.__loader = {define: define, require: require, registry: registry};
78
+ Ember.__loader = {
79
+ define: define,
80
+ require: require,
81
+ registry: registry
82
+ };
77
83
  } else {
78
84
  define = Ember.__loader.define;
79
85
  requirejs = require = requireModule = Ember.__loader.require;
@@ -1118,6 +1124,9 @@ define("container/container",
1118
1124
  this.typeInjections = dictionary(parent ? parent.typeInjections : null);
1119
1125
  this.injections = dictionary(null);
1120
1126
  this.normalizeCache = dictionary(null);
1127
+
1128
+ this.validationCache = dictionary(parent ? parent.validationCache : null);
1129
+
1121
1130
 
1122
1131
  this.factoryTypeInjections = dictionary(parent ? parent.factoryTypeInjections : null);
1123
1132
  this.factoryInjections = dictionary(null);
@@ -1264,6 +1273,9 @@ define("container/container",
1264
1273
  delete this.factoryCache[normalizedName];
1265
1274
  delete this.resolveCache[normalizedName];
1266
1275
  delete this._options[normalizedName];
1276
+
1277
+ delete this.validationCache[normalizedName];
1278
+
1267
1279
  },
1268
1280
 
1269
1281
  /**
@@ -1827,6 +1839,10 @@ define("container/container",
1827
1839
 
1828
1840
  var type = fullName.split(':')[0];
1829
1841
  if (!factory || typeof factory.extend !== 'function' || (!Ember.MODEL_FACTORY_INJECTIONS && type === 'model')) {
1842
+ if (factory && typeof factory._onLookup === 'function') {
1843
+ factory._onLookup(fullName);
1844
+ }
1845
+
1830
1846
  // TODO: think about a 'safe' merge style extension
1831
1847
  // for now just fallback to create time injection
1832
1848
  cache[fullName] = factory;
@@ -1840,6 +1856,10 @@ define("container/container",
1840
1856
  var injectedFactory = factory.extend(injections);
1841
1857
  injectedFactory.reopenClass(factoryInjections);
1842
1858
 
1859
+ if (factory && typeof factory._onLookup === 'function') {
1860
+ factory._onLookup(fullName);
1861
+ }
1862
+
1843
1863
  cache[fullName] = injectedFactory;
1844
1864
 
1845
1865
  return injectedFactory;
@@ -1891,7 +1911,7 @@ define("container/container",
1891
1911
 
1892
1912
  function instantiate(container, fullName) {
1893
1913
  var factory = factoryFor(container, fullName);
1894
- var lazyInjections;
1914
+ var lazyInjections, validationCache;
1895
1915
 
1896
1916
  if (option(container, fullName, 'instantiate') === false) {
1897
1917
  return factory;
@@ -1904,6 +1924,18 @@ define("container/container",
1904
1924
  }
1905
1925
 
1906
1926
 
1927
+ validationCache = container.validationCache;
1928
+
1929
+ // Ensure that all lazy injections are valid at instantiation time
1930
+ if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') {
1931
+ lazyInjections = factory._lazyInjections();
1932
+
1933
+ validateInjections(container, normalizeInjectionsHash(lazyInjections));
1934
+ }
1935
+
1936
+ validationCache[fullName] = true;
1937
+
1938
+
1907
1939
  if (typeof factory.extend === 'function') {
1908
1940
  // assume the factory was extendable and is already injected
1909
1941
  return factory.create();
@@ -2029,11 +2061,10 @@ define("ember-metal",
2029
2061
  var getWithDefault = __dependency11__.getWithDefault;
2030
2062
  var normalizeTuple = __dependency11__.normalizeTuple;
2031
2063
 
2064
+ var accumulateListeners = __dependency12__.accumulateListeners;
2032
2065
  var addListener = __dependency12__.addListener;
2033
2066
  var hasListeners = __dependency12__.hasListeners;
2034
- var listenersDiff = __dependency12__.listenersDiff;
2035
2067
  var listenersFor = __dependency12__.listenersFor;
2036
- var listenersUnion = __dependency12__.listenersUnion;
2037
2068
  var on = __dependency12__.on;
2038
2069
  var removeListener = __dependency12__.removeListener;
2039
2070
  var sendEvent = __dependency12__.sendEvent;
@@ -2103,7 +2134,7 @@ define("ember-metal",
2103
2134
  var isGlobalPath = __dependency29__.isGlobalPath;
2104
2135
  var oneWay = __dependency29__.oneWay;
2105
2136
  var run = __dependency30__["default"];
2106
- var libraries = __dependency31__["default"];
2137
+ var Libraries = __dependency31__["default"];
2107
2138
  var isNone = __dependency32__["default"];
2108
2139
  var isEmpty = __dependency33__["default"];
2109
2140
  var isBlank = __dependency34__["default"];
@@ -2170,17 +2201,16 @@ define("ember-metal",
2170
2201
 
2171
2202
  Ember.EnumerableUtils = EnumerableUtils;
2172
2203
 
2173
- Ember.on = on;
2174
- Ember.addListener = addListener;
2175
- Ember.removeListener = removeListener;
2176
- Ember._suspendListener = suspendListener;
2177
- Ember._suspendListeners = suspendListeners;
2178
- Ember.sendEvent = sendEvent;
2179
- Ember.hasListeners = hasListeners;
2180
- Ember.watchedEvents = watchedEvents;
2181
- Ember.listenersFor = listenersFor;
2182
- Ember.listenersDiff = listenersDiff;
2183
- Ember.listenersUnion = listenersUnion;
2204
+ Ember.on = on;
2205
+ Ember.addListener = addListener;
2206
+ Ember.removeListener = removeListener;
2207
+ Ember._suspendListener = suspendListener;
2208
+ Ember._suspendListeners = suspendListeners;
2209
+ Ember.sendEvent = sendEvent;
2210
+ Ember.hasListeners = hasListeners;
2211
+ Ember.watchedEvents = watchedEvents;
2212
+ Ember.listenersFor = listenersFor;
2213
+ Ember.accumulateListeners = accumulateListeners;
2184
2214
 
2185
2215
  Ember._ObserverSet = ObserverSet;
2186
2216
 
@@ -2254,7 +2284,7 @@ define("ember-metal",
2254
2284
 
2255
2285
  Ember.run = run;
2256
2286
 
2257
- Ember.libraries = libraries;
2287
+ Ember.libraries = new Libraries();
2258
2288
  Ember.libraries.registerCoreLibrary('Ember', Ember.VERSION);
2259
2289
 
2260
2290
  Ember.isNone = isNone;
@@ -3484,9 +3514,6 @@ define("ember-metal/computed",
3484
3514
  @module ember-metal
3485
3515
  */
3486
3516
 
3487
- Ember.warn("The CP_DEFAULT_CACHEABLE flag has been removed and computed properties" +
3488
- "are always cached by default. Use `volatile` if you don't want caching.", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);
3489
-
3490
3517
  var metaFor = meta;
3491
3518
  var a_slice = [].slice;
3492
3519
 
@@ -3585,9 +3612,11 @@ define("ember-metal/computed",
3585
3612
  this._suspended = undefined;
3586
3613
  this._meta = undefined;
3587
3614
 
3588
- this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;
3615
+ Ember.deprecate("Passing opts.cacheable to the CP constructor is deprecated. Invoke `volatile()` on the CP instead.", !opts || !opts.hasOwnProperty('cacheable'));
3616
+ this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true; // TODO: Set always to `true` once this deprecation is gone.
3589
3617
  this._dependentKeys = opts && opts.dependentKeys;
3590
- this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false;
3618
+ Ember.deprecate("Passing opts.readOnly to the CP constructor is deprecated. All CPs are writable by default. Yo can invoke `readOnly()` on the CP to change this.", !opts || !opts.hasOwnProperty('readOnly'));
3619
+ this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false; // TODO: Set always to `false` once this deprecation is gone.
3591
3620
  }
3592
3621
 
3593
3622
  ComputedProperty.prototype = new Descriptor();
@@ -3608,8 +3637,10 @@ define("ember-metal/computed",
3608
3637
  @param {Boolean} aFlag optional set to `false` to disable caching
3609
3638
  @return {Ember.ComputedProperty} this
3610
3639
  @chainable
3640
+ @deprecated All computed properties are cacheble by default. Use `volatile()` instead to opt-out to caching.
3611
3641
  */
3612
3642
  ComputedPropertyPrototype.cacheable = function(aFlag) {
3643
+ Ember.deprecate('ComputedProperty.cacheable() is deprecated. All computed properties are cacheable by default.');
3613
3644
  this._cacheable = aFlag !== false;
3614
3645
  return this;
3615
3646
  };
@@ -3631,7 +3662,8 @@ define("ember-metal/computed",
3631
3662
  @chainable
3632
3663
  */
3633
3664
  ComputedPropertyPrototype.volatile = function() {
3634
- return this.cacheable(false);
3665
+ this._cacheable = false;
3666
+ return this;
3635
3667
  };
3636
3668
 
3637
3669
  /**
@@ -3655,7 +3687,8 @@ define("ember-metal/computed",
3655
3687
  @chainable
3656
3688
  */
3657
3689
  ComputedPropertyPrototype.readOnly = function(readOnly) {
3658
- this._readOnly = readOnly === undefined || !!readOnly;
3690
+ Ember.deprecate('Passing arguments to ComputedProperty.readOnly() is deprecated.', arguments.length === 0);
3691
+ this._readOnly = readOnly === undefined || !!readOnly; // Force to true once this deprecation is gone
3659
3692
  return this;
3660
3693
  };
3661
3694
 
@@ -3967,7 +4000,7 @@ define("ember-metal/computed",
3967
4000
  The function should accept two parameters, key and value. If value is not
3968
4001
  undefined you should set the value first. In either case return the
3969
4002
  current value of the property.
3970
-
4003
+
3971
4004
  A computed property defined in this way might look like this:
3972
4005
 
3973
4006
  ```js
@@ -3983,12 +4016,12 @@ define("ember-metal/computed",
3983
4016
  var client = Person.create();
3984
4017
 
3985
4018
  client.get('fullName'); // 'Betty Jones'
3986
-
4019
+
3987
4020
  client.set('lastName', 'Fuller');
3988
4021
  client.get('fullName'); // 'Betty Fuller'
3989
4022
  ```
3990
4023
 
3991
- _Note: This is the prefered way to define computed properties when writing third-party
4024
+ _Note: This is the preferred way to define computed properties when writing third-party
3992
4025
  libraries that depend on or use Ember, since there is no guarantee that the user
3993
4026
  will have prototype extensions enabled._
3994
4027
 
@@ -4133,16 +4166,16 @@ define("ember-metal/computed_macros",
4133
4166
 
4134
4167
  ```javascript
4135
4168
  var ToDoList = Ember.Object.extend({
4136
- done: Ember.computed.empty('todos')
4169
+ isDone: Ember.computed.empty('todos')
4137
4170
  });
4138
4171
 
4139
4172
  var todoList = ToDoList.create({
4140
4173
  todos: ['Unit Test', 'Documentation', 'Release']
4141
4174
  });
4142
4175
 
4143
- todoList.get('done'); // false
4176
+ todoList.get('isDone'); // false
4144
4177
  todoList.get('todos').clear();
4145
- todoList.get('done'); // true
4178
+ todoList.get('isDone'); // true
4146
4179
  ```
4147
4180
 
4148
4181
  @since 1.6.0
@@ -4684,7 +4717,7 @@ define("ember-metal/computed_macros",
4684
4717
  /**
4685
4718
  Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides
4686
4719
  a readOnly one way binding. Very often when using `computed.oneWay` one does
4687
- not also want changes to propogate back up, as they will replace the value.
4720
+ not also want changes to propagate back up, as they will replace the value.
4688
4721
 
4689
4722
  This prevents the reverse flow, and also throws an exception when it occurs.
4690
4723
 
@@ -4811,7 +4844,7 @@ define("ember-metal/core",
4811
4844
 
4812
4845
  @class Ember
4813
4846
  @static
4814
- @version 1.9.1
4847
+ @version 1.10.0-beta.1
4815
4848
  */
4816
4849
 
4817
4850
  if ('undefined' === typeof Ember) {
@@ -4838,10 +4871,10 @@ define("ember-metal/core",
4838
4871
  /**
4839
4872
  @property VERSION
4840
4873
  @type String
4841
- @default '1.9.1'
4874
+ @default '1.10.0-beta.1'
4842
4875
  @static
4843
4876
  */
4844
- Ember.VERSION = '1.9.1';
4877
+ Ember.VERSION = '1.10.0-beta.1';
4845
4878
 
4846
4879
  /**
4847
4880
  Standard environmental variables. You can define these in a global `EmberENV`
@@ -4987,11 +5020,11 @@ define("ember-metal/core",
4987
5020
 
4988
5021
  // Stub out the methods defined by the ember-debug package in case it's not loaded
4989
5022
 
4990
- if ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }
4991
- if ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }
4992
- if ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }
4993
- if ('undefined' === typeof Ember.runInDebug) { Ember.runInDebug = Ember.K; }
4994
- if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }
5023
+ if ('undefined' === typeof Ember.assert) { Ember.assert = K; }
5024
+ if ('undefined' === typeof Ember.warn) { Ember.warn = K; }
5025
+ if ('undefined' === typeof Ember.debug) { Ember.debug = K; }
5026
+ if ('undefined' === typeof Ember.runInDebug) { Ember.runInDebug = K; }
5027
+ if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = K; }
4995
5028
  if ('undefined' === typeof Ember.deprecateFunc) {
4996
5029
  Ember.deprecateFunc = function(_, func) { return func; };
4997
5030
  }
@@ -5520,11 +5553,14 @@ define("ember-metal/events",
5520
5553
  return actions;
5521
5554
  }
5522
5555
 
5523
- function listenersUnion(obj, eventName, otherActions) {
5556
+ function accumulateListeners(obj, eventName, otherActions) {
5524
5557
  var meta = obj['__ember_meta__'];
5525
5558
  var actions = meta && meta.listeners && meta.listeners[eventName];
5526
5559
 
5527
5560
  if (!actions) { return; }
5561
+
5562
+ var newActions = [];
5563
+
5528
5564
  for (var i = actions.length - 3; i >= 0; i -= 3) {
5529
5565
  var target = actions[i];
5530
5566
  var method = actions[i+1];
@@ -5533,32 +5569,14 @@ define("ember-metal/events",
5533
5569
 
5534
5570
  if (actionIndex === -1) {
5535
5571
  otherActions.push(target, method, flags);
5572
+ newActions.push(target, method, flags);
5536
5573
  }
5537
5574
  }
5538
- }
5539
-
5540
- __exports__.listenersUnion = listenersUnion;function listenersDiff(obj, eventName, otherActions) {
5541
- var meta = obj['__ember_meta__'];
5542
- var actions = meta && meta.listeners && meta.listeners[eventName];
5543
- var diffActions = [];
5544
-
5545
- if (!actions) { return; }
5546
- for (var i = actions.length - 3; i >= 0; i -= 3) {
5547
- var target = actions[i];
5548
- var method = actions[i+1];
5549
- var flags = actions[i+2];
5550
- var actionIndex = indexOf(otherActions, target, method);
5551
-
5552
- if (actionIndex !== -1) { continue; }
5553
-
5554
- otherActions.push(target, method, flags);
5555
- diffActions.push(target, method, flags);
5556
- }
5557
5575
 
5558
- return diffActions;
5576
+ return newActions;
5559
5577
  }
5560
5578
 
5561
- __exports__.listenersDiff = listenersDiff;/**
5579
+ __exports__.accumulateListeners = accumulateListeners;/**
5562
5580
  Add an event listener
5563
5581
 
5564
5582
  @method addListener
@@ -6015,6 +6033,7 @@ define("ember-metal/injected_property",
6015
6033
  var ComputedProperty = __dependency2__.ComputedProperty;
6016
6034
  var Descriptor = __dependency3__.Descriptor;
6017
6035
  var create = __dependency4__.create;
6036
+ var meta = __dependency5__.meta;
6018
6037
  var inspect = __dependency5__.inspect;
6019
6038
  var EmberError = __dependency6__["default"];
6020
6039
 
@@ -6033,13 +6052,22 @@ define("ember-metal/injected_property",
6033
6052
  this.type = type;
6034
6053
  this.name = name;
6035
6054
 
6036
- this._super$Constructor(function(keyName) {
6037
- Ember.assert("Attempting to lookup an injected property on an object " +
6038
- "without a container, ensure that the object was " +
6039
- "instantiated via a container.", this.container);
6055
+ this._super$Constructor(injectedPropertyGet);
6056
+ this.readOnly();
6057
+ }
6058
+
6059
+ function injectedPropertyGet(keyName) {
6060
+ var desc = meta(this).descs[keyName];
6061
+
6062
+ Ember.assert("Attempting to lookup an injected property on an object " +
6063
+ "without a container, ensure that the object was " +
6064
+ "instantiated via a container.", this.container);
6065
+
6066
+ return this.container.lookup(desc.type + ':' + (desc.name || keyName));
6067
+ }
6040
6068
 
6041
- return this.container.lookup(type + ':' + (name || keyName));
6042
- }, { readOnly: true });
6069
+ function injectedPropertySet(obj, keyName) {
6070
+ throw new EmberError("Cannot set injected property '" + keyName + "' on object: " + inspect(obj));
6043
6071
  }
6044
6072
 
6045
6073
  InjectedProperty.prototype = create(Descriptor.prototype);
@@ -6050,10 +6078,9 @@ define("ember-metal/injected_property",
6050
6078
  InjectedPropertyPrototype._super$Constructor = ComputedProperty;
6051
6079
 
6052
6080
  InjectedPropertyPrototype.get = ComputedPropertyPrototype.get;
6081
+ InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly;
6053
6082
 
6054
- InjectedPropertyPrototype.set = function(obj, keyName) {
6055
- throw new EmberError("Cannot set injected property '" + keyName + "' on object: " + inspect(obj));
6056
- };
6083
+ InjectedPropertyPrototype.set = injectedPropertySet;
6057
6084
 
6058
6085
  InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown;
6059
6086
 
@@ -6516,60 +6543,88 @@ define("ember-metal/keys",
6516
6543
  __exports__["default"] = keys;
6517
6544
  });
6518
6545
  define("ember-metal/libraries",
6519
- ["ember-metal/enumerable_utils","exports"],
6520
- function(__dependency1__, __exports__) {
6546
+ ["ember-metal/core","ember-metal/enumerable_utils","exports"],
6547
+ function(__dependency1__, __dependency2__, __exports__) {
6521
6548
  "use strict";
6522
- // Provides a way to register library versions with ember.
6523
- var forEach = __dependency1__.forEach;
6524
- var indexOf = __dependency1__.indexOf;
6549
+ var Ember = __dependency1__["default"];
6550
+ var forEach = __dependency2__.forEach;
6551
+ var indexOf = __dependency2__.indexOf;
6552
+
6553
+ /**
6554
+ Helper class that allows you to register your library with Ember.
6555
+
6556
+ Singleton created at `Ember.libraries`.
6525
6557
 
6526
- var libraries = function() {
6527
- var _libraries = [];
6528
- var coreLibIndex = 0;
6558
+ @class Libraries
6559
+ @constructor
6560
+ @private
6561
+ */
6562
+ function Libraries() {
6563
+ this._registry = [];
6564
+ this._coreLibIndex = 0;
6565
+ }
6566
+
6567
+ Libraries.prototype = {
6568
+ constructor: Libraries,
6529
6569
 
6530
- var getLibrary = function(name) {
6531
- for (var i = 0; i < _libraries.length; i++) {
6532
- if (_libraries[i].name === name) {
6533
- return _libraries[i];
6570
+ _getLibraryByName: function(name) {
6571
+ var libs = this._registry;
6572
+ var count = libs.length;
6573
+
6574
+ for (var i = 0; i < count; i++) {
6575
+ if (libs[i].name === name) {
6576
+ return libs[i];
6534
6577
  }
6535
6578
  }
6536
- };
6579
+ },
6537
6580
 
6538
- _libraries.register = function(name, version) {
6539
- if (!getLibrary(name)) {
6540
- _libraries.push({name: name, version: version});
6541
- }
6542
- };
6581
+ register: function(name, version, isCoreLibrary) {
6582
+ var index = this._registry.length;
6543
6583
 
6544
- _libraries.registerCoreLibrary = function(name, version) {
6545
- if (!getLibrary(name)) {
6546
- _libraries.splice(coreLibIndex++, 0, {name: name, version: version});
6584
+ if (!this._getLibraryByName(name)) {
6585
+ if (isCoreLibrary) {
6586
+ index = this._coreLibIndex++;
6587
+ }
6588
+ this._registry.splice(index, 0, { name: name, version: version });
6589
+ } else {
6590
+ Ember.warn('Library "' + name + '" is already registered with Ember.');
6547
6591
  }
6548
- };
6592
+ },
6549
6593
 
6550
- _libraries.deRegister = function(name) {
6551
- var lib = getLibrary(name);
6552
- if (lib) _libraries.splice(indexOf(_libraries, lib), 1);
6553
- };
6594
+ registerCoreLibrary: function(name, version) {
6595
+ this.register(name, version, true);
6596
+ },
6597
+
6598
+ deRegister: function(name) {
6599
+ var lib = this._getLibraryByName(name);
6600
+ var index;
6601
+
6602
+ if (lib) {
6603
+ index = indexOf(this._registry, lib);
6604
+ this._registry.splice(index, 1);
6605
+ }
6606
+ },
6554
6607
 
6555
- _libraries.each = function (callback) {
6556
- forEach(_libraries, function(lib) {
6608
+ each: function(callback) {
6609
+ Ember.deprecate('Using Ember.libraries.each() is deprecated. Access to a list of registered libraries is currently a private API. If you are not knowingly accessing this method, your out-of-date Ember Inspector may be doing so.');
6610
+ forEach(this._registry, function(lib) {
6557
6611
  callback(lib.name, lib.version);
6558
6612
  });
6559
- };
6560
-
6561
- return _libraries;
6562
- }();
6613
+ }
6614
+ };
6563
6615
 
6564
- __exports__["default"] = libraries;
6616
+ __exports__["default"] = Libraries;
6565
6617
  });
6566
6618
  define("ember-metal/logger",
6567
6619
  ["ember-metal/core","ember-metal/error","exports"],
6568
6620
  function(__dependency1__, __dependency2__, __exports__) {
6569
6621
  "use strict";
6570
6622
  var Ember = __dependency1__["default"];
6623
+ // Ember.imports
6571
6624
  var EmberError = __dependency2__["default"];
6572
6625
 
6626
+ function K() { return this; }
6627
+
6573
6628
  function consoleMethod(name) {
6574
6629
  var consoleObj, logToConsole;
6575
6630
  if (Ember.imports.console) {
@@ -6636,7 +6691,7 @@ define("ember-metal/logger",
6636
6691
  @for Ember.Logger
6637
6692
  @param {*} arguments
6638
6693
  */
6639
- log: consoleMethod('log') || Ember.K,
6694
+ log: consoleMethod('log') || K,
6640
6695
 
6641
6696
  /**
6642
6697
  Prints the arguments to the console with a warning icon.
@@ -6651,7 +6706,7 @@ define("ember-metal/logger",
6651
6706
  @for Ember.Logger
6652
6707
  @param {*} arguments
6653
6708
  */
6654
- warn: consoleMethod('warn') || Ember.K,
6709
+ warn: consoleMethod('warn') || K,
6655
6710
 
6656
6711
  /**
6657
6712
  Prints the arguments to the console with an error icon, red text and a stack trace.
@@ -6666,7 +6721,7 @@ define("ember-metal/logger",
6666
6721
  @for Ember.Logger
6667
6722
  @param {*} arguments
6668
6723
  */
6669
- error: consoleMethod('error') || Ember.K,
6724
+ error: consoleMethod('error') || K,
6670
6725
 
6671
6726
  /**
6672
6727
  Logs the arguments to the console.
@@ -6682,7 +6737,7 @@ define("ember-metal/logger",
6682
6737
  @for Ember.Logger
6683
6738
  @param {*} arguments
6684
6739
  */
6685
- info: consoleMethod('info') || Ember.K,
6740
+ info: consoleMethod('info') || K,
6686
6741
 
6687
6742
  /**
6688
6743
  Logs the arguments to the console in blue text.
@@ -6698,7 +6753,7 @@ define("ember-metal/logger",
6698
6753
  @for Ember.Logger
6699
6754
  @param {*} arguments
6700
6755
  */
6701
- debug: consoleMethod('debug') || consoleMethod('info') || Ember.K,
6756
+ debug: consoleMethod('debug') || consoleMethod('info') || K,
6702
6757
 
6703
6758
  /**
6704
6759
  If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
@@ -7290,7 +7345,6 @@ define("ember-metal/mixin",
7290
7345
  var metaFor = __dependency7__.meta;
7291
7346
  var wrap = __dependency7__.wrap;
7292
7347
  var makeArray = __dependency7__.makeArray;
7293
- var apply = __dependency7__.apply;
7294
7348
  var isArray = __dependency7__.isArray;
7295
7349
  var expandProperties = __dependency8__["default"];
7296
7350
  var Descriptor = __dependency9__.Descriptor;
@@ -7311,18 +7365,35 @@ define("ember-metal/mixin",
7311
7365
  function superFunction(){
7312
7366
  var func = this.__nextSuper;
7313
7367
  var ret;
7368
+
7314
7369
  if (func) {
7315
- var args = new Array(arguments.length);
7316
- for (var i = 0, l = args.length; i < l; i++) {
7317
- args[i] = arguments[i];
7318
- }
7370
+ var length = arguments.length;
7319
7371
  this.__nextSuper = null;
7320
- ret = apply(this, func, args);
7372
+ if (length === 0) {
7373
+ ret = func.call(this);
7374
+ } else if (length === 1) {
7375
+ ret = func.call(this, arguments[0]);
7376
+ } else if (length === 2) {
7377
+ ret = func.call(this, arguments[0], arguments[1]);
7378
+ } else {
7379
+ ret = func.apply(this, arguments);
7380
+ }
7321
7381
  this.__nextSuper = func;
7382
+ return ret;
7322
7383
  }
7323
- return ret;
7324
7384
  }
7325
7385
 
7386
+ // ensure we prime superFunction to mitigate
7387
+ // v8 bug potentially incorrectly deopts this function: https://code.google.com/p/v8/issues/detail?id=3709
7388
+ var primer = {
7389
+ __nextSuper: function(a,b,c,d ) { }
7390
+ };
7391
+
7392
+ superFunction.call(primer);
7393
+ superFunction.call(primer, 1);
7394
+ superFunction.call(primer, 1, 2);
7395
+ superFunction.call(primer, 1, 2, 3);
7396
+
7326
7397
  function mixinsMeta(obj) {
7327
7398
  var m = metaFor(obj, true);
7328
7399
  var ret = m.mixins;
@@ -8867,8 +8938,7 @@ define("ember-metal/property_events",
8867
8938
  var guidFor = __dependency1__.guidFor;
8868
8939
  var tryFinally = __dependency1__.tryFinally;
8869
8940
  var sendEvent = __dependency2__.sendEvent;
8870
- var listenersUnion = __dependency2__.listenersUnion;
8871
- var listenersDiff = __dependency2__.listenersDiff;
8941
+ var accumulateListeners = __dependency2__.accumulateListeners;
8872
8942
  var ObserverSet = __dependency3__["default"];
8873
8943
 
8874
8944
  var beforeObserverSet = new ObserverSet();
@@ -9125,20 +9195,20 @@ define("ember-metal/property_events",
9125
9195
  @param {Function} callback
9126
9196
  @param [binding]
9127
9197
  */
9128
- function changeProperties(cb, binding) {
9198
+ function changeProperties(callback, binding) {
9129
9199
  beginPropertyChanges();
9130
- tryFinally(cb, endPropertyChanges, binding);
9200
+ tryFinally(callback, endPropertyChanges, binding);
9131
9201
  }
9132
9202
 
9133
9203
  function notifyBeforeObservers(obj, keyName) {
9134
9204
  if (obj.isDestroying) { return; }
9135
9205
 
9136
9206
  var eventName = keyName + ':before';
9137
- var listeners, diff;
9207
+ var listeners, added;
9138
9208
  if (deferred) {
9139
9209
  listeners = beforeObserverSet.add(obj, keyName, eventName);
9140
- diff = listenersDiff(obj, eventName, listeners);
9141
- sendEvent(obj, eventName, [obj, keyName], diff);
9210
+ added = accumulateListeners(obj, eventName, listeners);
9211
+ sendEvent(obj, eventName, [obj, keyName], added);
9142
9212
  } else {
9143
9213
  sendEvent(obj, eventName, [obj, keyName]);
9144
9214
  }
@@ -9151,7 +9221,7 @@ define("ember-metal/property_events",
9151
9221
  var listeners;
9152
9222
  if (deferred) {
9153
9223
  listeners = observerSet.add(obj, keyName, eventName);
9154
- listenersUnion(obj, eventName, listeners);
9224
+ accumulateListeners(obj, eventName, listeners);
9155
9225
  } else {
9156
9226
  sendEvent(obj, eventName, [obj, keyName]);
9157
9227
  }
@@ -9262,17 +9332,10 @@ define("ember-metal/property_get",
9262
9332
  }
9263
9333
  };
9264
9334
 
9265
- // Currently used only by Ember Data tests
9266
- if (Ember.config.overrideAccessors) {
9267
- Ember.get = get;
9268
- Ember.config.overrideAccessors();
9269
- get = Ember.get;
9270
- }
9271
-
9272
9335
  /**
9273
9336
  Normalizes a target/path pair to reflect that actual target/path that should
9274
9337
  be observed, etc. This takes into account passing in global property
9275
- paths (i.e. a path beginning with a captial letter not defined on the
9338
+ paths (i.e. a path beginning with a capital letter not defined on the
9276
9339
  target).
9277
9340
 
9278
9341
  @private
@@ -9448,14 +9511,6 @@ define("ember-metal/property_set",
9448
9511
  return value;
9449
9512
  };
9450
9513
 
9451
- // Currently used only by Ember Data tests
9452
- // ES6TODO: Verify still true
9453
- if (Ember.config.overrideAccessors) {
9454
- Ember.set = set;
9455
- Ember.config.overrideAccessors();
9456
- set = Ember.set;
9457
- }
9458
-
9459
9514
  function setPath(root, path, value, tolerant) {
9460
9515
  var keyName;
9461
9516
 
@@ -10179,39 +10234,8 @@ define("ember-metal/set_properties",
10179
10234
  return obj;
10180
10235
  }
10181
10236
  });
10182
- define("ember-metal/streams/read",
10183
- ["exports"],
10184
- function(__exports__) {
10185
- "use strict";
10186
- function read(object) {
10187
- if (object && object.isStream) {
10188
- return object.value();
10189
- } else {
10190
- return object;
10191
- }
10192
- }
10193
-
10194
- __exports__.read = read;function readArray(array) {
10195
- var length = array.length;
10196
- var ret = new Array(length);
10197
- for (var i = 0; i < length; i++) {
10198
- ret[i] = read(array[i]);
10199
- }
10200
- return ret;
10201
- }
10202
-
10203
- __exports__.readArray = readArray;function readHash(object) {
10204
- var ret = {};
10205
- for (var key in object) {
10206
- ret[key] = read(object[key]);
10207
- }
10208
- return ret;
10209
- }
10210
-
10211
- __exports__.readHash = readHash;
10212
- });
10213
10237
  define("ember-metal/streams/simple",
10214
- ["ember-metal/merge","ember-metal/streams/stream","ember-metal/platform","ember-metal/streams/read","exports"],
10238
+ ["ember-metal/merge","ember-metal/streams/stream","ember-metal/platform","ember-metal/streams/utils","exports"],
10215
10239
  function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
10216
10240
  "use strict";
10217
10241
  var merge = __dependency1__["default"];
@@ -10220,6 +10244,7 @@ define("ember-metal/streams/simple",
10220
10244
  var read = __dependency4__.read;
10221
10245
 
10222
10246
  function SimpleStream(source) {
10247
+ this.init();
10223
10248
  this.source = source;
10224
10249
 
10225
10250
  if (source && source.isStream) {
@@ -10262,13 +10287,16 @@ define("ember-metal/streams/simple",
10262
10287
  this.notify();
10263
10288
  },
10264
10289
 
10290
+ _super$destroy: Stream.prototype.destroy,
10291
+
10265
10292
  destroy: function() {
10266
- if (this.source && this.source.isStream) {
10267
- this.source.unsubscribe(this._didChange, this);
10293
+ if (this._super$destroy()) {
10294
+ if (this.source && this.source.isStream) {
10295
+ this.source.unsubscribe(this._didChange, this);
10296
+ }
10297
+ this.source = undefined;
10298
+ return true;
10268
10299
  }
10269
-
10270
- this.source = undefined;
10271
- Stream.prototype.destroy.call(this);
10272
10300
  }
10273
10301
  });
10274
10302
 
@@ -10282,20 +10310,21 @@ define("ember-metal/streams/stream",
10282
10310
  var getFirstKey = __dependency2__.getFirstKey;
10283
10311
  var getTailPath = __dependency2__.getTailPath;
10284
10312
 
10285
- var NIL = function NIL(){};
10286
-
10287
10313
  function Stream(fn) {
10314
+ this.init();
10288
10315
  this.valueFn = fn;
10289
- this.cache = NIL;
10290
- this.subscribers = undefined;
10291
- this.children = undefined;
10292
- this.destroyed = false;
10293
10316
  }
10294
10317
 
10295
10318
  Stream.prototype = {
10296
10319
  isStream: true,
10297
10320
 
10298
- cache: NIL,
10321
+ init: function() {
10322
+ this.state = 'dirty';
10323
+ this.cache = undefined;
10324
+ this.subscribers = undefined;
10325
+ this.children = undefined;
10326
+ this._label = undefined;
10327
+ },
10299
10328
 
10300
10329
  get: function(path) {
10301
10330
  var firstKey = getFirstKey(path);
@@ -10320,11 +10349,20 @@ define("ember-metal/streams/stream",
10320
10349
  },
10321
10350
 
10322
10351
  value: function() {
10323
- if (this.cache !== NIL) {
10352
+ if (this.state === 'clean') {
10324
10353
  return this.cache;
10325
- } else {
10354
+ } else if (this.state === 'dirty') {
10355
+ this.state = 'clean';
10326
10356
  return this.cache = this.valueFn();
10327
10357
  }
10358
+ // TODO: Ensure value is never called on a destroyed stream
10359
+ // so that we can uncomment this assertion.
10360
+ //
10361
+ // Ember.assert("Stream error: value was called in an invalid state: " + this.state);
10362
+ },
10363
+
10364
+ valueFn: function() {
10365
+ throw new Error("Stream error: valueFn not implemented");
10328
10366
  },
10329
10367
 
10330
10368
  setValue: function() {
@@ -10336,9 +10374,9 @@ define("ember-metal/streams/stream",
10336
10374
  },
10337
10375
 
10338
10376
  notifyExcept: function(callbackToSkip, contextToSkip) {
10339
- if (this.cache !== NIL) {
10340
- this.cache = NIL;
10341
- this.notifySubscribers(callbackToSkip, contextToSkip);
10377
+ if (this.state === 'clean') {
10378
+ this.state = 'dirty';
10379
+ this._notifySubscribers(callbackToSkip, contextToSkip);
10342
10380
  }
10343
10381
  },
10344
10382
 
@@ -10363,7 +10401,7 @@ define("ember-metal/streams/stream",
10363
10401
  }
10364
10402
  },
10365
10403
 
10366
- notifySubscribers: function(callbackToSkip, contextToSkip) {
10404
+ _notifySubscribers: function(callbackToSkip, contextToSkip) {
10367
10405
  var subscribers = this.subscribers;
10368
10406
 
10369
10407
  if (subscribers !== undefined) {
@@ -10385,12 +10423,15 @@ define("ember-metal/streams/stream",
10385
10423
  },
10386
10424
 
10387
10425
  destroy: function() {
10388
- if (this.destroyed) return;
10389
- this.destroyed = true;
10426
+ if (this.state !== 'destroyed') {
10427
+ this.state = 'destroyed';
10390
10428
 
10391
- var children = this.children;
10392
- for (var key in children) {
10393
- children[key].destroy();
10429
+ var children = this.children;
10430
+ for (var key in children) {
10431
+ children[key].destroy();
10432
+ }
10433
+
10434
+ return true;
10394
10435
  }
10395
10436
  },
10396
10437
 
@@ -10419,11 +10460,11 @@ define("ember-metal/streams/stream_binding",
10419
10460
  function StreamBinding(stream) {
10420
10461
  Ember.assert("StreamBinding error: tried to bind to object that is not a stream", stream && stream.isStream);
10421
10462
 
10463
+ this.init();
10422
10464
  this.stream = stream;
10423
10465
  this.senderCallback = undefined;
10424
10466
  this.senderContext = undefined;
10425
10467
  this.senderValue = undefined;
10426
- this.destroyed = false;
10427
10468
 
10428
10469
  stream.subscribe(this._onNotify, this);
10429
10470
  }
@@ -10457,7 +10498,7 @@ define("ember-metal/streams/stream_binding",
10457
10498
  },
10458
10499
 
10459
10500
  _sync: function() {
10460
- if (this.destroyed) {
10501
+ if (this.state === 'destroyed') {
10461
10502
  return;
10462
10503
  }
10463
10504
 
@@ -10472,23 +10513,70 @@ define("ember-metal/streams/stream_binding",
10472
10513
  this.senderValue = undefined;
10473
10514
 
10474
10515
  // Force StreamBindings to always notify
10475
- this.cache = undefined;
10516
+ this.state = 'clean';
10476
10517
 
10477
10518
  this.notifyExcept(senderCallback, senderContext);
10478
10519
  },
10479
10520
 
10521
+ _super$destroy: Stream.prototype.destroy,
10522
+
10480
10523
  destroy: function() {
10481
- if (this.destroyed) {
10482
- return;
10524
+ if (this._super$destroy()) {
10525
+ this.stream.unsubscribe(this._onNotify, this);
10526
+ return true;
10483
10527
  }
10484
-
10485
- this.destroyed = true;
10486
- this.stream.unsubscribe(this._onNotify, this);
10487
10528
  }
10488
10529
  });
10489
10530
 
10490
10531
  __exports__["default"] = StreamBinding;
10491
10532
  });
10533
+ define("ember-metal/streams/utils",
10534
+ ["exports"],
10535
+ function(__exports__) {
10536
+ "use strict";
10537
+ function isStream(object) {
10538
+ return object && object.isStream;
10539
+ }
10540
+
10541
+ __exports__.isStream = isStream;function subscribe(object, callback, context) {
10542
+ if (object && object.isStream) {
10543
+ object.subscribe(callback, context);
10544
+ }
10545
+ }
10546
+
10547
+ __exports__.subscribe = subscribe;function unsubscribe(object, callback, context) {
10548
+ if (object && object.isStream) {
10549
+ object.unsubscribe(callback, context);
10550
+ }
10551
+ }
10552
+
10553
+ __exports__.unsubscribe = unsubscribe;function read(object) {
10554
+ if (object && object.isStream) {
10555
+ return object.value();
10556
+ } else {
10557
+ return object;
10558
+ }
10559
+ }
10560
+
10561
+ __exports__.read = read;function readArray(array) {
10562
+ var length = array.length;
10563
+ var ret = new Array(length);
10564
+ for (var i = 0; i < length; i++) {
10565
+ ret[i] = read(array[i]);
10566
+ }
10567
+ return ret;
10568
+ }
10569
+
10570
+ __exports__.readArray = readArray;function readHash(object) {
10571
+ var ret = {};
10572
+ for (var key in object) {
10573
+ ret[key] = read(object[key]);
10574
+ }
10575
+ return ret;
10576
+ }
10577
+
10578
+ __exports__.readHash = readHash;
10579
+ });
10492
10580
  define("ember-metal/utils",
10493
10581
  ["ember-metal/core","ember-metal/platform","ember-metal/array","exports"],
10494
10582
  function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
@@ -10566,13 +10654,13 @@ define("ember-metal/utils",
10566
10654
  algorithims typically cost in proportion to the length of the string.
10567
10655
  Luckily, this is where the Symbols (interned strings) shine. As Symbols are
10568
10656
  unique by their string content, equality checks can be done by pointer
10569
- comparision.
10657
+ comparison.
10570
10658
 
10571
10659
  How do I know if my string is a rope or symbol?
10572
10660
 
10573
10661
  Typically (warning general sweeping statement, but truthy in runtimes at
10574
10662
  present) static strings created as part of the JS source are interned.
10575
- Strings often used for comparisions can be interned at runtime if some
10663
+ Strings often used for comparisons can be interned at runtime if some
10576
10664
  criteria are met. One of these criteria can be the size of the entire rope.
10577
10665
  For example, in chrome 38 a rope longer then 12 characters will not
10578
10666
  intern, nor will segments of that rope.
@@ -10891,17 +10979,35 @@ define("ember-metal/utils",
10891
10979
  @param {Function} superFunc The super function.
10892
10980
  @return {Function} wrapped function.
10893
10981
  */
10982
+
10894
10983
  function wrap(func, superFunc) {
10895
10984
  function superWrapper() {
10896
10985
  var ret;
10897
10986
  var sup = this && this.__nextSuper;
10898
- var args = new Array(arguments.length);
10899
- for (var i = 0, l = args.length; i < l; i++) {
10900
- args[i] = arguments[i];
10987
+ var length = arguments.length;
10988
+
10989
+ if (this) {
10990
+ this.__nextSuper = superFunc;
10901
10991
  }
10902
- if(this) { this.__nextSuper = superFunc; }
10903
- ret = apply(this, func, args);
10904
- if(this) { this.__nextSuper = sup; }
10992
+
10993
+ if (length === 0) {
10994
+ ret = func.call(this);
10995
+ } else if (length === 1) {
10996
+ ret = func.call(this, arguments[0]);
10997
+ } else if (length === 2) {
10998
+ ret = func.call(this, arguments[0], arguments[1]);
10999
+ } else {
11000
+ var args = new Array(length);
11001
+ for (var i = 0; i < length; i++) {
11002
+ args[i] = arguments[i];
11003
+ }
11004
+ ret = apply(this, func, args);
11005
+ }
11006
+
11007
+ if (this) {
11008
+ this.__nextSuper = sup;
11009
+ }
11010
+
10905
11011
  return ret;
10906
11012
  }
10907
11013
 
@@ -10991,7 +11097,7 @@ define("ember-metal/utils",
10991
11097
  Checks to see if the `methodName` exists on the `obj`.
10992
11098
 
10993
11099
  ```javascript
10994
- var foo = { bar: Ember.K, baz: null };
11100
+ var foo = { bar: function() { return 'bar'; }, baz: null };
10995
11101
 
10996
11102
  Ember.canInvoke(foo, 'bar'); // true
10997
11103
  Ember.canInvoke(foo, 'baz'); // false
@@ -11710,6 +11816,9 @@ define("ember-runtime",
11710
11816
  Ember.isEqual = isEqual;
11711
11817
 
11712
11818
 
11819
+ Ember.inject = inject;
11820
+
11821
+
11713
11822
  Ember.Array = EmberArray;
11714
11823
 
11715
11824
  Ember.Comparable = Comparable;
@@ -11782,6 +11891,9 @@ define("ember-runtime",
11782
11891
  Ember.ControllerMixin = ControllerMixin;
11783
11892
 
11784
11893
 
11894
+ Ember.Service = Service;
11895
+
11896
+
11785
11897
  Ember._ProxyMixin = _ProxyMixin;
11786
11898
 
11787
11899
  Ember.RSVP = RSVP;
@@ -11850,16 +11962,17 @@ define("ember-runtime/compare",
11850
11962
  var type2 = typeOf(w);
11851
11963
 
11852
11964
  if (Comparable) {
11853
- if (type1 ==='instance' && Comparable.detect(v.constructor)) {
11965
+ if (type1 === 'instance' && Comparable.detect(v) && v.constructor.compare) {
11854
11966
  return v.constructor.compare(v, w);
11855
11967
  }
11856
11968
 
11857
- if (type2 === 'instance' && Comparable.detect(w.constructor)) {
11858
- return 1 - w.constructor.compare(w, v);
11969
+ if (type2 === 'instance' && Comparable.detect(w) && w.constructor.compare) {
11970
+ return w.constructor.compare(w, v) * -1;
11859
11971
  }
11860
11972
  }
11861
11973
 
11862
11974
  var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]);
11975
+
11863
11976
  if (res !== 0) {
11864
11977
  return res;
11865
11978
  }
@@ -12571,13 +12684,13 @@ define("ember-runtime/computed/reduce_computed",
12571
12684
 
12572
12685
  this.options = options;
12573
12686
  this._dependentKeys = null;
12687
+ this._cacheable = true;
12574
12688
  // A map of dependentKey -> [itemProperty, ...] that tracks what properties of
12575
12689
  // items in the array we must track to update this property.
12576
12690
  this._itemPropertyKeys = {};
12577
12691
  this._previousItemPropertyKeys = {};
12578
12692
 
12579
12693
  this.readOnly();
12580
- this.cacheable();
12581
12694
 
12582
12695
  this.recomputeOnce = function(propertyName) {
12583
12696
  // What we really want to do is coalesce by <cp, propertyName>.
@@ -14111,6 +14224,38 @@ define("ember-runtime/controllers/controller",
14111
14224
  }
14112
14225
 
14113
14226
 
14227
+ /**
14228
+ Creates a property that lazily looks up another controller in the container.
14229
+ Can only be used when defining another controller.
14230
+
14231
+ Example:
14232
+
14233
+ ```javascript
14234
+ App.PostController = Ember.Controller.extend({
14235
+ posts: Ember.inject.controller()
14236
+ });
14237
+ ```
14238
+
14239
+ This example will create a `posts` property on the `post` controller that
14240
+ looks up the `posts` controller in the container, making it easy to
14241
+ reference other controllers. This is functionally equivalent to:
14242
+
14243
+ ```javascript
14244
+ App.PostController = Ember.Controller.extend({
14245
+ needs: 'posts',
14246
+ posts: Ember.computed.alias('controllers.posts')
14247
+ });
14248
+ ```
14249
+
14250
+ @method inject.controller
14251
+ @for Ember
14252
+ @param {String} name (optional) name of the controller to inject, defaults
14253
+ to the property's name
14254
+ @return {Ember.InjectedProperty} injection descriptor instance
14255
+ */
14256
+ createInjectionHelper('controller', controllerInjectionHelper);
14257
+
14258
+
14114
14259
  __exports__["default"] = Controller;
14115
14260
  });
14116
14261
  define("ember-runtime/controllers/object_controller",
@@ -14421,11 +14566,15 @@ define("ember-runtime/ext/function",
14421
14566
  @for Function
14422
14567
  */
14423
14568
  FunctionPrototype.observesImmediately = function () {
14424
- for (var i = 0, l = arguments.length; i < l; i++) {
14425
- var arg = arguments[i];
14426
- Ember.assert('Immediate observers must observe internal properties only, ' +
14427
- 'not properties on other objects.', arg.indexOf('.') === -1);
14428
- }
14569
+ Ember.assert('Immediate observers must observe internal properties only, ' +
14570
+ 'not properties on other objects.', function checkIsInternalProperty() {
14571
+ for(var i = 0, l = arguments.length; i < l; i++) {
14572
+ if(arguments[i].indexOf('.') !== -1) {
14573
+ return false;
14574
+ }
14575
+ }
14576
+ return true;
14577
+ });
14429
14578
 
14430
14579
  // observes handles property expansion
14431
14580
  return this.observes.apply(this, arguments);
@@ -14544,7 +14693,17 @@ define("ember-runtime/ext/rsvp",
14544
14693
  return this['catch'](callback, label);
14545
14694
  };
14546
14695
 
14547
- RSVP.onerrorDefault = function (error) {
14696
+ RSVP.onerrorDefault = function (e) {
14697
+ var error;
14698
+
14699
+ if (e && e.errorThrown) {
14700
+ // jqXHR provides this
14701
+ error = e.errorThrown;
14702
+ error.__reason_with_error_thrown__ = e;
14703
+ } else {
14704
+ error = e;
14705
+ }
14706
+
14548
14707
  if (error && error.name !== 'TransitionAborted') {
14549
14708
  if (Ember.testing) {
14550
14709
  // ES6TODO: remove when possible
@@ -14688,14 +14847,15 @@ define("ember-runtime/ext/string",
14688
14847
  }
14689
14848
  });
14690
14849
  define("ember-runtime/inject",
14691
- ["ember-metal/core","ember-metal/enumerable_utils","ember-metal/injected_property","ember-metal/keys","exports"],
14692
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
14850
+ ["ember-metal/core","ember-metal/enumerable_utils","ember-metal/utils","ember-metal/injected_property","ember-metal/keys","exports"],
14851
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {
14693
14852
  "use strict";
14694
14853
  var Ember = __dependency1__["default"];
14695
14854
  // Ember.assert
14696
14855
  var indexOf = __dependency2__.indexOf;
14697
- var InjectedProperty = __dependency3__["default"];
14698
- var keys = __dependency4__["default"];
14856
+ var meta = __dependency3__.meta;
14857
+ var InjectedProperty = __dependency4__["default"];
14858
+ var keys = __dependency5__["default"];
14699
14859
 
14700
14860
  /**
14701
14861
  Namespace for injection helper methods.
@@ -14731,26 +14891,22 @@ define("ember-runtime/inject",
14731
14891
  }
14732
14892
 
14733
14893
  __exports__.createInjectionHelper = createInjectionHelper;/**
14734
- Validation function intended to be invoked at when extending a factory with
14735
- injected properties. Runs per-type validation functions once for each injected
14736
- type encountered.
14737
-
14738
- Note that this currently modifies the mixin themselves, which is technically
14739
- dubious but is practically of little consequence. This may change in the
14740
- future.
14894
+ Validation function that runs per-type validation functions once for each
14895
+ injected type encountered.
14741
14896
 
14742
14897
  @private
14743
14898
  @method validatePropertyInjections
14744
14899
  @namespace Ember
14745
- @param {Object} factory The factory object being extended
14746
- @param {Object} props A hash of properties to be added to the factory
14900
+ @param {Object} factory The factory object
14747
14901
  */
14748
- function validatePropertyInjections(factory, props) {
14902
+ function validatePropertyInjections(factory) {
14903
+ var proto = factory.proto();
14904
+ var descs = meta(proto).descs;
14749
14905
  var types = [];
14750
14906
  var key, desc, validator, i, l;
14751
14907
 
14752
- for (key in props) {
14753
- desc = props[key];
14908
+ for (key in descs) {
14909
+ desc = descs[key];
14754
14910
  if (desc instanceof InjectedProperty && indexOf(types, desc.type) === -1) {
14755
14911
  types.push(desc.type);
14756
14912
  }
@@ -15029,7 +15185,6 @@ define("ember-runtime/mixins/action_handler",
15029
15185
  @method willMergeMixin
15030
15186
  */
15031
15187
  willMergeMixin: function(props) {
15032
-
15033
15188
  var hashName;
15034
15189
 
15035
15190
  if (!props._actions) {
@@ -15747,7 +15902,7 @@ define("ember-runtime/mixins/controller_content_model_alias_deprecation",
15747
15902
 
15748
15903
  This change reduces many caveats with model/content, and also sets a
15749
15904
  simple ground rule: Never set a controllers content, rather always set
15750
- it's model and ember will do the right thing.
15905
+ its model and ember will do the right thing.
15751
15906
 
15752
15907
 
15753
15908
  `Ember.ControllerContentModelAliasDeprecation` is used internally by Ember in
@@ -17095,7 +17250,7 @@ define("ember-runtime/mixins/enumerable",
17095
17250
  sortBy: function() {
17096
17251
  var sortKeys = arguments;
17097
17252
 
17098
- return this.toArray().sort(function(a, b){
17253
+ return this.toArray().sort(function(a, b) {
17099
17254
  for(var i = 0; i < sortKeys.length; i++) {
17100
17255
  var key = sortKeys[i];
17101
17256
  var propA = get(a, key);
@@ -18175,6 +18330,7 @@ define("ember-runtime/mixins/observable",
18175
18330
  },
18176
18331
 
18177
18332
  addBeforeObserver: function(key, target, method) {
18333
+ Ember.deprecate('Before observers are deprecated and will be removed in a future release. If you want to keep track of previous values you have to implement it yourself. See http://emberjs.com/guides/deprecations#toc_deprecate-beforeobservers');
18178
18334
  addBeforeObserver(this, key, target, method);
18179
18335
  },
18180
18336
 
@@ -18315,7 +18471,7 @@ define("ember-runtime/mixins/observable",
18315
18471
  },
18316
18472
 
18317
18473
  /**
18318
- Set the value of a boolean property to the opposite of it's
18474
+ Set the value of a boolean property to the opposite of its
18319
18475
  current value.
18320
18476
 
18321
18477
  ```javascript
@@ -19032,7 +19188,7 @@ define("ember-runtime/system/array_proxy",
19032
19188
  function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __exports__) {
19033
19189
  "use strict";
19034
19190
  var Ember = __dependency1__["default"];
19035
- // Ember.K, Ember.assert
19191
+ // Ember.assert
19036
19192
  var get = __dependency2__.get;
19037
19193
  var isArray = __dependency3__.isArray;
19038
19194
  var apply = __dependency3__.apply;
@@ -19055,7 +19211,8 @@ define("ember-runtime/system/array_proxy",
19055
19211
 
19056
19212
  var OUT_OF_RANGE_EXCEPTION = "Index out of range";
19057
19213
  var EMPTY = [];
19058
- var K = Ember.K;
19214
+
19215
+ function K() { return this; }
19059
19216
 
19060
19217
  /**
19061
19218
  An ArrayProxy wraps any other object that implements `Ember.Array` and/or
@@ -19416,8 +19573,8 @@ define("ember-runtime/system/container",
19416
19573
  __exports__["default"] = Container;
19417
19574
  });
19418
19575
  define("ember-runtime/system/core_object",
19419
- ["ember-metal/core","ember-metal/property_get","ember-metal/utils","ember-metal/platform","ember-metal/chains","ember-metal/events","ember-metal/mixin","ember-metal/enumerable_utils","ember-metal/error","ember-metal/keys","ember-runtime/mixins/action_handler","ember-metal/properties","ember-metal/binding","ember-metal/computed","ember-metal/injected_property","ember-metal/run_loop","ember-metal/watching","exports"],
19420
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {
19576
+ ["ember-metal/core","ember-metal/property_get","ember-metal/utils","ember-metal/platform","ember-metal/chains","ember-metal/events","ember-metal/mixin","ember-metal/enumerable_utils","ember-metal/error","ember-metal/keys","ember-runtime/mixins/action_handler","ember-metal/properties","ember-metal/binding","ember-metal/computed","ember-metal/injected_property","ember-metal/run_loop","ember-metal/watching","ember-runtime/inject","exports"],
19577
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __exports__) {
19421
19578
  // Remove "use strict"; from transpiled module until
19422
19579
  // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
19423
19580
  //
@@ -19429,7 +19586,7 @@ define("ember-runtime/system/core_object",
19429
19586
  */
19430
19587
 
19431
19588
  var Ember = __dependency1__["default"];
19432
- // Ember.assert, Ember.K, Ember.config
19589
+ // Ember.assert, Ember.config
19433
19590
 
19434
19591
  // NOTE: this object should never be included directly. Instead use `Ember.Object`.
19435
19592
  // We only define this separately so that `Ember.Set` can depend on it.
@@ -19460,6 +19617,7 @@ define("ember-runtime/system/core_object",
19460
19617
  var destroy = __dependency17__.destroy;
19461
19618
  var K = __dependency1__.K;
19462
19619
  var hasPropertyAccessors = __dependency4__.hasPropertyAccessors;
19620
+ var validatePropertyInjections = __dependency18__.validatePropertyInjections;
19463
19621
 
19464
19622
  var schedule = run.schedule;
19465
19623
  var applyMixin = Mixin._apply;
@@ -19547,7 +19705,7 @@ define("ember-runtime/system/core_object",
19547
19705
  "time, when Ember.ActionHandler is used (i.e. views, " +
19548
19706
  "controllers & routes).", !((keyName === 'actions') && ActionHandler.detect(this)));
19549
19707
 
19550
- if (concatenatedProperties &&
19708
+ if (concatenatedProperties &&
19551
19709
  concatenatedProperties.length > 0 &&
19552
19710
  indexOf(concatenatedProperties, keyName) >= 0) {
19553
19711
  var baseValue = this[keyName];
@@ -19580,16 +19738,28 @@ define("ember-runtime/system/core_object",
19580
19738
  }
19581
19739
  }
19582
19740
  }
19741
+
19583
19742
  finishPartial(this, m);
19743
+
19584
19744
  var length = arguments.length;
19585
- var args = new Array(length);
19586
- for (var x = 0; x < length; x++) {
19587
- args[x] = arguments[x];
19745
+
19746
+ if (length === 0) {
19747
+ this.init();
19748
+ } else if (length === 1) {
19749
+ this.init(arguments[0]);
19750
+ } else {
19751
+ // v8 bug potentially incorrectly deopts this function: https://code.google.com/p/v8/issues/detail?id=3709
19752
+ // we may want to keep this around till this ages out on mobile
19753
+ var args = new Array(length);
19754
+ for (var x = 0; x < length; x++) {
19755
+ args[x] = arguments[x];
19756
+ }
19757
+ this.init.apply(this, args);
19588
19758
  }
19589
- apply(this, this.init, args);
19759
+
19590
19760
  m.proto = proto;
19591
19761
  finishChains(this);
19592
- sendEvent(this, "init");
19762
+ sendEvent(this, 'init');
19593
19763
  };
19594
19764
 
19595
19765
  Class.toString = Mixin.prototype.toString;
@@ -19856,10 +20026,6 @@ define("ember-runtime/system/core_object",
19856
20026
  return function() { return ret; };
19857
20027
  }
19858
20028
 
19859
- if (Ember.config.overridePrototypeMixin) {
19860
- Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);
19861
- }
19862
-
19863
20029
  CoreObject.__super__ = null;
19864
20030
 
19865
20031
  var ClassMixinProps = {
@@ -20249,15 +20415,53 @@ define("ember-runtime/system/core_object",
20249
20415
  }
20250
20416
  };
20251
20417
 
20418
+ function injectedPropertyAssertion() {
20419
+ Ember.assert("Injected properties are invalid", validatePropertyInjections(this));
20420
+ }
20421
+
20422
+ function addOnLookupHandler() {
20423
+ Ember.runInDebug(function() {
20424
+ /**
20425
+ Provides lookup-time type validation for injected properties.
20426
+
20427
+ @private
20428
+ @method _onLookup
20429
+ */
20430
+ ClassMixinProps._onLookup = injectedPropertyAssertion;
20431
+ });
20432
+ }
20433
+
20252
20434
 
20435
+ addOnLookupHandler();
20436
+
20437
+ /**
20438
+ Returns a hash of property names and container names that injected
20439
+ properties will lookup on the container lazily.
20440
+
20441
+ @method _lazyInjections
20442
+ @return {Object} Hash of all lazy injected property keys to container names
20443
+ */
20444
+ ClassMixinProps._lazyInjections = function() {
20445
+ var injections = {};
20446
+ var proto = this.proto();
20447
+ var descs = meta(proto).descs;
20448
+ var key, desc;
20449
+
20450
+ for (key in descs) {
20451
+ desc = descs[key];
20452
+ if (desc instanceof InjectedProperty) {
20453
+ injections[key] = desc.type + ':' + (desc.name || key);
20454
+ }
20455
+ }
20456
+
20457
+ return injections;
20458
+ };
20459
+
20460
+
20253
20461
  var ClassMixin = Mixin.create(ClassMixinProps);
20254
20462
 
20255
20463
  ClassMixin.ownerConstructor = CoreObject;
20256
20464
 
20257
- if (Ember.config.overrideClassMixin) {
20258
- Ember.config.overrideClassMixin(ClassMixin);
20259
- }
20260
-
20261
20465
  CoreObject.ClassMixin = ClassMixin;
20262
20466
 
20263
20467
  ClassMixin.apply(CoreObject);
@@ -21010,19 +21214,16 @@ define("ember-runtime/system/native_array",
21010
21214
  __exports__["default"] = NativeArray;
21011
21215
  });
21012
21216
  define("ember-runtime/system/object",
21013
- ["ember-metal/core","ember-runtime/system/core_object","ember-runtime/mixins/observable","ember-runtime/inject","exports"],
21014
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
21217
+ ["ember-runtime/system/core_object","ember-runtime/mixins/observable","exports"],
21218
+ function(__dependency1__, __dependency2__, __exports__) {
21015
21219
  "use strict";
21016
21220
  /**
21017
21221
  @module ember
21018
21222
  @submodule ember-runtime
21019
21223
  */
21020
21224
 
21021
- var Ember = __dependency1__["default"];
21022
- // Ember.assert
21023
- var CoreObject = __dependency2__["default"];
21024
- var Observable = __dependency3__["default"];
21025
- var validatePropertyInjections = __dependency4__.validatePropertyInjections;
21225
+ var CoreObject = __dependency1__["default"];
21226
+ var Observable = __dependency2__["default"];
21026
21227
 
21027
21228
  /**
21028
21229
  `Ember.Object` is the main base class for all Ember objects. It is a subclass
@@ -21039,13 +21240,6 @@ define("ember-runtime/system/object",
21039
21240
  return "Ember.Object";
21040
21241
  };
21041
21242
 
21042
- function injectedPropertyAssertion(props) {
21043
- // Injection validations are a debugging aid only, so ensure that they are
21044
- // not performed in production builds by invoking from an assertion
21045
- Ember.assert("Injected properties are invalid", validatePropertyInjections(this.constructor, props));
21046
- }
21047
-
21048
-
21049
21243
  __exports__["default"] = EmberObject;
21050
21244
  });
21051
21245
  define("ember-runtime/system/object_proxy",
@@ -21136,6 +21330,42 @@ define("ember-runtime/system/service",
21136
21330
  var Service;
21137
21331
 
21138
21332
 
21333
+ /**
21334
+ @class Service
21335
+ @namespace Ember
21336
+ @extends Ember.Object
21337
+ */
21338
+ Service = Object.extend();
21339
+
21340
+ /**
21341
+ Creates a property that lazily looks up a service in the container. There
21342
+ are no restrictions as to what objects a service can be injected into.
21343
+
21344
+ Example:
21345
+
21346
+ ```javascript
21347
+ App.ApplicationRoute = Ember.Route.extend({
21348
+ authManager: Ember.inject.service('auth'),
21349
+
21350
+ model: function() {
21351
+ return this.get('authManager').findCurrentUser();
21352
+ }
21353
+ });
21354
+ ```
21355
+
21356
+ This example will create an `authManager` property on the application route
21357
+ that looks up the `auth` service in the container, making it easily
21358
+ accessible in the `model` hook.
21359
+
21360
+ @method inject.service
21361
+ @for Ember
21362
+ @param {String} name (optional) name of the service to inject, defaults to
21363
+ the property's name
21364
+ @return {Ember.InjectedProperty} injection descriptor instance
21365
+ */
21366
+ createInjectionHelper('service');
21367
+
21368
+
21139
21369
  __exports__["default"] = Service;
21140
21370
  });
21141
21371
  define("ember-runtime/system/set",