ember-source 1.3.0.beta.3 → 1.3.0.beta.4
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 +4 -4
- data/VERSION +1 -1
- data/dist/ember-data-deps.js +534 -212
- data/dist/ember-data-deps.min.js +13 -19
- data/dist/ember-data-deps.prod.js +525 -197
- data/dist/ember-debug.js +9 -15
- data/dist/ember-runtime.js +534 -212
- data/dist/ember-runtime.min.js +13 -19
- data/dist/ember-runtime.prod.js +525 -197
- data/dist/ember-spade.js +10 -11
- data/dist/ember-template-compiler.js +9 -10
- data/dist/ember-template-compiler.min.js +9 -15
- data/dist/ember-template-compiler.prod.js +9 -10
- data/dist/ember-tests.js +10 -11
- data/dist/ember.js +939 -435
- data/dist/ember.min.js +17 -23
- data/dist/ember.prod.js +831 -410
- metadata +4 -3
data/dist/ember-debug.js
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
(function() {
|
2
2
|
var Ember = { assert: function() {}, FEATURES: { isEnabled: function() {} } };
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
/*!
|
4
|
+
* @overview Ember - JavaScript Application Framework
|
5
|
+
* @copyright Copyright 2011-2013 Tilde Inc. and contributors
|
6
|
+
* Portions Copyright 2006-2011 Strobe Inc.
|
7
|
+
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
8
|
+
* @license Licensed under MIT license
|
9
|
+
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
10
|
+
* @version 1.4.0-beta.1+canary.dc0dc0ce
|
11
|
+
*/
|
11
12
|
|
12
13
|
|
13
|
-
// Version: 1.3.0-beta.3
|
14
|
-
|
15
14
|
(function() {
|
16
15
|
/*global __fail__*/
|
17
16
|
|
@@ -60,11 +59,6 @@ if (!('MANDATORY_SETTER' in Ember.ENV)) {
|
|
60
59
|
*/
|
61
60
|
Ember.assert = function(desc, test) {
|
62
61
|
if (!test) {
|
63
|
-
Ember.Logger.assert(test, desc);
|
64
|
-
}
|
65
|
-
|
66
|
-
if (Ember.testing && !test) {
|
67
|
-
// when testing, ensure test failures when assertions fail
|
68
62
|
throw new Ember.Error("Assertion Failed: " + desc);
|
69
63
|
}
|
70
64
|
};
|
data/dist/ember-runtime.js
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
/*!
|
2
|
+
* @overview Ember - JavaScript Application Framework
|
3
|
+
* @copyright Copyright 2011-2013 Tilde Inc. and contributors
|
4
|
+
* Portions Copyright 2006-2011 Strobe Inc.
|
5
|
+
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
6
|
+
* @license Licensed under MIT license
|
7
|
+
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
8
|
+
* @version 1.4.0-beta.1+canary.dc0dc0ce
|
9
|
+
*/
|
10
10
|
|
11
|
-
// Version: 1.3.0-beta.3
|
12
11
|
|
13
12
|
(function() {
|
14
13
|
/*global __fail__*/
|
@@ -58,11 +57,6 @@ if (!('MANDATORY_SETTER' in Ember.ENV)) {
|
|
58
57
|
*/
|
59
58
|
Ember.assert = function(desc, test) {
|
60
59
|
if (!test) {
|
61
|
-
Ember.Logger.assert(test, desc);
|
62
|
-
}
|
63
|
-
|
64
|
-
if (Ember.testing && !test) {
|
65
|
-
// when testing, ensure test failures when assertions fail
|
66
60
|
throw new Ember.Error("Assertion Failed: " + desc);
|
67
61
|
}
|
68
62
|
};
|
@@ -184,17 +178,16 @@ if (!Ember.testing) {
|
|
184
178
|
|
185
179
|
})();
|
186
180
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
181
|
+
/*!
|
182
|
+
* @overview Ember - JavaScript Application Framework
|
183
|
+
* @copyright Copyright 2011-2013 Tilde Inc. and contributors
|
184
|
+
* Portions Copyright 2006-2011 Strobe Inc.
|
185
|
+
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
186
|
+
* @license Licensed under MIT license
|
187
|
+
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
188
|
+
* @version 1.4.0-beta.1+canary.dc0dc0ce
|
189
|
+
*/
|
196
190
|
|
197
|
-
// Version: 1.3.0-beta.3
|
198
191
|
|
199
192
|
(function() {
|
200
193
|
var define, requireModule, require, requirejs;
|
@@ -275,7 +268,7 @@ var define, requireModule, require, requirejs;
|
|
275
268
|
|
276
269
|
@class Ember
|
277
270
|
@static
|
278
|
-
@version 1.
|
271
|
+
@version 1.4.0-beta.1+canary.dc0dc0ce
|
279
272
|
*/
|
280
273
|
|
281
274
|
if ('undefined' === typeof Ember) {
|
@@ -302,10 +295,10 @@ Ember.toString = function() { return "Ember"; };
|
|
302
295
|
/**
|
303
296
|
@property VERSION
|
304
297
|
@type String
|
305
|
-
@default '1.
|
298
|
+
@default '1.4.0-beta.1+canary.dc0dc0ce'
|
306
299
|
@final
|
307
300
|
*/
|
308
|
-
Ember.VERSION = '1.
|
301
|
+
Ember.VERSION = '1.4.0-beta.1+canary.dc0dc0ce';
|
309
302
|
|
310
303
|
/**
|
311
304
|
Standard environmental variables. You can define these in a global `ENV`
|
@@ -1546,6 +1539,41 @@ Ember.typeOf = function(item) {
|
|
1546
1539
|
return ret;
|
1547
1540
|
};
|
1548
1541
|
|
1542
|
+
/**
|
1543
|
+
Convenience method to inspect an object. This method will attempt to
|
1544
|
+
convert the object into a useful string description.
|
1545
|
+
|
1546
|
+
It is a pretty simple implementation. If you want something more robust,
|
1547
|
+
use something like JSDump: https://github.com/NV/jsDump
|
1548
|
+
|
1549
|
+
@method inspect
|
1550
|
+
@for Ember
|
1551
|
+
@param {Object} obj The object you want to inspect.
|
1552
|
+
@return {String} A description of the object
|
1553
|
+
*/
|
1554
|
+
Ember.inspect = function(obj) {
|
1555
|
+
var type = Ember.typeOf(obj);
|
1556
|
+
if (type === 'array') {
|
1557
|
+
return '[' + obj + ']';
|
1558
|
+
}
|
1559
|
+
if (type !== 'object') {
|
1560
|
+
return obj + '';
|
1561
|
+
}
|
1562
|
+
|
1563
|
+
var v, ret = [];
|
1564
|
+
for(var key in obj) {
|
1565
|
+
if (obj.hasOwnProperty(key)) {
|
1566
|
+
v = obj[key];
|
1567
|
+
if (v === 'toString') { continue; } // ignore useless items
|
1568
|
+
if (Ember.typeOf(v) === 'function') { v = "function() { ... }"; }
|
1569
|
+
ret.push(key + ": " + v);
|
1570
|
+
}
|
1571
|
+
}
|
1572
|
+
return "{" + ret.join(", ") + "}";
|
1573
|
+
};
|
1574
|
+
|
1575
|
+
|
1576
|
+
|
1549
1577
|
})();
|
1550
1578
|
|
1551
1579
|
|
@@ -1957,7 +1985,7 @@ var normalizeTuple = Ember.normalizeTuple = function(target, path) {
|
|
1957
1985
|
}
|
1958
1986
|
|
1959
1987
|
// must return some kind of path to be valid else other things will break.
|
1960
|
-
if (!path || path.length===0) throw new Ember.Error('
|
1988
|
+
if (!path || path.length===0) throw new Ember.Error('Path cannot be empty');
|
1961
1989
|
|
1962
1990
|
return [ target, path ];
|
1963
1991
|
};
|
@@ -4010,6 +4038,52 @@ Ember.finishChains = function(obj) {
|
|
4010
4038
|
|
4011
4039
|
|
4012
4040
|
(function() {
|
4041
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
4042
|
+
/**
|
4043
|
+
@module ember-metal
|
4044
|
+
*/
|
4045
|
+
|
4046
|
+
var forEach = Ember.EnumerableUtils.forEach,
|
4047
|
+
BRACE_EXPANSION = /^((?:[^\.]*\.)*)\{(.*)\}$/;
|
4048
|
+
|
4049
|
+
/**
|
4050
|
+
Expands `pattern`, invoking `callback` for each expansion.
|
4051
|
+
|
4052
|
+
The only pattern supported is brace-expansion, anything else will be passed
|
4053
|
+
once to `callback` directly. Brace expansion can only appear at the end of a
|
4054
|
+
pattern, for example as the last item in a chain.
|
4055
|
+
|
4056
|
+
Example
|
4057
|
+
```js
|
4058
|
+
function echo(arg){ console.log(arg); }
|
4059
|
+
|
4060
|
+
Ember.expandProperties('foo.bar', echo); //=> 'foo.bar'
|
4061
|
+
Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar'
|
4062
|
+
Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz'
|
4063
|
+
Ember.expandProperties('{foo,bar}.baz', echo); //=> '{foo,bar}.baz'
|
4064
|
+
```
|
4065
|
+
|
4066
|
+
@method
|
4067
|
+
@private
|
4068
|
+
@param {string} pattern The property pattern to expand.
|
4069
|
+
@param {function} callback The callback to invoke. It is invoked once per
|
4070
|
+
expansion, and is passed the expansion.
|
4071
|
+
*/
|
4072
|
+
Ember.expandProperties = function (pattern, callback) {
|
4073
|
+
var match, prefix, list;
|
4074
|
+
|
4075
|
+
if (match = BRACE_EXPANSION.exec(pattern)) {
|
4076
|
+
prefix = match[1];
|
4077
|
+
list = match[2];
|
4078
|
+
|
4079
|
+
forEach(list.split(','), function (suffix) {
|
4080
|
+
callback(prefix + suffix);
|
4081
|
+
});
|
4082
|
+
} else {
|
4083
|
+
callback(pattern);
|
4084
|
+
}
|
4085
|
+
};
|
4086
|
+
}
|
4013
4087
|
|
4014
4088
|
})();
|
4015
4089
|
|
@@ -4215,6 +4289,9 @@ var get = Ember.get,
|
|
4215
4289
|
watch = Ember.watch,
|
4216
4290
|
unwatch = Ember.unwatch;
|
4217
4291
|
|
4292
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
4293
|
+
var expandProperties = Ember.expandProperties;
|
4294
|
+
}
|
4218
4295
|
|
4219
4296
|
// ..........................................................
|
4220
4297
|
// DEPENDENT KEYS
|
@@ -4479,9 +4556,18 @@ ComputedPropertyPrototype.readOnly = function(readOnly) {
|
|
4479
4556
|
ComputedPropertyPrototype.property = function() {
|
4480
4557
|
var args;
|
4481
4558
|
|
4482
|
-
|
4559
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
4560
|
+
var addArg = function (property) {
|
4561
|
+
args.push(property);
|
4562
|
+
};
|
4563
|
+
|
4564
|
+
args = [];
|
4565
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
4566
|
+
expandProperties(arguments[i], addArg);
|
4567
|
+
}
|
4568
|
+
} else {
|
4483
4569
|
args = a_slice.call(arguments);
|
4484
|
-
|
4570
|
+
}
|
4485
4571
|
|
4486
4572
|
this._dependentKeys = args;
|
4487
4573
|
return this;
|
@@ -4610,7 +4696,7 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
|
|
4610
4696
|
funcArgLength, cachedValue, ret;
|
4611
4697
|
|
4612
4698
|
if (this._readOnly) {
|
4613
|
-
throw new Ember.Error('Cannot Set: ' + keyName + ' on: ' +
|
4699
|
+
throw new Ember.Error('Cannot Set: ' + keyName + ' on: ' + Ember.inspect(obj));
|
4614
4700
|
}
|
4615
4701
|
|
4616
4702
|
this._suspended = obj;
|
@@ -5287,7 +5373,51 @@ Ember.computed.oneWay = function(dependentKey) {
|
|
5287
5373
|
});
|
5288
5374
|
};
|
5289
5375
|
|
5376
|
+
if (Ember.FEATURES.isEnabled('computed-read-only')) {
|
5377
|
+
/**
|
5378
|
+
Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides
|
5379
|
+
a readOnly one way binding. Very often when using `computed.oneWay` one does
|
5380
|
+
not also want changes to propogate back up, as they will replace the value.
|
5381
|
+
|
5382
|
+
This prevents the reverse flow, and also throws an exception when it occurs.
|
5383
|
+
|
5384
|
+
Example
|
5385
|
+
|
5386
|
+
```javascript
|
5387
|
+
User = Ember.Object.extend({
|
5388
|
+
firstName: null,
|
5389
|
+
lastName: null,
|
5390
|
+
nickName: Ember.computed.readOnly('firstName')
|
5391
|
+
});
|
5392
|
+
|
5393
|
+
user = User.create({
|
5394
|
+
firstName: 'Teddy',
|
5395
|
+
lastName: 'Zeenny'
|
5396
|
+
});
|
5290
5397
|
|
5398
|
+
user.get('nickName');
|
5399
|
+
# 'Teddy'
|
5400
|
+
|
5401
|
+
user.set('nickName', 'TeddyBear');
|
5402
|
+
# throws Exception
|
5403
|
+
# throw new Ember.Error('Cannot Set: nickName on: <User:ember27288>' );`
|
5404
|
+
|
5405
|
+
user.get('firstName');
|
5406
|
+
# 'Teddy'
|
5407
|
+
```
|
5408
|
+
|
5409
|
+
@method computed.readOnly
|
5410
|
+
@for Ember
|
5411
|
+
@param {String} dependentKey
|
5412
|
+
@return {Ember.ComputedProperty} computed property which creates a
|
5413
|
+
one way computed property to the original value for property.
|
5414
|
+
*/
|
5415
|
+
Ember.computed.readOnly = function(dependentKey) {
|
5416
|
+
return Ember.computed(dependentKey, function() {
|
5417
|
+
return get(this, dependentKey);
|
5418
|
+
}).readOnly();
|
5419
|
+
};
|
5420
|
+
}
|
5291
5421
|
/**
|
5292
5422
|
A computed property that acts like a standard getter and setter,
|
5293
5423
|
but returns the value at the provided `defaultPath` if the
|
@@ -6365,7 +6495,7 @@ Ember.run.later = function(target, method) {
|
|
6365
6495
|
If you pass a string it will be resolved on the
|
6366
6496
|
target at the time the method is invoked.
|
6367
6497
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
6368
|
-
@return {Object}
|
6498
|
+
@return {Object} Timer information for use in cancelling, see `Ember.run.cancel`.
|
6369
6499
|
*/
|
6370
6500
|
Ember.run.once = function(target, method) {
|
6371
6501
|
checkAutoRun();
|
@@ -6416,7 +6546,7 @@ Ember.run.once = function(target, method) {
|
|
6416
6546
|
If you pass a string it will be resolved on the
|
6417
6547
|
target at the time the method is invoked.
|
6418
6548
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
6419
|
-
@return {Object}
|
6549
|
+
@return {Object} Timer information for use in cancelling, see `Ember.run.cancel`.
|
6420
6550
|
*/
|
6421
6551
|
Ember.run.scheduleOnce = function(queue, target, method) {
|
6422
6552
|
checkAutoRun();
|
@@ -6478,7 +6608,7 @@ Ember.run.scheduleOnce = function(queue, target, method) {
|
|
6478
6608
|
If you pass a string it will be resolved on the
|
6479
6609
|
target at the time the method is invoked.
|
6480
6610
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
6481
|
-
@return {Object}
|
6611
|
+
@return {Object} Timer information for use in cancelling, see `Ember.run.cancel`.
|
6482
6612
|
*/
|
6483
6613
|
Ember.run.next = function() {
|
6484
6614
|
var args = slice.call(arguments);
|
@@ -6488,7 +6618,8 @@ Ember.run.next = function() {
|
|
6488
6618
|
|
6489
6619
|
/**
|
6490
6620
|
Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,
|
6491
|
-
`Ember.run.once()`,
|
6621
|
+
`Ember.run.once()`, `Ember.run.next()`, `Ember.run.debounce()`, or
|
6622
|
+
`Ember.run.throttle()`.
|
6492
6623
|
|
6493
6624
|
```javascript
|
6494
6625
|
var runNext = Ember.run.next(myContext, function() {
|
@@ -6505,11 +6636,29 @@ Ember.run.next = function() {
|
|
6505
6636
|
// will not be executed
|
6506
6637
|
});
|
6507
6638
|
Ember.run.cancel(runOnce);
|
6639
|
+
|
6640
|
+
var throttle = Ember.run.throttle(myContext, function() {
|
6641
|
+
// will not be executed
|
6642
|
+
}, 1);
|
6643
|
+
Ember.run.cancel(throttle);
|
6644
|
+
|
6645
|
+
var debounce = Ember.run.debounce(myContext, function() {
|
6646
|
+
// will not be executed
|
6647
|
+
}, 1);
|
6648
|
+
Ember.run.cancel(debounce);
|
6649
|
+
|
6650
|
+
var debounceImmediate = Ember.run.debounce(myContext, function() {
|
6651
|
+
// will be executed since we passed in true (immediate)
|
6652
|
+
}, 100, true);
|
6653
|
+
// the 100ms delay until this method can be called again will be cancelled
|
6654
|
+
Ember.run.cancel(debounceImmediate);
|
6655
|
+
```
|
6656
|
+
```
|
6508
6657
|
```
|
6509
6658
|
|
6510
6659
|
@method cancel
|
6511
6660
|
@param {Object} timer Timer object to cancel
|
6512
|
-
@return {
|
6661
|
+
@return {Boolean} true if cancelled or false/undefined if it wasn't found
|
6513
6662
|
*/
|
6514
6663
|
Ember.run.cancel = function(timer) {
|
6515
6664
|
return backburner.cancel(timer);
|
@@ -6541,6 +6690,34 @@ Ember.run.cancel = function(timer) {
|
|
6541
6690
|
// console logs 'debounce ran.' one time.
|
6542
6691
|
```
|
6543
6692
|
|
6693
|
+
Immediate allows you to run the function immediately, but debounce
|
6694
|
+
other calls for this function until the wait time has elapsed. If
|
6695
|
+
`debounce` is called again before the specified time has elapsed,
|
6696
|
+
the timer is reset and the entire period msut pass again before
|
6697
|
+
the method can be called again.
|
6698
|
+
|
6699
|
+
```javascript
|
6700
|
+
var myFunc = function() { console.log(this.name + ' ran.'); };
|
6701
|
+
var myContext = {name: 'debounce'};
|
6702
|
+
|
6703
|
+
Ember.run.debounce(myContext, myFunc, 150, true);
|
6704
|
+
|
6705
|
+
// console logs 'debounce ran.' one time immediately.
|
6706
|
+
// 100ms passes
|
6707
|
+
|
6708
|
+
Ember.run.debounce(myContext, myFunc, 150, true);
|
6709
|
+
|
6710
|
+
// 150ms passes and nothing else is logged to the console and
|
6711
|
+
// the debouncee is no longer being watched
|
6712
|
+
|
6713
|
+
Ember.run.debounce(myContext, myFunc, 150, true);
|
6714
|
+
|
6715
|
+
// console logs 'debounce ran.' one time immediately.
|
6716
|
+
// 150ms passes and nothing else is logged tot he console and
|
6717
|
+
// the debouncee is no longer being watched
|
6718
|
+
|
6719
|
+
```
|
6720
|
+
|
6544
6721
|
@method debounce
|
6545
6722
|
@param {Object} [target] target of method to invoke
|
6546
6723
|
@param {Function|String} method The method to invoke.
|
@@ -6549,7 +6726,7 @@ Ember.run.cancel = function(timer) {
|
|
6549
6726
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
6550
6727
|
@param {Number} wait Number of milliseconds to wait.
|
6551
6728
|
@param {Boolean} immediate Trigger the function on the leading instead of the trailing edge of the wait interval.
|
6552
|
-
@return {
|
6729
|
+
@return {Array} Timer information for use in cancelling, see `Ember.run.cancel`.
|
6553
6730
|
*/
|
6554
6731
|
Ember.run.debounce = function() {
|
6555
6732
|
return backburner.debounce.apply(backburner, arguments);
|
@@ -6586,7 +6763,7 @@ Ember.run.debounce = function() {
|
|
6586
6763
|
then it will be looked up on the passed target.
|
6587
6764
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
6588
6765
|
@param {Number} spacing Number of milliseconds to space out requests.
|
6589
|
-
@return {
|
6766
|
+
@return {Array} Timer information for use in cancelling, see `Ember.run.cancel`.
|
6590
6767
|
*/
|
6591
6768
|
Ember.run.throttle = function() {
|
6592
6769
|
return backburner.throttle.apply(backburner, arguments);
|
@@ -7096,6 +7273,9 @@ var Mixin, REQUIRED, Alias,
|
|
7096
7273
|
defineProperty = Ember.defineProperty,
|
7097
7274
|
guidFor = Ember.guidFor;
|
7098
7275
|
|
7276
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
7277
|
+
var expandProperties = Ember.expandProperties;
|
7278
|
+
}
|
7099
7279
|
|
7100
7280
|
function mixinsMeta(obj) {
|
7101
7281
|
var m = Ember.meta(obj, true), ret = m.mixins;
|
@@ -7669,35 +7849,6 @@ Alias = function(methodName) {
|
|
7669
7849
|
};
|
7670
7850
|
Alias.prototype = new Ember.Descriptor();
|
7671
7851
|
|
7672
|
-
/**
|
7673
|
-
Makes a property or method available via an additional name.
|
7674
|
-
|
7675
|
-
```javascript
|
7676
|
-
App.PaintSample = Ember.Object.extend({
|
7677
|
-
color: 'red',
|
7678
|
-
colour: Ember.alias('color'),
|
7679
|
-
name: function() {
|
7680
|
-
return "Zed";
|
7681
|
-
},
|
7682
|
-
moniker: Ember.alias("name")
|
7683
|
-
});
|
7684
|
-
|
7685
|
-
var paintSample = App.PaintSample.create()
|
7686
|
-
paintSample.get('colour'); // 'red'
|
7687
|
-
paintSample.moniker(); // 'Zed'
|
7688
|
-
```
|
7689
|
-
|
7690
|
-
@method alias
|
7691
|
-
@for Ember
|
7692
|
-
@param {String} methodName name of the method or property to alias
|
7693
|
-
@return {Ember.Descriptor}
|
7694
|
-
@deprecated Use `Ember.aliasMethod` or `Ember.computed.alias` instead
|
7695
|
-
*/
|
7696
|
-
Ember.alias = function(methodName) {
|
7697
|
-
Ember.deprecate("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.");
|
7698
|
-
return new Alias(methodName);
|
7699
|
-
};
|
7700
|
-
|
7701
7852
|
/**
|
7702
7853
|
Makes a method available via an additional name.
|
7703
7854
|
|
@@ -7752,7 +7903,23 @@ Ember.observer = function() {
|
|
7752
7903
|
var func = a_slice.call(arguments, -1)[0];
|
7753
7904
|
var paths;
|
7754
7905
|
|
7755
|
-
|
7906
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
7907
|
+
var addWatchedProperty = function (path) { paths.push(path); };
|
7908
|
+
var _paths = a_slice.call(arguments, 0, -1);
|
7909
|
+
|
7910
|
+
if (typeof func !== "function") {
|
7911
|
+
// revert to old, soft-deprecated argument ordering
|
7912
|
+
|
7913
|
+
func = arguments[0];
|
7914
|
+
_paths = a_slice.call(arguments, 1);
|
7915
|
+
}
|
7916
|
+
|
7917
|
+
paths = [];
|
7918
|
+
|
7919
|
+
for (var i=0; i<_paths.length; ++i) {
|
7920
|
+
expandProperties(_paths[i], addWatchedProperty);
|
7921
|
+
}
|
7922
|
+
} else {
|
7756
7923
|
paths = a_slice.call(arguments, 0, -1);
|
7757
7924
|
|
7758
7925
|
if (typeof func !== "function") {
|
@@ -7761,7 +7928,7 @@ Ember.observer = function() {
|
|
7761
7928
|
func = arguments[0];
|
7762
7929
|
paths = a_slice.call(arguments, 1);
|
7763
7930
|
}
|
7764
|
-
|
7931
|
+
}
|
7765
7932
|
|
7766
7933
|
if (typeof func !== "function") {
|
7767
7934
|
throw new Ember.Error("Ember.observer called without a function");
|
@@ -7850,7 +8017,24 @@ Ember.beforeObserver = function() {
|
|
7850
8017
|
var func = a_slice.call(arguments, -1)[0];
|
7851
8018
|
var paths;
|
7852
8019
|
|
7853
|
-
|
8020
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
8021
|
+
var addWatchedProperty = function(path) { paths.push(path); };
|
8022
|
+
|
8023
|
+
var _paths = a_slice.call(arguments, 0, -1);
|
8024
|
+
|
8025
|
+
if (typeof func !== "function") {
|
8026
|
+
// revert to old, soft-deprecated argument ordering
|
8027
|
+
|
8028
|
+
func = arguments[0];
|
8029
|
+
_paths = a_slice.call(arguments, 1);
|
8030
|
+
}
|
8031
|
+
|
8032
|
+
paths = [];
|
8033
|
+
|
8034
|
+
for (var i=0; i<_paths.length; ++i) {
|
8035
|
+
expandProperties(_paths[i], addWatchedProperty);
|
8036
|
+
}
|
8037
|
+
} else {
|
7854
8038
|
paths = a_slice.call(arguments, 0, -1);
|
7855
8039
|
|
7856
8040
|
if (typeof func !== "function") {
|
@@ -7859,7 +8043,7 @@ Ember.beforeObserver = function() {
|
|
7859
8043
|
func = arguments[0];
|
7860
8044
|
paths = a_slice.call(arguments, 1);
|
7861
8045
|
}
|
7862
|
-
|
8046
|
+
}
|
7863
8047
|
|
7864
8048
|
if (typeof func !== "function") {
|
7865
8049
|
throw new Ember.Error("Ember.beforeObserver called without a function");
|
@@ -7937,7 +8121,7 @@ Ember Metal
|
|
7937
8121
|
@class RSVP
|
7938
8122
|
@module RSVP
|
7939
8123
|
*/
|
7940
|
-
define("rsvp/all",
|
8124
|
+
define("rsvp/all",
|
7941
8125
|
["./promise","./utils","exports"],
|
7942
8126
|
function(__dependency1__, __dependency2__, __exports__) {
|
7943
8127
|
"use strict";
|
@@ -8033,7 +8217,7 @@ define("rsvp/all",
|
|
8033
8217
|
__exports__.all = all;
|
8034
8218
|
});
|
8035
8219
|
|
8036
|
-
define("rsvp/cast",
|
8220
|
+
define("rsvp/cast",
|
8037
8221
|
["exports"],
|
8038
8222
|
function(__exports__) {
|
8039
8223
|
"use strict";
|
@@ -8104,7 +8288,7 @@ define("rsvp/cast",
|
|
8104
8288
|
|
8105
8289
|
__exports__.cast = cast;
|
8106
8290
|
});
|
8107
|
-
define("rsvp/config",
|
8291
|
+
define("rsvp/config",
|
8108
8292
|
["./events","exports"],
|
8109
8293
|
function(__dependency1__, __exports__) {
|
8110
8294
|
"use strict";
|
@@ -8135,7 +8319,7 @@ define("rsvp/config",
|
|
8135
8319
|
__exports__.config = config;
|
8136
8320
|
__exports__.configure = configure;
|
8137
8321
|
});
|
8138
|
-
define("rsvp/defer",
|
8322
|
+
define("rsvp/defer",
|
8139
8323
|
["./promise","exports"],
|
8140
8324
|
function(__dependency1__, __exports__) {
|
8141
8325
|
"use strict";
|
@@ -8190,7 +8374,7 @@ define("rsvp/defer",
|
|
8190
8374
|
|
8191
8375
|
__exports__.defer = defer;
|
8192
8376
|
});
|
8193
|
-
define("rsvp/events",
|
8377
|
+
define("rsvp/events",
|
8194
8378
|
["exports"],
|
8195
8379
|
function(__exports__) {
|
8196
8380
|
"use strict";
|
@@ -8399,7 +8583,7 @@ define("rsvp/events",
|
|
8399
8583
|
|
8400
8584
|
__exports__.EventTarget = EventTarget;
|
8401
8585
|
});
|
8402
|
-
define("rsvp/hash",
|
8586
|
+
define("rsvp/hash",
|
8403
8587
|
["./promise","./utils","exports"],
|
8404
8588
|
function(__dependency1__, __dependency2__, __exports__) {
|
8405
8589
|
"use strict";
|
@@ -8544,7 +8728,7 @@ define("rsvp/hash",
|
|
8544
8728
|
|
8545
8729
|
__exports__.hash = hash;
|
8546
8730
|
});
|
8547
|
-
define("rsvp/instrument",
|
8731
|
+
define("rsvp/instrument",
|
8548
8732
|
["./config","./utils","exports"],
|
8549
8733
|
function(__dependency1__, __dependency2__, __exports__) {
|
8550
8734
|
"use strict";
|
@@ -8571,7 +8755,7 @@ define("rsvp/instrument",
|
|
8571
8755
|
|
8572
8756
|
__exports__.instrument = instrument;
|
8573
8757
|
});
|
8574
|
-
define("rsvp/node",
|
8758
|
+
define("rsvp/node",
|
8575
8759
|
["./promise","./all","exports"],
|
8576
8760
|
function(__dependency1__, __dependency2__, __exports__) {
|
8577
8761
|
"use strict";
|
@@ -8686,7 +8870,7 @@ define("rsvp/node",
|
|
8686
8870
|
|
8687
8871
|
__exports__.denodeify = denodeify;
|
8688
8872
|
});
|
8689
|
-
define("rsvp/promise",
|
8873
|
+
define("rsvp/promise",
|
8690
8874
|
["./config","./events","./cast","./instrument","./utils","exports"],
|
8691
8875
|
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {
|
8692
8876
|
"use strict";
|
@@ -8935,7 +9119,7 @@ define("rsvp/promise",
|
|
8935
9119
|
|
8936
9120
|
__exports__.Promise = Promise;
|
8937
9121
|
});
|
8938
|
-
define("rsvp/race",
|
9122
|
+
define("rsvp/race",
|
8939
9123
|
["./promise","./utils","exports"],
|
8940
9124
|
function(__dependency1__, __dependency2__, __exports__) {
|
8941
9125
|
"use strict";
|
@@ -9027,7 +9211,7 @@ define("rsvp/race",
|
|
9027
9211
|
|
9028
9212
|
__exports__.race = race;
|
9029
9213
|
});
|
9030
|
-
define("rsvp/reject",
|
9214
|
+
define("rsvp/reject",
|
9031
9215
|
["./promise","exports"],
|
9032
9216
|
function(__dependency1__, __exports__) {
|
9033
9217
|
"use strict";
|
@@ -9077,7 +9261,7 @@ define("rsvp/reject",
|
|
9077
9261
|
|
9078
9262
|
__exports__.reject = reject;
|
9079
9263
|
});
|
9080
|
-
define("rsvp/resolve",
|
9264
|
+
define("rsvp/resolve",
|
9081
9265
|
["./promise","exports"],
|
9082
9266
|
function(__dependency1__, __exports__) {
|
9083
9267
|
"use strict";
|
@@ -9123,7 +9307,7 @@ define("rsvp/resolve",
|
|
9123
9307
|
|
9124
9308
|
__exports__.resolve = resolve;
|
9125
9309
|
});
|
9126
|
-
define("rsvp/rethrow",
|
9310
|
+
define("rsvp/rethrow",
|
9127
9311
|
["exports"],
|
9128
9312
|
function(__exports__) {
|
9129
9313
|
"use strict";
|
@@ -9176,7 +9360,7 @@ define("rsvp/rethrow",
|
|
9176
9360
|
|
9177
9361
|
__exports__.rethrow = rethrow;
|
9178
9362
|
});
|
9179
|
-
define("rsvp/utils",
|
9363
|
+
define("rsvp/utils",
|
9180
9364
|
["exports"],
|
9181
9365
|
function(__exports__) {
|
9182
9366
|
"use strict";
|
@@ -9202,7 +9386,7 @@ define("rsvp/utils",
|
|
9202
9386
|
__exports__.isArray = isArray;
|
9203
9387
|
__exports__.now = now;
|
9204
9388
|
});
|
9205
|
-
define("rsvp",
|
9389
|
+
define("rsvp",
|
9206
9390
|
["./rsvp/events","./rsvp/promise","./rsvp/node","./rsvp/all","./rsvp/race","./rsvp/hash","./rsvp/rethrow","./rsvp/defer","./rsvp/config","./rsvp/resolve","./rsvp/reject", "exports"],
|
9207
9391
|
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {
|
9208
9392
|
"use strict";
|
@@ -9246,6 +9430,7 @@ define("rsvp",
|
|
9246
9430
|
__exports__.reject = reject;
|
9247
9431
|
__exports__.async = async;
|
9248
9432
|
});
|
9433
|
+
|
9249
9434
|
})();
|
9250
9435
|
|
9251
9436
|
(function() {
|
@@ -9266,6 +9451,7 @@ Ember.MODEL_FACTORY_INJECTIONS = false || !!Ember.ENV.MODEL_FACTORY_INJECTIONS;
|
|
9266
9451
|
define("container",
|
9267
9452
|
[],
|
9268
9453
|
function() {
|
9454
|
+
"use strict";
|
9269
9455
|
|
9270
9456
|
// A safe and simple inheriting object.
|
9271
9457
|
function InheritingDict(parent) {
|
@@ -9387,7 +9573,8 @@ define("container",
|
|
9387
9573
|
|
9388
9574
|
this.registry = new InheritingDict(parent && parent.registry);
|
9389
9575
|
this.cache = new InheritingDict(parent && parent.cache);
|
9390
|
-
this.factoryCache = new InheritingDict(parent && parent.
|
9576
|
+
this.factoryCache = new InheritingDict(parent && parent.factoryCache);
|
9577
|
+
this.resolveCache = new InheritingDict(parent && parent.resolveCache);
|
9391
9578
|
this.typeInjections = new InheritingDict(parent && parent.typeInjections);
|
9392
9579
|
this.injections = {};
|
9393
9580
|
|
@@ -9508,9 +9695,7 @@ define("container",
|
|
9508
9695
|
@param {Object} options
|
9509
9696
|
*/
|
9510
9697
|
register: function(fullName, factory, options) {
|
9511
|
-
|
9512
|
-
throw new TypeError("malformed fullName, expected: `type:name` got: " + fullName + "");
|
9513
|
-
}
|
9698
|
+
validateFullName(fullName);
|
9514
9699
|
|
9515
9700
|
if (factory === undefined) {
|
9516
9701
|
throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`');
|
@@ -9543,11 +9728,14 @@ define("container",
|
|
9543
9728
|
@param {String} fullName
|
9544
9729
|
*/
|
9545
9730
|
unregister: function(fullName) {
|
9731
|
+
validateFullName(fullName);
|
9732
|
+
|
9546
9733
|
var normalizedName = this.normalize(fullName);
|
9547
9734
|
|
9548
9735
|
this.registry.remove(normalizedName);
|
9549
9736
|
this.cache.remove(normalizedName);
|
9550
9737
|
this.factoryCache.remove(normalizedName);
|
9738
|
+
this.resolveCache.remove(normalizedName);
|
9551
9739
|
this._options.remove(normalizedName);
|
9552
9740
|
},
|
9553
9741
|
|
@@ -9584,7 +9772,18 @@ define("container",
|
|
9584
9772
|
@return {Function} fullName's factory
|
9585
9773
|
*/
|
9586
9774
|
resolve: function(fullName) {
|
9587
|
-
|
9775
|
+
validateFullName(fullName);
|
9776
|
+
|
9777
|
+
var normalizedName = this.normalize(fullName);
|
9778
|
+
var cached = this.resolveCache.get(normalizedName);
|
9779
|
+
|
9780
|
+
if (cached) { return cached; }
|
9781
|
+
|
9782
|
+
var resolved = this.resolver(normalizedName) || this.registry.get(normalizedName);
|
9783
|
+
|
9784
|
+
this.resolveCache.set(normalizedName, resolved);
|
9785
|
+
|
9786
|
+
return resolved;
|
9588
9787
|
},
|
9589
9788
|
|
9590
9789
|
/**
|
@@ -9665,23 +9864,8 @@ define("container",
|
|
9665
9864
|
@return {any}
|
9666
9865
|
*/
|
9667
9866
|
lookup: function(fullName, options) {
|
9668
|
-
|
9669
|
-
|
9670
|
-
options = options || {};
|
9671
|
-
|
9672
|
-
if (this.cache.has(fullName) && options.singleton !== false) {
|
9673
|
-
return this.cache.get(fullName);
|
9674
|
-
}
|
9675
|
-
|
9676
|
-
var value = instantiate(this, fullName);
|
9677
|
-
|
9678
|
-
if (value === undefined) { return; }
|
9679
|
-
|
9680
|
-
if (isSingleton(this, fullName) && options.singleton !== false) {
|
9681
|
-
this.cache.set(fullName, value);
|
9682
|
-
}
|
9683
|
-
|
9684
|
-
return value;
|
9867
|
+
validateFullName(fullName);
|
9868
|
+
return lookup(this, this.normalize(fullName), options);
|
9685
9869
|
},
|
9686
9870
|
|
9687
9871
|
/**
|
@@ -9692,7 +9876,8 @@ define("container",
|
|
9692
9876
|
@return {any}
|
9693
9877
|
*/
|
9694
9878
|
lookupFactory: function(fullName) {
|
9695
|
-
|
9879
|
+
validateFullName(fullName);
|
9880
|
+
return factoryFor(this, this.normalize(fullName));
|
9696
9881
|
},
|
9697
9882
|
|
9698
9883
|
/**
|
@@ -9704,11 +9889,8 @@ define("container",
|
|
9704
9889
|
@return {Boolean}
|
9705
9890
|
*/
|
9706
9891
|
has: function(fullName) {
|
9707
|
-
|
9708
|
-
|
9709
|
-
}
|
9710
|
-
|
9711
|
-
return !!this.resolve(fullName);
|
9892
|
+
validateFullName(fullName);
|
9893
|
+
return has(this, this.normalize(fullName));
|
9712
9894
|
},
|
9713
9895
|
|
9714
9896
|
/**
|
@@ -9790,6 +9972,7 @@ define("container",
|
|
9790
9972
|
@param {String} fullName
|
9791
9973
|
*/
|
9792
9974
|
typeInjection: function(type, property, fullName) {
|
9975
|
+
validateFullName(fullName);
|
9793
9976
|
if (this.parent) { illegalChildOperation('typeInjection'); }
|
9794
9977
|
|
9795
9978
|
addTypeInjection(this.typeInjections, type, property, fullName);
|
@@ -9839,14 +10022,20 @@ define("container",
|
|
9839
10022
|
@param {String} property
|
9840
10023
|
@param {String} injectionName
|
9841
10024
|
*/
|
9842
|
-
injection: function(
|
10025
|
+
injection: function(fullName, property, injectionName) {
|
9843
10026
|
if (this.parent) { illegalChildOperation('injection'); }
|
9844
10027
|
|
9845
|
-
|
9846
|
-
|
10028
|
+
validateFullName(injectionName);
|
10029
|
+
var normalizedInjectionName = this.normalize(injectionName);
|
10030
|
+
|
10031
|
+
if (fullName.indexOf(':') === -1) {
|
10032
|
+
return this.typeInjection(fullName, property, normalizedInjectionName);
|
9847
10033
|
}
|
9848
10034
|
|
9849
|
-
|
10035
|
+
validateFullName(fullName);
|
10036
|
+
var normalizedName = this.normalize(fullName);
|
10037
|
+
|
10038
|
+
addInjection(this.injections, normalizedName, property, normalizedInjectionName);
|
9850
10039
|
},
|
9851
10040
|
|
9852
10041
|
|
@@ -9883,7 +10072,7 @@ define("container",
|
|
9883
10072
|
factoryTypeInjection: function(type, property, fullName) {
|
9884
10073
|
if (this.parent) { illegalChildOperation('factoryTypeInjection'); }
|
9885
10074
|
|
9886
|
-
addTypeInjection(this.factoryTypeInjections, type, property, fullName);
|
10075
|
+
addTypeInjection(this.factoryTypeInjections, type, property, this.normalize(fullName));
|
9887
10076
|
},
|
9888
10077
|
|
9889
10078
|
/**
|
@@ -9935,14 +10124,21 @@ define("container",
|
|
9935
10124
|
@param {String} property
|
9936
10125
|
@param {String} injectionName
|
9937
10126
|
*/
|
9938
|
-
factoryInjection: function(
|
10127
|
+
factoryInjection: function(fullName, property, injectionName) {
|
9939
10128
|
if (this.parent) { illegalChildOperation('injection'); }
|
9940
10129
|
|
9941
|
-
|
9942
|
-
|
10130
|
+
var normalizedName = this.normalize(fullName);
|
10131
|
+
var normalizedInjectionName = this.normalize(injectionName);
|
10132
|
+
|
10133
|
+
validateFullName(injectionName);
|
10134
|
+
|
10135
|
+
if (fullName.indexOf(':') === -1) {
|
10136
|
+
return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName);
|
9943
10137
|
}
|
9944
10138
|
|
9945
|
-
|
10139
|
+
validateFullName(fullName);
|
10140
|
+
|
10141
|
+
addInjection(this.factoryInjections, normalizedName, property, normalizedInjectionName);
|
9946
10142
|
},
|
9947
10143
|
|
9948
10144
|
/**
|
@@ -9952,7 +10148,6 @@ define("container",
|
|
9952
10148
|
@method destroy
|
9953
10149
|
*/
|
9954
10150
|
destroy: function() {
|
9955
|
-
|
9956
10151
|
for (var i=0, l=this.children.length; i<l; i++) {
|
9957
10152
|
this.children[i].destroy();
|
9958
10153
|
}
|
@@ -9978,6 +10173,32 @@ define("container",
|
|
9978
10173
|
}
|
9979
10174
|
};
|
9980
10175
|
|
10176
|
+
function has(container, fullName){
|
10177
|
+
if (container.cache.has(fullName)) {
|
10178
|
+
return true;
|
10179
|
+
}
|
10180
|
+
|
10181
|
+
return !!container.resolve(fullName);
|
10182
|
+
}
|
10183
|
+
|
10184
|
+
function lookup(container, fullName, options) {
|
10185
|
+
options = options || {};
|
10186
|
+
|
10187
|
+
if (container.cache.has(fullName) && options.singleton !== false) {
|
10188
|
+
return container.cache.get(fullName);
|
10189
|
+
}
|
10190
|
+
|
10191
|
+
var value = instantiate(container, fullName);
|
10192
|
+
|
10193
|
+
if (value === undefined) { return; }
|
10194
|
+
|
10195
|
+
if (isSingleton(container, fullName) && options.singleton !== false) {
|
10196
|
+
container.cache.set(fullName, value);
|
10197
|
+
}
|
10198
|
+
|
10199
|
+
return value;
|
10200
|
+
}
|
10201
|
+
|
9981
10202
|
function illegalChildOperation(operation) {
|
9982
10203
|
throw new Error(operation + " is not currently supported on child containers");
|
9983
10204
|
}
|
@@ -9993,14 +10214,14 @@ define("container",
|
|
9993
10214
|
|
9994
10215
|
if (!injections) { return hash; }
|
9995
10216
|
|
9996
|
-
var injection,
|
10217
|
+
var injection, injectable;
|
9997
10218
|
|
9998
10219
|
for (var i=0, l=injections.length; i<l; i++) {
|
9999
10220
|
injection = injections[i];
|
10000
|
-
|
10221
|
+
injectable = lookup(container, injection.fullName);
|
10001
10222
|
|
10002
|
-
if (
|
10003
|
-
hash[injection.property] =
|
10223
|
+
if (injectable !== undefined) {
|
10224
|
+
hash[injection.property] = injectable;
|
10004
10225
|
} else {
|
10005
10226
|
throw new Error('Attempting to inject an unknown injection: `' + injection.fullName + '`');
|
10006
10227
|
}
|
@@ -10025,7 +10246,7 @@ define("container",
|
|
10025
10246
|
}
|
10026
10247
|
|
10027
10248
|
function factoryFor(container, fullName) {
|
10028
|
-
var name =
|
10249
|
+
var name = fullName;
|
10029
10250
|
var factory = container.resolve(name);
|
10030
10251
|
var injectedFactory;
|
10031
10252
|
var cache = container.factoryCache;
|
@@ -10135,6 +10356,13 @@ define("container",
|
|
10135
10356
|
});
|
10136
10357
|
}
|
10137
10358
|
|
10359
|
+
var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/;
|
10360
|
+
function validateFullName(fullName) {
|
10361
|
+
if (!VALID_FULL_NAME_REGEXP.test(fullName)) {
|
10362
|
+
throw new TypeError('Invalid Fullname, expected: `type:name` got: ' + fullName);
|
10363
|
+
}
|
10364
|
+
}
|
10365
|
+
|
10138
10366
|
function addInjection(rules, factoryName, property, injectionName) {
|
10139
10367
|
var injections = rules[factoryName] = rules[factoryName] || [];
|
10140
10368
|
injections.push({ property: property, fullName: injectionName });
|
@@ -10329,39 +10557,6 @@ Ember.copy = function(obj, deep) {
|
|
10329
10557
|
return _copy(obj, deep, deep ? [] : null, deep ? [] : null);
|
10330
10558
|
};
|
10331
10559
|
|
10332
|
-
/**
|
10333
|
-
Convenience method to inspect an object. This method will attempt to
|
10334
|
-
convert the object into a useful string description.
|
10335
|
-
|
10336
|
-
It is a pretty simple implementation. If you want something more robust,
|
10337
|
-
use something like JSDump: https://github.com/NV/jsDump
|
10338
|
-
|
10339
|
-
@method inspect
|
10340
|
-
@for Ember
|
10341
|
-
@param {Object} obj The object you want to inspect.
|
10342
|
-
@return {String} A description of the object
|
10343
|
-
*/
|
10344
|
-
Ember.inspect = function(obj) {
|
10345
|
-
var type = Ember.typeOf(obj);
|
10346
|
-
if (type === 'array') {
|
10347
|
-
return '[' + obj + ']';
|
10348
|
-
}
|
10349
|
-
if (type !== 'object') {
|
10350
|
-
return obj + '';
|
10351
|
-
}
|
10352
|
-
|
10353
|
-
var v, ret = [];
|
10354
|
-
for(var key in obj) {
|
10355
|
-
if (obj.hasOwnProperty(key)) {
|
10356
|
-
v = obj[key];
|
10357
|
-
if (v === 'toString') { continue; } // ignore useless items
|
10358
|
-
if (Ember.typeOf(v) === 'function') { v = "function() { ... }"; }
|
10359
|
-
ret.push(key + ": " + v);
|
10360
|
-
}
|
10361
|
-
}
|
10362
|
-
return "{" + ret.join(", ") + "}";
|
10363
|
-
};
|
10364
|
-
|
10365
10560
|
/**
|
10366
10561
|
Compares two objects, returning true if they are logically equal. This is
|
10367
10562
|
a deeper comparison than a simple triple equal. For sets it will compare the
|
@@ -10466,6 +10661,10 @@ var STRING_DECAMELIZE_REGEXP = (/([a-z\d])([A-Z])/g);
|
|
10466
10661
|
var STRING_CAMELIZE_REGEXP = (/(\-|_|\.|\s)+(.)?/g);
|
10467
10662
|
var STRING_UNDERSCORE_REGEXP_1 = (/([a-z\d])([A-Z]+)/g);
|
10468
10663
|
var STRING_UNDERSCORE_REGEXP_2 = (/\-|\s+/g);
|
10664
|
+
var STRING_PARAMETERIZE_REGEXP_1 = (/[_|\/|\s]+/g);
|
10665
|
+
var STRING_PARAMETERIZE_REGEXP_2 = (/[^a-z0-9\-]+/gi);
|
10666
|
+
var STRING_PARAMETERIZE_REGEXP_3 = (/[\-]+/g);
|
10667
|
+
var STRING_PARAMETERIZE_REGEXP_4 = (/^-+|-+$/g);
|
10469
10668
|
|
10470
10669
|
/**
|
10471
10670
|
Defines the hash of localized strings for the current language. Used by
|
@@ -10704,6 +10903,54 @@ Ember.String = {
|
|
10704
10903
|
}
|
10705
10904
|
};
|
10706
10905
|
|
10906
|
+
if (Ember.FEATURES.isEnabled("string-humanize")) {
|
10907
|
+
/**
|
10908
|
+
Returns the Humanized form of a string
|
10909
|
+
|
10910
|
+
Replaces underscores with spaces, and capitializes first character
|
10911
|
+
of string. Also strips "_id" suffixes.
|
10912
|
+
|
10913
|
+
```javascript
|
10914
|
+
'first_name'.humanize() // 'First name'
|
10915
|
+
'user_id'.humanize() // 'User'
|
10916
|
+
```
|
10917
|
+
|
10918
|
+
@method humanize
|
10919
|
+
@param {String} str The string to humanize.
|
10920
|
+
@return {String} The humanized string.
|
10921
|
+
*/
|
10922
|
+
|
10923
|
+
Ember.String.humanize = function(str) {
|
10924
|
+
return str.replace(/_id$/, '').
|
10925
|
+
replace(/_/g, ' ').
|
10926
|
+
replace(/^\w/g, function(s){
|
10927
|
+
return s.toUpperCase();
|
10928
|
+
});
|
10929
|
+
};
|
10930
|
+
}
|
10931
|
+
|
10932
|
+
if (Ember.FEATURES.isEnabled("string-parameterize")) {
|
10933
|
+
/**
|
10934
|
+
Transforms a string so that it may be used as part of a 'pretty' / SEO friendly URL.
|
10935
|
+
|
10936
|
+
```javascript
|
10937
|
+
'My favorite items.'.parameterize(); // 'my-favorite-items'
|
10938
|
+
'action_name'.parameterize(); // 'action-name'
|
10939
|
+
'100 ways Ember.js is better than Angular.'.parameterize(); // '100-ways-emberjs-is-better-than-angular'
|
10940
|
+
```
|
10941
|
+
|
10942
|
+
@method parameterize
|
10943
|
+
@param {String} str The string to parameterize.
|
10944
|
+
@return {String} the parameterized string.
|
10945
|
+
*/
|
10946
|
+
Ember.String.parameterize = function(str) {
|
10947
|
+
return str.replace(STRING_PARAMETERIZE_REGEXP_1, '-') // replace underscores, slashes and spaces with separator
|
10948
|
+
.replace(STRING_PARAMETERIZE_REGEXP_2, '') // remove non-alphanumeric characters except the separator
|
10949
|
+
.replace(STRING_PARAMETERIZE_REGEXP_3, '-') // replace multiple occurring separators
|
10950
|
+
.replace(STRING_PARAMETERIZE_REGEXP_4, '') // trim leading and trailing separators
|
10951
|
+
.toLowerCase();
|
10952
|
+
};
|
10953
|
+
}
|
10707
10954
|
|
10708
10955
|
|
10709
10956
|
})();
|
@@ -10728,6 +10975,13 @@ var fmt = Ember.String.fmt,
|
|
10728
10975
|
capitalize = Ember.String.capitalize,
|
10729
10976
|
classify = Ember.String.classify;
|
10730
10977
|
|
10978
|
+
if (Ember.FEATURES.isEnabled("string-humanize")) {
|
10979
|
+
var humanize = Ember.String.humanize;
|
10980
|
+
}
|
10981
|
+
|
10982
|
+
if (Ember.FEATURES.isEnabled("string-parameterize")) {
|
10983
|
+
var parameterize = Ember.String.parameterize;
|
10984
|
+
}
|
10731
10985
|
|
10732
10986
|
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
10733
10987
|
|
@@ -10821,7 +11075,30 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
10821
11075
|
return capitalize(this);
|
10822
11076
|
};
|
10823
11077
|
|
10824
|
-
|
11078
|
+
if (Ember.FEATURES.isEnabled("string-humanize")) {
|
11079
|
+
/**
|
11080
|
+
See [Ember.String.humanize](/api/classes/Ember.String.html#method_humanize).
|
11081
|
+
|
11082
|
+
@method humanize
|
11083
|
+
@for String
|
11084
|
+
*/
|
11085
|
+
String.prototype.humanize = function() {
|
11086
|
+
return humanize(this);
|
11087
|
+
};
|
11088
|
+
}
|
11089
|
+
|
11090
|
+
if (Ember.FEATURES.isEnabled("string-parameterize")) {
|
11091
|
+
/**
|
11092
|
+
See [Ember.String.parameterize](/api/classes/Ember.String.html#method_parameterize).
|
11093
|
+
|
11094
|
+
@method parameterize
|
11095
|
+
@for String
|
11096
|
+
*/
|
11097
|
+
String.prototype.parameterize = function() {
|
11098
|
+
return parameterize(this);
|
11099
|
+
};
|
11100
|
+
}
|
11101
|
+
|
10825
11102
|
}
|
10826
11103
|
|
10827
11104
|
|
@@ -13194,7 +13471,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
13194
13471
|
var ret = initialValue;
|
13195
13472
|
|
13196
13473
|
this.forEach(function(item, i) {
|
13197
|
-
ret = callback
|
13474
|
+
ret = callback(ret, item, i, this, reducerProperty);
|
13198
13475
|
}, this);
|
13199
13476
|
|
13200
13477
|
return ret;
|
@@ -13217,7 +13494,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
13217
13494
|
this.forEach(function(x, idx) {
|
13218
13495
|
var method = x && x[methodName];
|
13219
13496
|
if ('function' === typeof method) {
|
13220
|
-
ret[idx] = args ? method.apply(x, args) :
|
13497
|
+
ret[idx] = args ? method.apply(x, args) : x[methodName]();
|
13221
13498
|
}
|
13222
13499
|
}, this);
|
13223
13500
|
|
@@ -13412,8 +13689,6 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
13412
13689
|
notify range observers.
|
13413
13690
|
|
13414
13691
|
@method enumerableContentDidChange
|
13415
|
-
@param {Number} [start] optional start offset for the content change.
|
13416
|
-
For unordered enumerables, you should always pass -1.
|
13417
13692
|
@param {Ember.Enumerable|Number} removing An enumerable of the objects to
|
13418
13693
|
be removed or the number of items to be removed.
|
13419
13694
|
@param {Ember.Enumerable|Number} adding An enumerable of the objects to
|
@@ -13623,7 +13898,7 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
13623
13898
|
|
13624
13899
|
@method slice
|
13625
13900
|
@param {Integer} beginIndex (Optional) index to begin slicing from.
|
13626
|
-
@param {Integer} endIndex (Optional) index to end the slice at.
|
13901
|
+
@param {Integer} endIndex (Optional) index to end the slice at (but not included).
|
13627
13902
|
@return {Array} New array with specified slice
|
13628
13903
|
*/
|
13629
13904
|
slice: function(beginIndex, endIndex) {
|
@@ -13774,7 +14049,7 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
13774
14049
|
Becomes true whenever the array currently has observers watching changes
|
13775
14050
|
on the array.
|
13776
14051
|
|
13777
|
-
@property Boolean
|
14052
|
+
@property {Boolean} hasArrayObservers
|
13778
14053
|
*/
|
13779
14054
|
hasArrayObservers: Ember.computed(function() {
|
13780
14055
|
return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');
|
@@ -13923,6 +14198,9 @@ var e_get = Ember.get,
|
|
13923
14198
|
doubleEachPropertyPattern = /(.*\.@each){2,}/,
|
13924
14199
|
arrayBracketPattern = /\.\[\]$/;
|
13925
14200
|
|
14201
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
14202
|
+
var expandProperties = Ember.expandProperties;
|
14203
|
+
}
|
13926
14204
|
|
13927
14205
|
function get(obj, key) {
|
13928
14206
|
if (key === '@this') {
|
@@ -14508,10 +14786,17 @@ ReduceComputedProperty.prototype.property = function () {
|
|
14508
14786
|
} else if (match = eachPropertyPattern.exec(dependentKey)) {
|
14509
14787
|
dependentArrayKey = match[1];
|
14510
14788
|
|
14511
|
-
|
14789
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
14790
|
+
var itemPropertyKeyPattern = match[2],
|
14791
|
+
addItemPropertyKey = function (itemPropertyKey) {
|
14792
|
+
cp.itemPropertyKey(dependentArrayKey, itemPropertyKey);
|
14793
|
+
};
|
14794
|
+
|
14795
|
+
expandProperties(itemPropertyKeyPattern, addItemPropertyKey);
|
14796
|
+
} else {
|
14512
14797
|
itemPropertyKey = match[2];
|
14513
14798
|
cp.itemPropertyKey(dependentArrayKey, itemPropertyKey);
|
14514
|
-
|
14799
|
+
}
|
14515
14800
|
propertyArgs.add(dependentArrayKey);
|
14516
14801
|
} else {
|
14517
14802
|
propertyArgs.add(dependentKey);
|
@@ -14622,7 +14907,7 @@ ReduceComputedProperty.prototype.property = function () {
|
|
14622
14907
|
|
14623
14908
|
```javascript
|
14624
14909
|
Ember.computed.max = function (dependentKey) {
|
14625
|
-
return Ember.reduceComputed
|
14910
|
+
return Ember.reduceComputed(dependentKey, {
|
14626
14911
|
initialValue: -Infinity,
|
14627
14912
|
|
14628
14913
|
addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {
|
@@ -14931,8 +15216,6 @@ var get = Ember.get,
|
|
14931
15216
|
dependent array. This will return `-Infinity` when the dependent
|
14932
15217
|
array is empty.
|
14933
15218
|
|
14934
|
-
Example
|
14935
|
-
|
14936
15219
|
```javascript
|
14937
15220
|
App.Person = Ember.Object.extend({
|
14938
15221
|
childAges: Ember.computed.mapBy('children', 'age'),
|
@@ -14941,9 +15224,17 @@ var get = Ember.get,
|
|
14941
15224
|
|
14942
15225
|
var lordByron = App.Person.create({children: []});
|
14943
15226
|
lordByron.get('maxChildAge'); // -Infinity
|
14944
|
-
lordByron.get('children').pushObject({
|
15227
|
+
lordByron.get('children').pushObject({
|
15228
|
+
name: 'Augusta Ada Byron', age: 7
|
15229
|
+
});
|
14945
15230
|
lordByron.get('maxChildAge'); // 7
|
14946
|
-
lordByron.get('children').pushObjects([{
|
15231
|
+
lordByron.get('children').pushObjects([{
|
15232
|
+
name: 'Allegra Byron',
|
15233
|
+
age: 5
|
15234
|
+
}, {
|
15235
|
+
name: 'Elizabeth Medora Leigh',
|
15236
|
+
age: 8
|
15237
|
+
}]);
|
14947
15238
|
lordByron.get('maxChildAge'); // 8
|
14948
15239
|
```
|
14949
15240
|
|
@@ -14953,7 +15244,7 @@ var get = Ember.get,
|
|
14953
15244
|
@return {Ember.ComputedProperty} computes the largest value in the dependentKey's array
|
14954
15245
|
*/
|
14955
15246
|
Ember.computed.max = function (dependentKey) {
|
14956
|
-
return Ember.reduceComputed
|
15247
|
+
return Ember.reduceComputed(dependentKey, {
|
14957
15248
|
initialValue: -Infinity,
|
14958
15249
|
|
14959
15250
|
addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {
|
@@ -14973,8 +15264,6 @@ Ember.computed.max = function (dependentKey) {
|
|
14973
15264
|
dependent array. This will return `Infinity` when the dependent
|
14974
15265
|
array is empty.
|
14975
15266
|
|
14976
|
-
Example
|
14977
|
-
|
14978
15267
|
```javascript
|
14979
15268
|
App.Person = Ember.Object.extend({
|
14980
15269
|
childAges: Ember.computed.mapBy('children', 'age'),
|
@@ -14983,9 +15272,17 @@ Ember.computed.max = function (dependentKey) {
|
|
14983
15272
|
|
14984
15273
|
var lordByron = App.Person.create({children: []});
|
14985
15274
|
lordByron.get('minChildAge'); // Infinity
|
14986
|
-
lordByron.get('children').pushObject({
|
15275
|
+
lordByron.get('children').pushObject({
|
15276
|
+
name: 'Augusta Ada Byron', age: 7
|
15277
|
+
});
|
14987
15278
|
lordByron.get('minChildAge'); // 7
|
14988
|
-
lordByron.get('children').pushObjects([{
|
15279
|
+
lordByron.get('children').pushObjects([{
|
15280
|
+
name: 'Allegra Byron',
|
15281
|
+
age: 5
|
15282
|
+
}, {
|
15283
|
+
name: 'Elizabeth Medora Leigh',
|
15284
|
+
age: 8
|
15285
|
+
}]);
|
14989
15286
|
lordByron.get('minChildAge'); // 5
|
14990
15287
|
```
|
14991
15288
|
|
@@ -14995,7 +15292,7 @@ Ember.computed.max = function (dependentKey) {
|
|
14995
15292
|
@return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array
|
14996
15293
|
*/
|
14997
15294
|
Ember.computed.min = function (dependentKey) {
|
14998
|
-
return Ember.reduceComputed
|
15295
|
+
return Ember.reduceComputed(dependentKey, {
|
14999
15296
|
initialValue: Infinity,
|
15000
15297
|
|
15001
15298
|
addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {
|
@@ -15013,14 +15310,13 @@ Ember.computed.min = function (dependentKey) {
|
|
15013
15310
|
/**
|
15014
15311
|
Returns an array mapped via the callback
|
15015
15312
|
|
15016
|
-
The callback method you provide should have the following signature
|
15313
|
+
The callback method you provide should have the following signature.
|
15314
|
+
`item` is the current item in the iteration.
|
15017
15315
|
|
15018
15316
|
```javascript
|
15019
15317
|
function(item);
|
15020
15318
|
```
|
15021
15319
|
|
15022
|
-
- `item` is the current item in the iteration.
|
15023
|
-
|
15024
15320
|
Example
|
15025
15321
|
|
15026
15322
|
```javascript
|
@@ -15030,8 +15326,10 @@ Ember.computed.min = function (dependentKey) {
|
|
15030
15326
|
})
|
15031
15327
|
});
|
15032
15328
|
|
15033
|
-
var hamster = App.Hamster.create({
|
15034
|
-
|
15329
|
+
var hamster = App.Hamster.create({
|
15330
|
+
chores: ['clean', 'write more unit tests']
|
15331
|
+
});
|
15332
|
+
hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
|
15035
15333
|
```
|
15036
15334
|
|
15037
15335
|
@method computed.map
|
@@ -15059,8 +15357,6 @@ Ember.computed.map = function(dependentKey, callback) {
|
|
15059
15357
|
/**
|
15060
15358
|
Returns an array mapped to the specified key.
|
15061
15359
|
|
15062
|
-
Example
|
15063
|
-
|
15064
15360
|
```javascript
|
15065
15361
|
App.Person = Ember.Object.extend({
|
15066
15362
|
childAges: Ember.computed.mapBy('children', 'age')
|
@@ -15070,7 +15366,13 @@ Ember.computed.map = function(dependentKey, callback) {
|
|
15070
15366
|
lordByron.get('childAges'); // []
|
15071
15367
|
lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});
|
15072
15368
|
lordByron.get('childAges'); // [7]
|
15073
|
-
lordByron.get('children').pushObjects([{
|
15369
|
+
lordByron.get('children').pushObjects([{
|
15370
|
+
name: 'Allegra Byron',
|
15371
|
+
age: 5
|
15372
|
+
}, {
|
15373
|
+
name: 'Elizabeth Medora Leigh',
|
15374
|
+
age: 8
|
15375
|
+
}]);
|
15074
15376
|
lordByron.get('childAges'); // [7, 5, 8]
|
15075
15377
|
```
|
15076
15378
|
|
@@ -15097,16 +15399,13 @@ Ember.computed.mapProperty = Ember.computed.mapBy;
|
|
15097
15399
|
/**
|
15098
15400
|
Filters the array by the callback.
|
15099
15401
|
|
15100
|
-
The callback method you provide should have the following signature
|
15402
|
+
The callback method you provide should have the following signature.
|
15403
|
+
`item` is the current item in the iteration.
|
15101
15404
|
|
15102
15405
|
```javascript
|
15103
15406
|
function(item);
|
15104
15407
|
```
|
15105
15408
|
|
15106
|
-
- `item` is the current item in the iteration.
|
15107
|
-
|
15108
|
-
Example
|
15109
|
-
|
15110
15409
|
```javascript
|
15111
15410
|
App.Hamster = Ember.Object.extend({
|
15112
15411
|
remainingChores: Ember.computed.filter('chores', function(chore) {
|
@@ -15162,8 +15461,6 @@ Ember.computed.filter = function(dependentKey, callback) {
|
|
15162
15461
|
/**
|
15163
15462
|
Filters the array by the property and value
|
15164
15463
|
|
15165
|
-
Example
|
15166
|
-
|
15167
15464
|
```javascript
|
15168
15465
|
App.Hamster = Ember.Object.extend({
|
15169
15466
|
remainingChores: Ember.computed.filterBy('chores', 'done', false)
|
@@ -15386,7 +15683,7 @@ Ember.computed.setDiff = function (setAProperty, setBProperty) {
|
|
15386
15683
|
if (arguments.length !== 2) {
|
15387
15684
|
throw new Ember.Error("setDiff requires exactly two dependent arrays.");
|
15388
15685
|
}
|
15389
|
-
return Ember.arrayComputed
|
15686
|
+
return Ember.arrayComputed(setAProperty, setBProperty, {
|
15390
15687
|
addedItem: function (array, item, changeMeta, instanceMeta) {
|
15391
15688
|
var setA = get(this, setAProperty),
|
15392
15689
|
setB = get(this, setBProperty);
|
@@ -15588,7 +15885,7 @@ Ember.computed.sort = function (itemsKey, sortDefinition) {
|
|
15588
15885
|
};
|
15589
15886
|
}
|
15590
15887
|
|
15591
|
-
return Ember.arrayComputed
|
15888
|
+
return Ember.arrayComputed(itemsKey, {
|
15592
15889
|
initialize: initFn,
|
15593
15890
|
|
15594
15891
|
addedItem: function (array, item, changeMeta, instanceMeta) {
|
@@ -15651,6 +15948,9 @@ Ember.RSVP.on('error', Ember.RSVP.onerrorDefault);
|
|
15651
15948
|
|
15652
15949
|
var a_slice = Array.prototype.slice;
|
15653
15950
|
|
15951
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
15952
|
+
var expandProperties = Ember.expandProperties;
|
15953
|
+
}
|
15654
15954
|
|
15655
15955
|
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {
|
15656
15956
|
|
@@ -15747,9 +16047,18 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {
|
|
15747
16047
|
@for Function
|
15748
16048
|
*/
|
15749
16049
|
Function.prototype.observes = function() {
|
15750
|
-
|
16050
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
16051
|
+
var addWatchedProperty = function (obs) { watched.push(obs); };
|
16052
|
+
var watched = [];
|
16053
|
+
|
16054
|
+
for (var i=0; i<arguments.length; ++i) {
|
16055
|
+
expandProperties(arguments[i], addWatchedProperty);
|
16056
|
+
}
|
16057
|
+
|
16058
|
+
this.__ember_observes__ = watched;
|
16059
|
+
} else {
|
15751
16060
|
this.__ember_observes__ = a_slice.call(arguments);
|
15752
|
-
|
16061
|
+
}
|
15753
16062
|
|
15754
16063
|
return this;
|
15755
16064
|
};
|
@@ -15812,9 +16121,18 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {
|
|
15812
16121
|
@for Function
|
15813
16122
|
*/
|
15814
16123
|
Function.prototype.observesBefore = function() {
|
15815
|
-
|
16124
|
+
if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {
|
16125
|
+
var addWatchedProperty = function (obs) { watched.push(obs); };
|
16126
|
+
var watched = [];
|
16127
|
+
|
16128
|
+
for (var i=0; i<arguments.length; ++i) {
|
16129
|
+
expandProperties(arguments[i], addWatchedProperty);
|
16130
|
+
}
|
16131
|
+
|
16132
|
+
this.__ember_observesBefore__ = watched;
|
16133
|
+
} else {
|
15816
16134
|
this.__ember_observesBefore__ = a_slice.call(arguments);
|
15817
|
-
|
16135
|
+
}
|
15818
16136
|
|
15819
16137
|
return this;
|
15820
16138
|
};
|
@@ -16785,6 +17103,11 @@ RSVP.configure('async', function(callback, promise) {
|
|
16785
17103
|
Ember.run.schedule('actions', promise, callback, promise);
|
16786
17104
|
});
|
16787
17105
|
|
17106
|
+
RSVP.Promise.prototype.fail = function(callback, label){
|
17107
|
+
Ember.deprecate('RSVP.Promise.fail has been renamed as RSVP.Promise.catch');
|
17108
|
+
return this['catch'](callback, label);
|
17109
|
+
};
|
17110
|
+
|
16788
17111
|
/**
|
16789
17112
|
@module ember
|
16790
17113
|
@submodule ember-runtime
|
@@ -16894,6 +17217,8 @@ Ember.ActionHandler = Ember.Mixin.create({
|
|
16894
17217
|
var hashName;
|
16895
17218
|
|
16896
17219
|
if (!props._actions) {
|
17220
|
+
Ember.assert(this + " 'actions' should not be a function", typeof(props.actions) !== 'function');
|
17221
|
+
|
16897
17222
|
if (typeOf(props.actions) === 'object') {
|
16898
17223
|
hashName = 'actions';
|
16899
17224
|
} else if (typeOf(props.events) === 'object') {
|
@@ -16940,8 +17265,6 @@ Ember.ActionHandler = Ember.Mixin.create({
|
|
16940
17265
|
|
16941
17266
|
(function() {
|
16942
17267
|
var set = Ember.set, get = Ember.get,
|
16943
|
-
resolve = Ember.RSVP.resolve,
|
16944
|
-
rethrow = Ember.RSVP.rethrow,
|
16945
17268
|
not = Ember.computed.not,
|
16946
17269
|
or = Ember.computed.or;
|
16947
17270
|
|
@@ -16950,14 +17273,15 @@ var set = Ember.set, get = Ember.get,
|
|
16950
17273
|
@submodule ember-runtime
|
16951
17274
|
*/
|
16952
17275
|
|
16953
|
-
function
|
16954
|
-
promise.then(function(value) {
|
17276
|
+
function tap(proxy, promise) {
|
17277
|
+
return promise.then(function(value) {
|
16955
17278
|
set(proxy, 'isFulfilled', true);
|
16956
17279
|
set(proxy, 'content', value);
|
17280
|
+
return value;
|
16957
17281
|
}, function(reason) {
|
16958
17282
|
set(proxy, 'isRejected', true);
|
16959
17283
|
set(proxy, 'reason', reason);
|
16960
|
-
|
17284
|
+
throw reason;
|
16961
17285
|
});
|
16962
17286
|
}
|
16963
17287
|
|
@@ -17035,9 +17359,7 @@ Ember.PromiseProxyMixin = Ember.Mixin.create({
|
|
17035
17359
|
|
17036
17360
|
promise: Ember.computed(function(key, promise) {
|
17037
17361
|
if (arguments.length === 2) {
|
17038
|
-
|
17039
|
-
observePromise(this, promise);
|
17040
|
-
return promise.then(); // fork the promise.
|
17362
|
+
return tap(this, promise);
|
17041
17363
|
} else {
|
17042
17364
|
throw new Ember.Error("PromiseProxy's promise must be set");
|
17043
17365
|
}
|