ember-source 1.0.0.rc3.4 → 1.0.0.rc3.5

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.

@@ -1,5 +1,5 @@
1
- // Version: v1.0.0-rc.3-251-gcd5dfe3
2
- // Last commit: cd5dfe3 (2013-05-18 11:06:43 -0700)
1
+ // Version: v1.0.0-rc.3-2-g85bfdbf
2
+ // Last commit: 85bfdbf (2013-07-25 20:16:20 -0400)
3
3
 
4
4
 
5
5
  (function() {
@@ -151,8 +151,8 @@ Ember.deprecateFunc = function(message, func) {
151
151
 
152
152
  })();
153
153
 
154
- // Version: v1.0.0-rc.3-251-gcd5dfe3
155
- // Last commit: cd5dfe3 (2013-05-18 11:06:43 -0700)
154
+ // Version: v1.0.0-rc.3-2-g85bfdbf
155
+ // Last commit: 85bfdbf (2013-07-25 20:16:20 -0400)
156
156
 
157
157
 
158
158
  (function() {
@@ -467,7 +467,7 @@ Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isN
467
467
  @return {Boolean}
468
468
  */
469
469
  Ember.isEmpty = function(obj) {
470
- return Ember.isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
470
+ return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
471
471
  };
472
472
  Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty) ;
473
473
 
@@ -500,13 +500,6 @@ var platform = Ember.platform = {};
500
500
  */
501
501
  Ember.create = Object.create;
502
502
 
503
- // IE8 has Object.create but it couldn't treat property descripters.
504
- if (Ember.create) {
505
- if (Ember.create({a: 1}, {a: {value: 2}}).a !== 2) {
506
- Ember.create = null;
507
- }
508
- }
509
-
510
503
  // STUB_OBJECT_CREATE allows us to override other libraries that stub
511
504
  // Object.create different than we would prefer
512
505
  if (!Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {
@@ -827,7 +820,7 @@ Ember.guidFor = function guidFor(obj) {
827
820
  if (obj === undefined) return "(undefined)";
828
821
  if (obj === null) return "(null)";
829
822
 
830
- var ret;
823
+ var cache, ret;
831
824
  var type = typeof obj;
832
825
 
833
826
  // Don't allow prototype changes to String etc. to change the guidFor
@@ -1228,7 +1221,7 @@ if (needsFinallyFix) {
1228
1221
  */
1229
1222
  if (needsFinallyFix) {
1230
1223
  Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {
1231
- var result, finalResult, finalError;
1224
+ var result, finalResult, finalError, finalReturn;
1232
1225
 
1233
1226
  binding = binding || this;
1234
1227
 
@@ -1999,12 +1992,13 @@ get = function get(obj, keyName) {
1999
1992
  obj = null;
2000
1993
  }
2001
1994
 
2002
- Ember.assert("Cannot call get with '"+ keyName +"' on an undefined object.", obj !== undefined);
2003
-
2004
- if (obj === null || keyName.indexOf('.') !== -1) {
1995
+ if (!obj || keyName.indexOf('.') !== -1) {
1996
+ Ember.assert("Cannot call get with '"+ keyName +"' on an undefined object.", obj !== undefined);
2005
1997
  return getPath(obj, keyName);
2006
1998
  }
2007
1999
 
2000
+ Ember.assert("You need to provide an object and key to `get`.", !!obj && keyName);
2001
+
2008
2002
  var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;
2009
2003
  if (desc) {
2010
2004
  return desc.get(obj, keyName);
@@ -2076,7 +2070,7 @@ var getPath = Ember._getPath = function(root, path) {
2076
2070
 
2077
2071
  parts = path.split(".");
2078
2072
  len = parts.length;
2079
- for (idx=0; root !== undefined && root !== null && idx<len; idx++) {
2073
+ for (idx=0; root && idx<len; idx++) {
2080
2074
  root = get(root, parts[idx], true);
2081
2075
  if (root && root.isDestroyed) { return undefined; }
2082
2076
  }
@@ -2122,9 +2116,7 @@ Ember.getPath = Ember.deprecateFunc('getPath is deprecated since get now support
2122
2116
 
2123
2117
  var o_create = Ember.create,
2124
2118
  metaFor = Ember.meta,
2125
- META_KEY = Ember.META_KEY,
2126
- /* listener flags */
2127
- ONCE = 1, SUSPENDED = 2;
2119
+ META_KEY = Ember.META_KEY;
2128
2120
 
2129
2121
  /*
2130
2122
  The event system uses a series of nested hashes to store listeners on an
@@ -2137,7 +2129,7 @@ var o_create = Ember.create,
2137
2129
  {
2138
2130
  listeners: { // variable name: `listenerSet`
2139
2131
  "foo:changed": [ // variable name: `actions`
2140
- [target, method, flags]
2132
+ [target, method, onceFlag, suspendedFlag]
2141
2133
  ]
2142
2134
  }
2143
2135
  }
@@ -2183,11 +2175,12 @@ function actionsUnion(obj, eventName, otherActions) {
2183
2175
  for (var i = actions.length - 1; i >= 0; i--) {
2184
2176
  var target = actions[i][0],
2185
2177
  method = actions[i][1],
2186
- flags = actions[i][2],
2178
+ once = actions[i][2],
2179
+ suspended = actions[i][3],
2187
2180
  actionIndex = indexOf(otherActions, target, method);
2188
2181
 
2189
2182
  if (actionIndex === -1) {
2190
- otherActions.push([target, method, flags]);
2183
+ otherActions.push([target, method, once, suspended]);
2191
2184
  }
2192
2185
  }
2193
2186
  }
@@ -2201,13 +2194,14 @@ function actionsDiff(obj, eventName, otherActions) {
2201
2194
  for (var i = actions.length - 1; i >= 0; i--) {
2202
2195
  var target = actions[i][0],
2203
2196
  method = actions[i][1],
2204
- flags = actions[i][2],
2197
+ once = actions[i][2],
2198
+ suspended = actions[i][3],
2205
2199
  actionIndex = indexOf(otherActions, target, method);
2206
2200
 
2207
2201
  if (actionIndex !== -1) { continue; }
2208
2202
 
2209
- otherActions.push([target, method, flags]);
2210
- diffActions.push([target, method, flags]);
2203
+ otherActions.push([target, method, once, suspended]);
2204
+ diffActions.push([target, method, once, suspended]);
2211
2205
  }
2212
2206
 
2213
2207
  return diffActions;
@@ -2233,14 +2227,11 @@ function addListener(obj, eventName, target, method, once) {
2233
2227
  }
2234
2228
 
2235
2229
  var actions = actionsFor(obj, eventName),
2236
- actionIndex = indexOf(actions, target, method),
2237
- flags = 0;
2238
-
2239
- if (once) flags |= ONCE;
2230
+ actionIndex = indexOf(actions, target, method);
2240
2231
 
2241
2232
  if (actionIndex !== -1) { return; }
2242
2233
 
2243
- actions.push([target, method, flags]);
2234
+ actions.push([target, method, once, undefined]);
2244
2235
 
2245
2236
  if ('function' === typeof obj.didAddListener) {
2246
2237
  obj.didAddListener(eventName, target, method);
@@ -2267,7 +2258,7 @@ function removeListener(obj, eventName, target, method) {
2267
2258
  target = null;
2268
2259
  }
2269
2260
 
2270
- function _removeListener(target, method) {
2261
+ function _removeListener(target, method, once) {
2271
2262
  var actions = actionsFor(obj, eventName),
2272
2263
  actionIndex = indexOf(actions, target, method);
2273
2264
 
@@ -2324,12 +2315,12 @@ function suspendListener(obj, eventName, target, method, callback) {
2324
2315
 
2325
2316
  if (actionIndex !== -1) {
2326
2317
  action = actions[actionIndex].slice(); // copy it, otherwise we're modifying a shared object
2327
- action[2] |= SUSPENDED; // mark the action as suspended
2318
+ action[3] = true; // mark the action as suspended
2328
2319
  actions[actionIndex] = action; // replace the shared object with our copy
2329
2320
  }
2330
2321
 
2331
2322
  function tryable() { return callback.call(target); }
2332
- function finalizer() { if (action) { action[2] &= ~SUSPENDED; } }
2323
+ function finalizer() { if (action) { action[3] = undefined; } }
2333
2324
 
2334
2325
  return Ember.tryFinally(tryable, finalizer);
2335
2326
  }
@@ -2368,7 +2359,7 @@ function suspendListeners(obj, eventNames, target, method, callback) {
2368
2359
 
2369
2360
  if (actionIndex !== -1) {
2370
2361
  action = actions[actionIndex].slice();
2371
- action[2] |= SUSPENDED;
2362
+ action[3] = true;
2372
2363
  actions[actionIndex] = action;
2373
2364
  suspendedActions.push(action);
2374
2365
  }
@@ -2378,7 +2369,7 @@ function suspendListeners(obj, eventNames, target, method, callback) {
2378
2369
 
2379
2370
  function finalizer() {
2380
2371
  for (i = 0, l = suspendedActions.length; i < l; i++) {
2381
- suspendedActions[i][2] &= ~SUSPENDED;
2372
+ suspendedActions[i][3] = undefined;
2382
2373
  }
2383
2374
  }
2384
2375
 
@@ -2428,11 +2419,13 @@ function sendEvent(obj, eventName, params, actions) {
2428
2419
  if (!actions) { return; }
2429
2420
 
2430
2421
  for (var i = actions.length - 1; i >= 0; i--) { // looping in reverse for once listeners
2431
- var action = actions[i];
2432
- if (!action) { continue; }
2433
- var target = action[0], method = action[1], flags = action[2];
2434
- if (flags & SUSPENDED) { continue; }
2435
- if (flags & ONCE) { removeListener(obj, eventName, target, method); }
2422
+ if (!actions[i] || actions[i][3] === true) { continue; }
2423
+
2424
+ var target = actions[i][0],
2425
+ method = actions[i][1],
2426
+ once = actions[i][2];
2427
+
2428
+ if (once) { removeListener(obj, eventName, target, method); }
2436
2429
  if (!target) { target = obj; }
2437
2430
  if ('string' === typeof method) { method = target[method]; }
2438
2431
  if (params) {
@@ -2512,7 +2505,7 @@ var guidFor = Ember.guidFor,
2512
2505
  keyName: keyName,
2513
2506
  eventName: eventName,
2514
2507
  listeners: [
2515
- [target, method, flags]
2508
+ [target, method, onceFlag, suspendedFlag]
2516
2509
  ]
2517
2510
  },
2518
2511
  ...
@@ -2741,11 +2734,11 @@ var endPropertyChanges = Ember.endPropertyChanges = function() {
2741
2734
  });
2742
2735
  ```
2743
2736
 
2744
- @method changeProperties
2737
+ @method changePropertiess
2745
2738
  @param {Function} callback
2746
2739
  @param [binding]
2747
2740
  */
2748
- Ember.changeProperties = function(cb, binding){
2741
+ var changeProperties = Ember.changeProperties = function(cb, binding){
2749
2742
  beginPropertyChanges();
2750
2743
  tryFinally(cb, endPropertyChanges, binding);
2751
2744
  };
@@ -2950,7 +2943,7 @@ var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
2950
2943
  @private
2951
2944
  @constructor
2952
2945
  */
2953
- Ember.Descriptor = function() {};
2946
+ var Descriptor = Ember.Descriptor = function() {};
2954
2947
 
2955
2948
  // ..........................................................
2956
2949
  // DEFINING PROPERTIES API
@@ -3511,7 +3504,7 @@ Ember.watchPath = function(obj, keyPath) {
3511
3504
  };
3512
3505
 
3513
3506
  Ember.unwatchPath = function(obj, keyPath) {
3514
- var m = metaFor(obj), watching = m.watching;
3507
+ var m = metaFor(obj), watching = m.watching, desc;
3515
3508
 
3516
3509
  if (watching[keyPath] === 1) {
3517
3510
  watching[keyPath] = 0;
@@ -4057,6 +4050,7 @@ ComputedPropertyPrototype.teardown = function(obj, keyName) {
4057
4050
  The function should accept two parameters, key and value. If value is not
4058
4051
  undefined you should set the value first. In either case return the
4059
4052
  current value of the property.
4053
+
4060
4054
  @method computed
4061
4055
  @for Ember
4062
4056
  @param {Function} func The computed property function.
@@ -4298,7 +4292,7 @@ registerComputedWithProperties('or', function(properties) {
4298
4292
  @for Ember
4299
4293
  @param {String} dependentKey, [dependentKey...]
4300
4294
  @return {Ember.ComputedProperty} computed property which returns
4301
- the first truthy value of given list of properties.
4295
+ the first trouthy value of given list of properties.
4302
4296
  */
4303
4297
  registerComputedWithProperties('any', function(properties) {
4304
4298
  for (var key in properties) {
@@ -4348,48 +4342,6 @@ Ember.computed.alias = function(dependentKey) {
4348
4342
  });
4349
4343
  };
4350
4344
 
4351
- /**
4352
- @method computed.oneWay
4353
- @for Ember
4354
- @param {String} dependentKey
4355
- @return {Ember.ComputedProperty} computed property which creates an
4356
- one way computed property to the original value for property.
4357
-
4358
- Where `computed.alias` aliases `get` and `set`, and allows for bidirectional
4359
- data flow, `computed.oneWay` only provides an aliased `get`. The `set` will
4360
- not mutate the upstream property, rather causes the current property to
4361
- become the value set. This causes the downstream property to permentantly
4362
- diverge from the upstream property.
4363
-
4364
- ```javascript
4365
- User = Ember.Object.extend({
4366
- firstName: null,
4367
- lastName: null,
4368
- nickName: Ember.computed.oneWay('firstName')
4369
- });
4370
-
4371
- user = User.create({
4372
- firstName: 'Teddy',
4373
- lastName: 'Zeenny'
4374
- });
4375
-
4376
- user.get('nickName');
4377
- # 'Teddy'
4378
-
4379
- user.set('nickName', 'TeddyBear');
4380
- # 'TeddyBear'
4381
-
4382
- user.get('firstName');
4383
- # 'Teddy'
4384
- ```
4385
- */
4386
- Ember.computed.oneWay = function(dependentKey) {
4387
- return Ember.computed(dependentKey, function() {
4388
- return get(this, dependentKey);
4389
- });
4390
- };
4391
-
4392
-
4393
4345
  /**
4394
4346
  @method computed.defaultTo
4395
4347
  @for Ember
@@ -4419,6 +4371,8 @@ Ember.computed.defaultTo = function(defaultPath) {
4419
4371
  var AFTER_OBSERVERS = ':change';
4420
4372
  var BEFORE_OBSERVERS = ':before';
4421
4373
 
4374
+ var guidFor = Ember.guidFor;
4375
+
4422
4376
  function changeEvent(keyName) {
4423
4377
  return keyName+AFTER_OBSERVERS;
4424
4378
  }
@@ -4910,44 +4864,27 @@ Ember.run.sync = function() {
4910
4864
 
4911
4865
  var timers = {}; // active timers...
4912
4866
 
4913
- function sortByExpires(timerA, timerB) {
4914
- var a = timerA.expires,
4915
- b = timerB.expires;
4916
-
4917
- if (a > b) { return 1; }
4918
- if (a < b) { return -1; }
4919
- return 0;
4920
- }
4921
-
4922
4867
  var scheduledLater, scheduledLaterExpires;
4923
4868
  function invokeLaterTimers() {
4924
4869
  scheduledLater = null;
4925
4870
  run(function() {
4926
4871
  var now = (+ new Date()), earliest = -1;
4927
- var timersToBeInvoked = [];
4928
4872
  for (var key in timers) {
4929
4873
  if (!timers.hasOwnProperty(key)) { continue; }
4930
4874
  var timer = timers[key];
4931
4875
  if (timer && timer.expires) {
4932
4876
  if (now >= timer.expires) {
4933
4877
  delete timers[key];
4934
- timersToBeInvoked.push(timer);
4878
+ invoke(timer.target, timer.method, timer.args, 2);
4935
4879
  } else {
4936
4880
  if (earliest < 0 || (timer.expires < earliest)) { earliest = timer.expires; }
4937
4881
  }
4938
4882
  }
4939
4883
  }
4940
4884
 
4941
- forEach.call(timersToBeInvoked.sort(sortByExpires), function(timer) {
4942
- invoke(timer.target, timer.method, timer.args, 2);
4943
- });
4944
-
4945
4885
  // schedule next timeout to fire when the earliest timer expires
4946
4886
  if (earliest > 0) {
4947
- // To allow overwrite `setTimeout` as stub from test code.
4948
- // The assignment to `window.setTimeout` doesn't equal to `setTimeout` in older IE.
4949
- // So `window` is required.
4950
- scheduledLater = window.setTimeout(invokeLaterTimers, earliest - now);
4887
+ scheduledLater = setTimeout(invokeLaterTimers, earliest - now);
4951
4888
  scheduledLaterExpires = earliest;
4952
4889
  }
4953
4890
  });
@@ -5577,7 +5514,7 @@ mixinProperties(Binding, {
5577
5514
 
5578
5515
  You should consider using one way bindings anytime you have an object that
5579
5516
  may be created frequently and you do not intend to change a property; only
5580
- to monitor it for changes (such as in the example above).
5517
+ to monitor it for changes. (such as in the example above).
5581
5518
 
5582
5519
  ## Adding Bindings Manually
5583
5520
 
@@ -5878,6 +5815,14 @@ function mergeMixins(mixins, m, descs, values, base, keys) {
5878
5815
  }
5879
5816
  }
5880
5817
 
5818
+ function writableReq(obj) {
5819
+ var m = Ember.meta(obj), req = m.required;
5820
+ if (!req || !m.hasOwnProperty('required')) {
5821
+ req = m.required = req ? o_create(req) : {};
5822
+ }
5823
+ return req;
5824
+ }
5825
+
5881
5826
  var IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;
5882
5827
 
5883
5828
  function detectBinding(obj, key, value, m) {
@@ -6363,57 +6308,14 @@ Ember Metal
6363
6308
  })();
6364
6309
 
6365
6310
  (function() {
6366
- define("rsvp/all",
6367
- ["rsvp/defer","exports"],
6368
- function(__dependency1__, __exports__) {
6369
- "use strict";
6370
- var defer = __dependency1__.defer;
6371
-
6372
- function all(promises) {
6373
- var results = [], deferred = defer(), remaining = promises.length;
6374
-
6375
- if (remaining === 0) {
6376
- deferred.resolve([]);
6377
- }
6378
-
6379
- var resolver = function(index) {
6380
- return function(value) {
6381
- resolveAll(index, value);
6382
- };
6383
- };
6384
-
6385
- var resolveAll = function(index, value) {
6386
- results[index] = value;
6387
- if (--remaining === 0) {
6388
- deferred.resolve(results);
6389
- }
6390
- };
6391
-
6392
- var rejectAll = function(error) {
6393
- deferred.reject(error);
6394
- };
6395
-
6396
- for (var i = 0; i < promises.length; i++) {
6397
- if (promises[i] && typeof promises[i].then === 'function') {
6398
- promises[i].then(resolver(i), rejectAll);
6399
- } else {
6400
- resolveAll(i, promises[i]);
6401
- }
6402
- }
6403
- return deferred.promise;
6404
- }
6405
-
6406
- __exports__.all = all;
6407
- });
6408
-
6409
- define("rsvp/async",
6410
- ["exports"],
6411
- function(__exports__) {
6311
+ define("rsvp",
6312
+ [],
6313
+ function() {
6412
6314
  "use strict";
6413
6315
  var browserGlobal = (typeof window !== 'undefined') ? window : {};
6414
6316
 
6415
- var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
6416
- var async;
6317
+ var MutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
6318
+ var RSVP, async;
6417
6319
 
6418
6320
  if (typeof process !== 'undefined' &&
6419
6321
  {}.toString.call(process) === '[object process]') {
@@ -6422,10 +6324,10 @@ define("rsvp/async",
6422
6324
  callback.call(binding);
6423
6325
  });
6424
6326
  };
6425
- } else if (BrowserMutationObserver) {
6327
+ } else if (MutationObserver) {
6426
6328
  var queue = [];
6427
6329
 
6428
- var observer = new BrowserMutationObserver(function() {
6330
+ var observer = new MutationObserver(function() {
6429
6331
  var toProcess = queue.slice();
6430
6332
  queue = [];
6431
6333
 
@@ -6456,47 +6358,6 @@ define("rsvp/async",
6456
6358
  };
6457
6359
  }
6458
6360
 
6459
-
6460
- __exports__.async = async;
6461
- });
6462
-
6463
- define("rsvp/config",
6464
- ["rsvp/async","exports"],
6465
- function(__dependency1__, __exports__) {
6466
- "use strict";
6467
- var async = __dependency1__.async;
6468
-
6469
- var config = {};
6470
- config.async = async;
6471
-
6472
- __exports__.config = config;
6473
- });
6474
-
6475
- define("rsvp/defer",
6476
- ["rsvp/promise","exports"],
6477
- function(__dependency1__, __exports__) {
6478
- "use strict";
6479
- var Promise = __dependency1__.Promise;
6480
-
6481
- function defer() {
6482
- var deferred = {};
6483
-
6484
- var promise = new Promise(function(resolve, reject) {
6485
- deferred.resolve = resolve;
6486
- deferred.reject = reject;
6487
- });
6488
-
6489
- deferred.promise = promise;
6490
- return deferred;
6491
- }
6492
-
6493
- __exports__.defer = defer;
6494
- });
6495
-
6496
- define("rsvp/events",
6497
- ["exports"],
6498
- function(__exports__) {
6499
- "use strict";
6500
6361
  var Event = function(type, options) {
6501
6362
  this.type = type;
6502
6363
 
@@ -6591,148 +6452,7 @@ define("rsvp/events",
6591
6452
  }
6592
6453
  };
6593
6454
 
6594
-
6595
- __exports__.EventTarget = EventTarget;
6596
- });
6597
-
6598
- define("rsvp/hash",
6599
- ["rsvp/defer","exports"],
6600
- function(__dependency1__, __exports__) {
6601
- "use strict";
6602
- var defer = __dependency1__.defer;
6603
-
6604
- function size(object) {
6605
- var size = 0;
6606
-
6607
- for (var prop in object) {
6608
- size++;
6609
- }
6610
-
6611
- return size;
6612
- }
6613
-
6614
- function hash(promises) {
6615
- var results = {}, deferred = defer(), remaining = size(promises);
6616
-
6617
- if (remaining === 0) {
6618
- deferred.resolve({});
6619
- }
6620
-
6621
- var resolver = function(prop) {
6622
- return function(value) {
6623
- resolveAll(prop, value);
6624
- };
6625
- };
6626
-
6627
- var resolveAll = function(prop, value) {
6628
- results[prop] = value;
6629
- if (--remaining === 0) {
6630
- deferred.resolve(results);
6631
- }
6632
- };
6633
-
6634
- var rejectAll = function(error) {
6635
- deferred.reject(error);
6636
- };
6637
-
6638
- for (var prop in promises) {
6639
- if (promises[prop] && typeof promises[prop].then === 'function') {
6640
- promises[prop].then(resolver(prop), rejectAll);
6641
- } else {
6642
- resolveAll(prop, promises[prop]);
6643
- }
6644
- }
6645
-
6646
- return deferred.promise;
6647
- }
6648
-
6649
- __exports__.hash = hash;
6650
- });
6651
-
6652
- define("rsvp/node",
6653
- ["rsvp/promise","rsvp/all","exports"],
6654
- function(__dependency1__, __dependency2__, __exports__) {
6655
- "use strict";
6656
- var Promise = __dependency1__.Promise;
6657
- var all = __dependency2__.all;
6658
-
6659
- function makeNodeCallbackFor(resolve, reject) {
6660
- return function (error, value) {
6661
- if (error) {
6662
- reject(error);
6663
- } else if (arguments.length > 2) {
6664
- resolve(Array.prototype.slice.call(arguments, 1));
6665
- } else {
6666
- resolve(value);
6667
- }
6668
- };
6669
- }
6670
-
6671
- function denodeify(nodeFunc) {
6672
- return function() {
6673
- var nodeArgs = Array.prototype.slice.call(arguments), resolve, reject;
6674
-
6675
- var promise = new Promise(function(nodeResolve, nodeReject) {
6676
- resolve = nodeResolve;
6677
- reject = nodeReject;
6678
- });
6679
-
6680
- all(nodeArgs).then(function(nodeArgs) {
6681
- nodeArgs.push(makeNodeCallbackFor(resolve, reject));
6682
-
6683
- try {
6684
- nodeFunc.apply(this, nodeArgs);
6685
- } catch(e) {
6686
- reject(e);
6687
- }
6688
- });
6689
-
6690
- return promise;
6691
- };
6692
- }
6693
-
6694
- __exports__.denodeify = denodeify;
6695
- });
6696
-
6697
- define("rsvp/promise",
6698
- ["rsvp/config","rsvp/events","exports"],
6699
- function(__dependency1__, __dependency2__, __exports__) {
6700
- "use strict";
6701
- var config = __dependency1__.config;
6702
- var EventTarget = __dependency2__.EventTarget;
6703
-
6704
- function objectOrFunction(x) {
6705
- return isFunction(x) || (typeof x === "object" && x !== null);
6706
- }
6707
-
6708
- function isFunction(x){
6709
- return typeof x === "function";
6710
- }
6711
-
6712
- var Promise = function(resolver) {
6713
- var promise = this,
6714
- resolved = false;
6715
-
6716
- if (typeof resolver !== 'function') {
6717
- throw new TypeError('You must pass a resolver function as the sole argument to the promise constructor');
6718
- }
6719
-
6720
- if (!(promise instanceof Promise)) {
6721
- return new Promise(resolver);
6722
- }
6723
-
6724
- var resolvePromise = function(value) {
6725
- if (resolved) { return; }
6726
- resolved = true;
6727
- resolve(promise, value);
6728
- };
6729
-
6730
- var rejectPromise = function(value) {
6731
- if (resolved) { return; }
6732
- resolved = true;
6733
- reject(promise, value);
6734
- };
6735
-
6455
+ var Promise = function() {
6736
6456
  this.on('promise:resolved', function(event) {
6737
6457
  this.trigger('success', { detail: event.detail });
6738
6458
  }, this);
@@ -6740,16 +6460,12 @@ define("rsvp/promise",
6740
6460
  this.on('promise:failed', function(event) {
6741
6461
  this.trigger('error', { detail: event.detail });
6742
6462
  }, this);
6743
-
6744
- try {
6745
- resolver(resolvePromise, rejectPromise);
6746
- } catch(e) {
6747
- rejectPromise(e);
6748
- }
6749
6463
  };
6750
6464
 
6465
+ var noop = function() {};
6466
+
6751
6467
  var invokeCallback = function(type, promise, callback, event) {
6752
- var hasCallback = isFunction(callback),
6468
+ var hasCallback = typeof callback === 'function',
6753
6469
  value, error, succeeded, failed;
6754
6470
 
6755
6471
  if (hasCallback) {
@@ -6765,34 +6481,34 @@ define("rsvp/promise",
6765
6481
  succeeded = true;
6766
6482
  }
6767
6483
 
6768
- if (handleThenable(promise, value)) {
6769
- return;
6484
+ if (value && typeof value.then === 'function') {
6485
+ value.then(function(value) {
6486
+ promise.resolve(value);
6487
+ }, function(error) {
6488
+ promise.reject(error);
6489
+ });
6770
6490
  } else if (hasCallback && succeeded) {
6771
- resolve(promise, value);
6491
+ promise.resolve(value);
6772
6492
  } else if (failed) {
6773
- reject(promise, error);
6774
- } else if (type === 'resolve') {
6775
- resolve(promise, value);
6776
- } else if (type === 'reject') {
6777
- reject(promise, value);
6493
+ promise.reject(error);
6494
+ } else {
6495
+ promise[type](value);
6778
6496
  }
6779
6497
  };
6780
6498
 
6781
6499
  Promise.prototype = {
6782
- constructor: Promise,
6783
-
6784
6500
  then: function(done, fail) {
6785
- var thenPromise = new Promise(function() {});
6501
+ var thenPromise = new Promise();
6786
6502
 
6787
- if (this.isFulfilled) {
6788
- config.async(function() {
6789
- invokeCallback('resolve', thenPromise, done, { detail: this.fulfillmentValue });
6503
+ if (this.isResolved) {
6504
+ RSVP.async(function() {
6505
+ invokeCallback('resolve', thenPromise, done, { detail: this.resolvedValue });
6790
6506
  }, this);
6791
6507
  }
6792
6508
 
6793
6509
  if (this.isRejected) {
6794
- config.async(function() {
6795
- invokeCallback('reject', thenPromise, fail, { detail: this.rejectedReason });
6510
+ RSVP.async(function() {
6511
+ invokeCallback('reject', thenPromise, fail, { detail: this.rejectedValue });
6796
6512
  }, this);
6797
6513
  }
6798
6514
 
@@ -6805,162 +6521,75 @@ define("rsvp/promise",
6805
6521
  });
6806
6522
 
6807
6523
  return thenPromise;
6808
- }
6809
- };
6524
+ },
6810
6525
 
6811
- EventTarget.mixin(Promise.prototype);
6526
+ resolve: function(value) {
6527
+ resolve(this, value);
6812
6528
 
6813
- function resolve(promise, value) {
6814
- if (promise === value) {
6815
- fulfill(promise, value);
6816
- } else if (!handleThenable(promise, value)) {
6817
- fulfill(promise, value);
6818
- }
6819
- }
6529
+ this.resolve = noop;
6530
+ this.reject = noop;
6531
+ },
6820
6532
 
6821
- function handleThenable(promise, value) {
6822
- var then = null;
6533
+ reject: function(value) {
6534
+ reject(this, value);
6823
6535
 
6824
- if (objectOrFunction(value)) {
6825
- try {
6826
- then = value.then;
6827
- } catch(e) {
6828
- reject(promise, e);
6829
- return true;
6830
- }
6831
-
6832
- if (isFunction(then)) {
6833
- try {
6834
- then.call(value, function(val) {
6835
- if (value !== val) {
6836
- resolve(promise, val);
6837
- } else {
6838
- fulfill(promise, val);
6839
- }
6840
- }, function(val) {
6841
- reject(promise, val);
6842
- });
6843
- } catch (e) {
6844
- reject(promise, e);
6845
- }
6846
- return true;
6847
- }
6536
+ this.resolve = noop;
6537
+ this.reject = noop;
6848
6538
  }
6539
+ };
6849
6540
 
6850
- return false;
6851
- }
6852
-
6853
- function fulfill(promise, value) {
6854
- config.async(function() {
6541
+ function resolve(promise, value) {
6542
+ RSVP.async(function() {
6855
6543
  promise.trigger('promise:resolved', { detail: value });
6856
- promise.isFulfilled = true;
6857
- promise.fulfillmentValue = value;
6544
+ promise.isResolved = true;
6545
+ promise.resolvedValue = value;
6858
6546
  });
6859
6547
  }
6860
6548
 
6861
6549
  function reject(promise, value) {
6862
- config.async(function() {
6550
+ RSVP.async(function() {
6863
6551
  promise.trigger('promise:failed', { detail: value });
6864
6552
  promise.isRejected = true;
6865
- promise.rejectedReason = value;
6553
+ promise.rejectedValue = value;
6866
6554
  });
6867
6555
  }
6868
6556
 
6557
+ function all(promises) {
6558
+ var i, results = [];
6559
+ var allPromise = new Promise();
6560
+ var remaining = promises.length;
6869
6561
 
6870
- __exports__.Promise = Promise;
6871
- });
6872
-
6873
- define("rsvp/reject",
6874
- ["rsvp/promise","exports"],
6875
- function(__dependency1__, __exports__) {
6876
- "use strict";
6877
- var Promise = __dependency1__.Promise;
6878
-
6879
-
6880
- function objectOrFunction(x) {
6881
- return typeof x === "function" || (typeof x === "object" && x !== null);
6882
- }
6883
-
6884
-
6885
- function reject(reason) {
6886
- return new Promise(function (resolve, reject) {
6887
- reject(reason);
6888
- });
6889
- }
6890
-
6891
-
6892
- __exports__.reject = reject;
6893
- });
6894
-
6895
- define("rsvp/resolve",
6896
- ["rsvp/promise","exports"],
6897
- function(__dependency1__, __exports__) {
6898
- "use strict";
6899
- var Promise = __dependency1__.Promise;
6900
-
6901
-
6902
- function objectOrFunction(x) {
6903
- return typeof x === "function" || (typeof x === "object" && x !== null);
6904
- }
6905
-
6906
- function resolve(thenable){
6907
- var promise = new Promise(function(resolve, reject){
6908
- var then;
6909
-
6910
- try {
6911
- if ( objectOrFunction(thenable) ) {
6912
- then = thenable.then;
6913
-
6914
- if (typeof then === "function") {
6915
- then.call(thenable, resolve, reject);
6916
- } else {
6917
- resolve(thenable);
6918
- }
6562
+ if (remaining === 0) {
6563
+ allPromise.resolve([]);
6564
+ }
6919
6565
 
6920
- } else {
6921
- resolve(thenable);
6922
- }
6566
+ var resolver = function(index) {
6567
+ return function(value) {
6568
+ resolve(index, value);
6569
+ };
6570
+ };
6923
6571
 
6924
- } catch(error) {
6925
- reject(error);
6572
+ var resolve = function(index, value) {
6573
+ results[index] = value;
6574
+ if (--remaining === 0) {
6575
+ allPromise.resolve(results);
6926
6576
  }
6927
- });
6577
+ };
6928
6578
 
6929
- return promise;
6930
- }
6579
+ var reject = function(error) {
6580
+ allPromise.reject(error);
6581
+ };
6931
6582
 
6583
+ for (i = 0; i < remaining; i++) {
6584
+ promises[i].then(resolver(i), reject);
6585
+ }
6586
+ return allPromise;
6587
+ }
6932
6588
 
6933
- __exports__.resolve = resolve;
6934
- });
6589
+ EventTarget.mixin(Promise.prototype);
6935
6590
 
6936
- define("rsvp",
6937
- ["rsvp/events","rsvp/promise","rsvp/node","rsvp/all","rsvp/hash","rsvp/defer","rsvp/config","rsvp/resolve","rsvp/reject","exports"],
6938
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {
6939
- "use strict";
6940
- var EventTarget = __dependency1__.EventTarget;
6941
- var Promise = __dependency2__.Promise;
6942
- var denodeify = __dependency3__.denodeify;
6943
- var all = __dependency4__.all;
6944
- var hash = __dependency5__.hash;
6945
- var defer = __dependency6__.defer;
6946
- var config = __dependency7__.config;
6947
- var resolve = __dependency8__.resolve;
6948
- var reject = __dependency9__.reject;
6949
-
6950
- function configure(name, value) {
6951
- config[name] = value;
6952
- }
6953
-
6954
-
6955
- __exports__.Promise = Promise;
6956
- __exports__.EventTarget = EventTarget;
6957
- __exports__.all = all;
6958
- __exports__.hash = hash;
6959
- __exports__.defer = defer;
6960
- __exports__.denodeify = denodeify;
6961
- __exports__.configure = configure;
6962
- __exports__.resolve = resolve;
6963
- __exports__.reject = reject;
6591
+ RSVP = { async: async, Promise: Promise, Event: Event, EventTarget: EventTarget, all: all, raiseOnUncaughtExceptions: true };
6592
+ return RSVP;
6964
6593
  });
6965
6594
 
6966
6595
  })();
@@ -7536,7 +7165,7 @@ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'n
7536
7165
  @constructor
7537
7166
  */
7538
7167
  Ember.Error = function() {
7539
- var tmp = Error.apply(this, arguments);
7168
+ var tmp = Error.prototype.constructor.apply(this, arguments);
7540
7169
 
7541
7170
  // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
7542
7171
  for (var idx = 0; idx < errorProps.length; idx++) {
@@ -7798,12 +7427,10 @@ Ember.String = {
7798
7427
  /**
7799
7428
  Returns the Capitalized form of a string
7800
7429
 
7801
- ```javascript
7802
- 'innerHTML'.capitalize() // 'InnerHTML'
7803
- 'action_name'.capitalize() // 'Action_name'
7804
- 'css-class-name'.capitalize() // 'Css-class-name'
7805
- 'my favorite items'.capitalize() // 'My favorite items'
7806
- ```
7430
+ 'innerHTML'.capitalize() // 'InnerHTML'
7431
+ 'action_name'.capitalize() // 'Action_name'
7432
+ 'css-class-name'.capitalize() // 'Css-class-name'
7433
+ 'my favorite items'.capitalize() // 'My favorite items'
7807
7434
 
7808
7435
  @method capitalize
7809
7436
  @param {String} str
@@ -8948,7 +8575,9 @@ Ember.Enumerable = Ember.Mixin.create({
8948
8575
  // HELPERS
8949
8576
  //
8950
8577
 
8951
- var get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
8578
+ var get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
8579
+
8580
+ function none(obj) { return obj===null || obj===undefined; }
8952
8581
 
8953
8582
  // ..........................................................
8954
8583
  // ARRAY
@@ -8971,7 +8600,7 @@ var get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.Enumera
8971
8600
 
8972
8601
  You can use the methods defined in this module to access and modify array
8973
8602
  contents in a KVO-friendly way. You can also be notified whenever the
8974
- membership of an array changes by changing the syntax of the property to
8603
+ membership if an array changes by changing the syntax of the property to
8975
8604
  `.observes('*myProperty.[]')`.
8976
8605
 
8977
8606
  To support `Ember.Array` in your own class, you must override two
@@ -8988,6 +8617,9 @@ var get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.Enumera
8988
8617
  */
8989
8618
  Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {
8990
8619
 
8620
+ // compatibility
8621
+ isSCArray: true,
8622
+
8991
8623
  /**
8992
8624
  Your array must support the `length` property. Your replace methods should
8993
8625
  set this property whenever it changes.
@@ -9095,8 +8727,8 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
9095
8727
  slice: function(beginIndex, endIndex) {
9096
8728
  var ret = Ember.A([]);
9097
8729
  var length = get(this, 'length') ;
9098
- if (isNone(beginIndex)) beginIndex = 0 ;
9099
- if (isNone(endIndex) || (endIndex > length)) endIndex = length ;
8730
+ if (none(beginIndex)) beginIndex = 0 ;
8731
+ if (none(endIndex) || (endIndex > length)) endIndex = length ;
9100
8732
 
9101
8733
  if (beginIndex < 0) beginIndex = length + beginIndex;
9102
8734
  if (endIndex < 0) endIndex = length + endIndex;
@@ -9256,7 +8888,7 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
9256
8888
  @param {Number} startIdx The starting index in the array that will change.
9257
8889
  @param {Number} removeAmt The number of items that will be removed. If you
9258
8890
  pass `null` assumes 0
9259
- @param {Number} addAmt The number of items that will be added. If you
8891
+ @param {Number} addAmt The number of items that will be added If you
9260
8892
  pass `null` assumes 0.
9261
8893
  @return {Ember.Array} receiver
9262
8894
  */
@@ -9290,20 +8922,6 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
9290
8922
  return this;
9291
8923
  },
9292
8924
 
9293
- /**
9294
- If you are implementing an object that supports `Ember.Array`, call this
9295
- method just after the array content changes to notify any observers and
9296
- invalidate any related properties. Pass the starting index of the change
9297
- as well as a delta of the amounts to change.
9298
-
9299
- @method arrayContentDidChange
9300
- @param {Number} startIdx The starting index in the array that did change.
9301
- @param {Number} removeAmt The number of items that were removed. If you
9302
- pass `null` assumes 0
9303
- @param {Number} addAmt The number of items that were added. If you
9304
- pass `null` assumes 0.
9305
- @return {Ember.Array} receiver
9306
- */
9307
8925
  arrayContentDidChange: function(startIdx, removeAmt, addAmt) {
9308
8926
 
9309
8927
  // if no args are passed assume everything changes
@@ -9444,7 +9062,8 @@ var get = Ember.get, set = Ember.set;
9444
9062
  @extends Ember.Mixin
9445
9063
  @since Ember 0.9
9446
9064
  */
9447
- Ember.Copyable = Ember.Mixin.create(/** @scope Ember.Copyable.prototype */ {
9065
+ Ember.Copyable = Ember.Mixin.create(
9066
+ /** @scope Ember.Copyable.prototype */ {
9448
9067
 
9449
9068
  /**
9450
9069
  Override to return a copy of the receiver. Default implementation raises
@@ -9549,7 +9168,8 @@ var get = Ember.get, set = Ember.set;
9549
9168
  @extends Ember.Mixin
9550
9169
  @since Ember 0.9
9551
9170
  */
9552
- Ember.Freezable = Ember.Mixin.create(/** @scope Ember.Freezable.prototype */ {
9171
+ Ember.Freezable = Ember.Mixin.create(
9172
+ /** @scope Ember.Freezable.prototype */ {
9553
9173
 
9554
9174
  /**
9555
9175
  Set to `true` when the object is frozen. Use this property to detect
@@ -9730,7 +9350,8 @@ var get = Ember.get, set = Ember.set;
9730
9350
  @uses Ember.Array
9731
9351
  @uses Ember.MutableEnumerable
9732
9352
  */
9733
- Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,/** @scope Ember.MutableArray.prototype */ {
9353
+ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
9354
+ /** @scope Ember.MutableArray.prototype */ {
9734
9355
 
9735
9356
  /**
9736
9357
  __Required.__ You must implement this method to apply this mixin.
@@ -10001,6 +9622,7 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,/**
10001
9622
 
10002
9623
  });
10003
9624
 
9625
+
10004
9626
  })();
10005
9627
 
10006
9628
 
@@ -10048,7 +9670,7 @@ var get = Ember.get, set = Ember.set;
10048
9670
  For example:
10049
9671
 
10050
9672
  ```javascript
10051
- Ember.Object.extend({
9673
+ Ember.Object.create({
10052
9674
  valueObserver: function() {
10053
9675
  // Executes whenever the "value" property changes
10054
9676
  }.observes('value')
@@ -10067,8 +9689,8 @@ var get = Ember.get, set = Ember.set;
10067
9689
  object.addObserver('propertyKey', targetObject, targetAction)
10068
9690
  ```
10069
9691
 
10070
- This will call the `targetAction` method on the `targetObject` whenever
10071
- the value of the `propertyKey` changes.
9692
+ This will call the `targetAction` method on the `targetObject` to be called
9693
+ whenever the value of the `propertyKey` changes.
10072
9694
 
10073
9695
  Note that if `propertyKey` is a computed property, the observer will be
10074
9696
  called when any of the property dependencies are changed, even if the
@@ -10328,8 +9950,8 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
10328
9950
 
10329
9951
  This is the core method used to register an observer for a property.
10330
9952
 
10331
- Once you call this method, any time the key's value is set, your observer
10332
- will be notified. Note that the observers are triggered any time the
9953
+ Once you call this method, anytime the key's value is set, your observer
9954
+ will be notified. Note that the observers are triggered anytime the
10333
9955
  value is set, regardless of whether it has actually changed. Your
10334
9956
  observer should be prepared to handle that.
10335
9957
 
@@ -10454,11 +10076,11 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
10454
10076
 
10455
10077
  @method incrementProperty
10456
10078
  @param {String} keyName The name of the property to increment
10457
- @param {Number} increment The amount to increment by. Defaults to 1
10458
- @return {Number} The new property value
10079
+ @param {Object} increment The amount to increment by. Defaults to 1
10080
+ @return {Object} The new property value
10459
10081
  */
10460
10082
  incrementProperty: function(keyName, increment) {
10461
- if (Ember.isNone(increment)) { increment = 1; }
10083
+ if (!increment) { increment = 1; }
10462
10084
  set(this, keyName, (get(this, keyName) || 0)+increment);
10463
10085
  return get(this, keyName);
10464
10086
  },
@@ -10473,12 +10095,12 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
10473
10095
 
10474
10096
  @method decrementProperty
10475
10097
  @param {String} keyName The name of the property to decrement
10476
- @param {Number} decrement The amount to decrement by. Defaults to 1
10477
- @return {Number} The new property value
10098
+ @param {Object} increment The amount to decrement by. Defaults to 1
10099
+ @return {Object} The new property value
10478
10100
  */
10479
- decrementProperty: function(keyName, decrement) {
10480
- if (Ember.isNone(decrement)) { decrement = 1; }
10481
- set(this, keyName, (get(this, keyName) || 0)-decrement);
10101
+ decrementProperty: function(keyName, increment) {
10102
+ if (!increment) { increment = 1; }
10103
+ set(this, keyName, (get(this, keyName) || 0)-increment);
10482
10104
  return get(this, keyName);
10483
10105
  },
10484
10106
 
@@ -10487,7 +10109,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
10487
10109
  current value.
10488
10110
 
10489
10111
  ```javascript
10490
- starship.toggleProperty('warpDriveEngaged');
10112
+ starship.toggleProperty('warpDriveEnaged');
10491
10113
  ```
10492
10114
 
10493
10115
  @method toggleProperty
@@ -10519,6 +10141,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
10519
10141
  }
10520
10142
  });
10521
10143
 
10144
+
10522
10145
  })();
10523
10146
 
10524
10147
 
@@ -10813,9 +10436,9 @@ Ember.Evented = Ember.Mixin.create({
10813
10436
  (function() {
10814
10437
  var RSVP = requireModule("rsvp");
10815
10438
 
10816
- RSVP.configure('async', function(callback, binding) {
10439
+ RSVP.async = function(callback, binding) {
10817
10440
  Ember.run.schedule('actions', binding, callback);
10818
- });
10441
+ };
10819
10442
 
10820
10443
  /**
10821
10444
  @module ember
@@ -10837,22 +10460,9 @@ Ember.DeferredMixin = Ember.Mixin.create({
10837
10460
  @param {Function} doneCallback a callback function to be called when done
10838
10461
  @param {Function} failCallback a callback function to be called when failed
10839
10462
  */
10840
- then: function(resolve, reject) {
10841
- var deferred, promise, entity;
10842
-
10843
- entity = this;
10844
- deferred = get(this, '_deferred');
10845
- promise = deferred.promise;
10846
-
10847
- function fulfillmentHandler(fulfillment) {
10848
- if (fulfillment === promise) {
10849
- return resolve(entity);
10850
- } else {
10851
- return resolve(fulfillment);
10852
- }
10853
- }
10854
-
10855
- return promise.then(resolve && fulfillmentHandler, reject);
10463
+ then: function(doneCallback, failCallback) {
10464
+ var promise = get(this, 'promise');
10465
+ return promise.then.apply(promise, arguments);
10856
10466
  },
10857
10467
 
10858
10468
  /**
@@ -10861,16 +10471,7 @@ Ember.DeferredMixin = Ember.Mixin.create({
10861
10471
  @method resolve
10862
10472
  */
10863
10473
  resolve: function(value) {
10864
- var deferred, promise;
10865
-
10866
- deferred = get(this, '_deferred');
10867
- promise = deferred.promise;
10868
-
10869
- if (value === this){
10870
- deferred.resolve(promise);
10871
- } else {
10872
- deferred.resolve(value);
10873
- }
10474
+ get(this, 'promise').resolve(value);
10874
10475
  },
10875
10476
 
10876
10477
  /**
@@ -10879,11 +10480,11 @@ Ember.DeferredMixin = Ember.Mixin.create({
10879
10480
  @method reject
10880
10481
  */
10881
10482
  reject: function(value) {
10882
- get(this, '_deferred').reject(value);
10483
+ get(this, 'promise').reject(value);
10883
10484
  },
10884
10485
 
10885
- _deferred: Ember.computed(function() {
10886
- return RSVP.defer();
10486
+ promise: Ember.computed(function() {
10487
+ return new RSVP.Promise();
10887
10488
  })
10888
10489
  });
10889
10490
 
@@ -11716,7 +11317,8 @@ var get = Ember.get, set = Ember.set;
11716
11317
  @extends Ember.Object
11717
11318
  @uses Ember.MutableArray
11718
11319
  */
11719
- Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,/** @scope Ember.ArrayProxy.prototype */ {
11320
+ Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
11321
+ /** @scope Ember.ArrayProxy.prototype */ {
11720
11322
 
11721
11323
  /**
11722
11324
  The content array. Must be an object that implements `Ember.Array` and/or
@@ -11992,6 +11594,7 @@ Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,/** @scope Ember.Array
11992
11594
  }
11993
11595
  });
11994
11596
 
11597
+
11995
11598
  })();
11996
11599
 
11997
11600
 
@@ -12091,7 +11694,8 @@ function contentPropertyDidChange(content, contentKey) {
12091
11694
  @namespace Ember
12092
11695
  @extends Ember.Object
12093
11696
  */
12094
- Ember.ObjectProxy = Ember.Object.extend(/** @scope Ember.ObjectProxy.prototype */ {
11697
+ Ember.ObjectProxy = Ember.Object.extend(
11698
+ /** @scope Ember.ObjectProxy.prototype */ {
12095
11699
  /**
12096
11700
  The object whose properties will be forwarded.
12097
11701
 
@@ -12529,7 +12133,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {
12529
12133
  @submodule ember-runtime
12530
12134
  */
12531
12135
 
12532
- var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, isNone = Ember.isNone, fmt = Ember.String.fmt;
12136
+ var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone, fmt = Ember.String.fmt;
12533
12137
 
12534
12138
  /**
12535
12139
  An unordered collection of objects.
@@ -12887,7 +12491,7 @@ Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Emb
12887
12491
  // implements Ember.MutableEnumerable
12888
12492
  addObject: function(obj) {
12889
12493
  if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
12890
- if (isNone(obj)) return this; // nothing to do
12494
+ if (none(obj)) return this; // nothing to do
12891
12495
 
12892
12496
  var guid = guidFor(obj),
12893
12497
  idx = this[guid],
@@ -12915,7 +12519,7 @@ Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Emb
12915
12519
  // implements Ember.MutableEnumerable
12916
12520
  removeObject: function(obj) {
12917
12521
  if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
12918
- if (isNone(obj)) return this; // nothing to do
12522
+ if (none(obj)) return this; // nothing to do
12919
12523
 
12920
12524
  var guid = guidFor(obj),
12921
12525
  idx = this[guid],
@@ -12990,7 +12594,7 @@ Deferred.reopenClass({
12990
12594
  promise: function(callback, binding) {
12991
12595
  var deferred = Deferred.create();
12992
12596
  callback.call(binding, deferred);
12993
- return deferred;
12597
+ return get(deferred, 'promise');
12994
12598
  }
12995
12599
  });
12996
12600
 
@@ -13001,8 +12605,6 @@ Ember.Deferred = Deferred;
13001
12605
 
13002
12606
 
13003
12607
  (function() {
13004
- var forEach = Ember.ArrayPolyfills.forEach;
13005
-
13006
12608
  /**
13007
12609
  @module ember
13008
12610
  @submodule ember-runtime
@@ -13035,10 +12637,12 @@ Ember.onLoad = function(name, callback) {
13035
12637
  @param object {Object} object to pass to callbacks
13036
12638
  */
13037
12639
  Ember.runLoadHooks = function(name, object) {
12640
+ var hooks;
12641
+
13038
12642
  loaded[name] = object;
13039
12643
 
13040
- if (loadHooks[name]) {
13041
- forEach.call(loadHooks[name], function(callback) {
12644
+ if (hooks = loadHooks[name]) {
12645
+ loadHooks[name].forEach(function(callback) {
13042
12646
  callback(object);
13043
12647
  });
13044
12648
  }
@@ -13112,8 +12716,6 @@ Ember.ControllerMixin = Ember.Mixin.create({
13112
12716
 
13113
12717
  container: null,
13114
12718
 
13115
- parentController: null,
13116
-
13117
12719
  store: null,
13118
12720
 
13119
12721
  model: Ember.computed.alias('content'),
@@ -13456,10 +13058,6 @@ var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,
13456
13058
  });
13457
13059
  ```
13458
13060
 
13459
- The itemController instances will have a `parentController` property set to
13460
- either the the `parentController` property of the `ArrayController`
13461
- or to the `ArrayController` instance itself.
13462
-
13463
13061
  @class ArrayController
13464
13062
  @namespace Ember
13465
13063
  @extends Ember.ArrayProxy
@@ -13570,7 +13168,6 @@ Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,
13570
13168
  }
13571
13169
 
13572
13170
  subController.set('target', this);
13573
- subController.set('parentController', get(this, 'parentController') || this);
13574
13171
  subController.set('content', object);
13575
13172
 
13576
13173
  return subController;