ember-source 1.4.0.beta.1 → 1.4.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-data-deps.js +209 -62
- data/dist/ember-data-deps.min.js +4 -4
- data/dist/ember-data-deps.prod.js +207 -60
- data/dist/ember-debug.js +1 -1
- data/dist/ember-runtime.js +209 -62
- data/dist/ember-runtime.min.js +4 -4
- data/dist/ember-runtime.prod.js +207 -60
- data/dist/ember-spade.js +2 -2
- data/dist/ember-template-compiler.js +1 -1
- data/dist/ember-template-compiler.min.js +1 -1
- data/dist/ember-template-compiler.prod.js +1 -1
- data/dist/ember-tests.js +2 -2
- data/dist/ember.js +251 -95
- data/dist/ember.min.js +9 -9
- data/dist/ember.prod.js +248 -92
- metadata +2 -2
data/dist/ember-debug.js
CHANGED
@@ -7,7 +7,7 @@ var Ember = { assert: function() {}, FEATURES: { isEnabled: function() {} } };
|
|
7
7
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
8
8
|
* @license Licensed under MIT license
|
9
9
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
10
|
-
* @version 1.4.0-beta.
|
10
|
+
* @version 1.4.0-beta.2
|
11
11
|
*/
|
12
12
|
|
13
13
|
|
data/dist/ember-runtime.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
6
6
|
* @license Licensed under MIT license
|
7
7
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
8
|
-
* @version 1.4.0-beta.
|
8
|
+
* @version 1.4.0-beta.2
|
9
9
|
*/
|
10
10
|
|
11
11
|
|
@@ -198,7 +198,7 @@ if (!Ember.testing) {
|
|
198
198
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
199
199
|
* @license Licensed under MIT license
|
200
200
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
201
|
-
* @version 1.4.0-beta.
|
201
|
+
* @version 1.4.0-beta.2
|
202
202
|
*/
|
203
203
|
|
204
204
|
|
@@ -281,7 +281,7 @@ var define, requireModule, require, requirejs;
|
|
281
281
|
|
282
282
|
@class Ember
|
283
283
|
@static
|
284
|
-
@version 1.4.0-beta.
|
284
|
+
@version 1.4.0-beta.2
|
285
285
|
*/
|
286
286
|
|
287
287
|
if ('undefined' === typeof Ember) {
|
@@ -308,10 +308,10 @@ Ember.toString = function() { return "Ember"; };
|
|
308
308
|
/**
|
309
309
|
@property VERSION
|
310
310
|
@type String
|
311
|
-
@default '1.4.0-beta.
|
311
|
+
@default '1.4.0-beta.2'
|
312
312
|
@static
|
313
313
|
*/
|
314
|
-
Ember.VERSION = '1.4.0-beta.
|
314
|
+
Ember.VERSION = '1.4.0-beta.2';
|
315
315
|
|
316
316
|
/**
|
317
317
|
Standard environmental variables. You can define these in a global `EmberENV`
|
@@ -1026,7 +1026,7 @@ Ember.guidFor = function guidFor(obj) {
|
|
1026
1026
|
// META
|
1027
1027
|
//
|
1028
1028
|
|
1029
|
-
var META_DESC = {
|
1029
|
+
var META_DESC = Ember.META_DESC = {
|
1030
1030
|
writable: true,
|
1031
1031
|
configurable: false,
|
1032
1032
|
enumerable: false,
|
@@ -1830,34 +1830,123 @@ indexOf = Array.prototype.indexOf || Ember.ArrayPolyfills.indexOf;
|
|
1830
1830
|
filter = Array.prototype.filter || Ember.ArrayPolyfills.filter;
|
1831
1831
|
splice = Array.prototype.splice;
|
1832
1832
|
|
1833
|
+
/**
|
1834
|
+
* Defines some convenience methods for working with Enumerables.
|
1835
|
+
* `Ember.EnumerableUtils` uses `Ember.ArrayPolyfills` when necessary.
|
1836
|
+
*
|
1837
|
+
* @class EnumerableUtils
|
1838
|
+
* @namespace Ember
|
1839
|
+
* @static
|
1840
|
+
* */
|
1833
1841
|
var utils = Ember.EnumerableUtils = {
|
1842
|
+
/**
|
1843
|
+
* Calls the map function on the passed object with a specified callback. This
|
1844
|
+
* uses `Ember.ArrayPolyfill`'s-map method when necessary.
|
1845
|
+
*
|
1846
|
+
* @method map
|
1847
|
+
* @param {Object} obj The object that should be mapped
|
1848
|
+
* @param {Function} callback The callback to execute
|
1849
|
+
* @param {Object} thisArg Value to use as this when executing *callback*
|
1850
|
+
*
|
1851
|
+
* @return {Array} An array of mapped values.
|
1852
|
+
*/
|
1834
1853
|
map: function(obj, callback, thisArg) {
|
1835
1854
|
return obj.map ? obj.map.call(obj, callback, thisArg) : map.call(obj, callback, thisArg);
|
1836
1855
|
},
|
1837
1856
|
|
1857
|
+
/**
|
1858
|
+
* Calls the forEach function on the passed object with a specified callback. This
|
1859
|
+
* uses `Ember.ArrayPolyfill`'s-forEach method when necessary.
|
1860
|
+
*
|
1861
|
+
* @method forEach
|
1862
|
+
* @param {Object} obj The object to call forEach on
|
1863
|
+
* @param {Function} callback The callback to execute
|
1864
|
+
* @param {Object} thisArg Value to use as this when executing *callback*
|
1865
|
+
*
|
1866
|
+
*/
|
1838
1867
|
forEach: function(obj, callback, thisArg) {
|
1839
1868
|
return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : forEach.call(obj, callback, thisArg);
|
1840
1869
|
},
|
1841
1870
|
|
1871
|
+
/**
|
1872
|
+
* Calls the filter function on the passed object with a specified callback. This
|
1873
|
+
* uses `Ember.ArrayPolyfill`'s-filter method when necessary.
|
1874
|
+
*
|
1875
|
+
* @method filter
|
1876
|
+
* @param {Object} obj The object to call filter on
|
1877
|
+
* @param {Function} callback The callback to execute
|
1878
|
+
* @param {Object} thisArg Value to use as this when executing *callback*
|
1879
|
+
*
|
1880
|
+
* @return {Array} An array containing the filtered values
|
1881
|
+
*/
|
1842
1882
|
filter: function(obj, callback, thisArg) {
|
1843
1883
|
return obj.filter ? obj.filter.call(obj, callback, thisArg) : filter.call(obj, callback, thisArg);
|
1844
1884
|
},
|
1845
1885
|
|
1886
|
+
/**
|
1887
|
+
* Calls the indexOf function on the passed object with a specified callback. This
|
1888
|
+
* uses `Ember.ArrayPolyfill`'s-indexOf method when necessary.
|
1889
|
+
*
|
1890
|
+
* @method indexOf
|
1891
|
+
* @param {Object} obj The object to call indexOn on
|
1892
|
+
* @param {Function} callback The callback to execute
|
1893
|
+
* @param {Object} index The index to start searching from
|
1894
|
+
*
|
1895
|
+
*/
|
1846
1896
|
indexOf: function(obj, element, index) {
|
1847
1897
|
return obj.indexOf ? obj.indexOf.call(obj, element, index) : indexOf.call(obj, element, index);
|
1848
1898
|
},
|
1849
1899
|
|
1900
|
+
/**
|
1901
|
+
* Returns an array of indexes of the first occurrences of the passed elements
|
1902
|
+
* on the passed object.
|
1903
|
+
*
|
1904
|
+
* ```javascript
|
1905
|
+
* var array = [1, 2, 3, 4, 5];
|
1906
|
+
* Ember.EnumerableUtils.indexesOf(array, [2, 5]); // [1, 4]
|
1907
|
+
*
|
1908
|
+
* var fubar = "Fubarr";
|
1909
|
+
* Ember.EnumerableUtils.indexesOf(fubar, ['b', 'r']); // [2, 4]
|
1910
|
+
* ```
|
1911
|
+
*
|
1912
|
+
* @method indexesOf
|
1913
|
+
* @param {Object} obj The object to check for element indexes
|
1914
|
+
* @param {Array} elements The elements to search for on *obj*
|
1915
|
+
*
|
1916
|
+
* @return {Array} An array of indexes.
|
1917
|
+
*
|
1918
|
+
*/
|
1850
1919
|
indexesOf: function(obj, elements) {
|
1851
1920
|
return elements === undefined ? [] : utils.map(elements, function(item) {
|
1852
1921
|
return utils.indexOf(obj, item);
|
1853
1922
|
});
|
1854
1923
|
},
|
1855
1924
|
|
1925
|
+
/**
|
1926
|
+
* Adds an object to an array. If the array already includes the object this
|
1927
|
+
* method has no effect.
|
1928
|
+
*
|
1929
|
+
* @method addObject
|
1930
|
+
* @param {Array} array The array the passed item should be added to
|
1931
|
+
* @param {Object} item The item to add to the passed array
|
1932
|
+
*
|
1933
|
+
* @return 'undefined'
|
1934
|
+
*/
|
1856
1935
|
addObject: function(array, item) {
|
1857
1936
|
var index = utils.indexOf(array, item);
|
1858
1937
|
if (index === -1) { array.push(item); }
|
1859
1938
|
},
|
1860
1939
|
|
1940
|
+
/**
|
1941
|
+
* Removes an object from an array. If the array does not contain the passed
|
1942
|
+
* object this method has no effect.
|
1943
|
+
*
|
1944
|
+
* @method removeObject
|
1945
|
+
* @param {Array} array The array to remove the item from.
|
1946
|
+
* @param {Object} item The item to remove from the passed array.
|
1947
|
+
*
|
1948
|
+
* @return 'undefined'
|
1949
|
+
*/
|
1861
1950
|
removeObject: function(array, item) {
|
1862
1951
|
var index = utils.indexOf(array, item);
|
1863
1952
|
if (index !== -1) { array.splice(index, 1); }
|
@@ -1883,6 +1972,31 @@ var utils = Ember.EnumerableUtils = {
|
|
1883
1972
|
return ret;
|
1884
1973
|
},
|
1885
1974
|
|
1975
|
+
/**
|
1976
|
+
* Replaces objects in an array with the passed objects.
|
1977
|
+
*
|
1978
|
+
* ```javascript
|
1979
|
+
* var array = [1,2,3];
|
1980
|
+
* Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5]
|
1981
|
+
*
|
1982
|
+
* var array = [1,2,3];
|
1983
|
+
* Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3]
|
1984
|
+
*
|
1985
|
+
* var array = [1,2,3];
|
1986
|
+
* Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5]
|
1987
|
+
* ```
|
1988
|
+
*
|
1989
|
+
* @method replace
|
1990
|
+
* @param {Array} array The array the objects should be inserted into.
|
1991
|
+
* @param {Number} idx Starting index in the array to replace. If *idx* >=
|
1992
|
+
* length, then append to the end of the array.
|
1993
|
+
* @param {Number} amt Number of elements that should be remove from the array,
|
1994
|
+
* starting at *idx*
|
1995
|
+
* @param {Array} objects An array of zero or more objects that should be
|
1996
|
+
* inserted into the array at *idx*
|
1997
|
+
*
|
1998
|
+
* @return {Array} The changed array.
|
1999
|
+
*/
|
1886
2000
|
replace: function(array, idx, amt, objects) {
|
1887
2001
|
if (array.replace) {
|
1888
2002
|
return array.replace(idx, amt, objects);
|
@@ -1891,6 +2005,29 @@ var utils = Ember.EnumerableUtils = {
|
|
1891
2005
|
}
|
1892
2006
|
},
|
1893
2007
|
|
2008
|
+
/**
|
2009
|
+
* Calculates the intersection of two arrays. This method returns a new array
|
2010
|
+
* filled with the records that the two passed arrays share with each other.
|
2011
|
+
* If there is no intersection, an empty array will be returned.
|
2012
|
+
*
|
2013
|
+
* ```javascript
|
2014
|
+
* var array1 = [1, 2, 3, 4, 5];
|
2015
|
+
* var array2 = [1, 3, 5, 6, 7];
|
2016
|
+
*
|
2017
|
+
* Ember.EnumerableUtils.intersection(array1, array2); // [1, 3, 5]
|
2018
|
+
*
|
2019
|
+
* var array1 = [1, 2, 3];
|
2020
|
+
* var array2 = [4, 5, 6];
|
2021
|
+
*
|
2022
|
+
* Ember.EnumerableUtils.intersection(array1, array2); // []
|
2023
|
+
* ```
|
2024
|
+
*
|
2025
|
+
* @method intersection
|
2026
|
+
* @param {Array} array1 The first array
|
2027
|
+
* @param {Array} array2 The second array
|
2028
|
+
*
|
2029
|
+
* @return {Array} The intersection of the two passed arrays.
|
2030
|
+
*/
|
1894
2031
|
intersection: function(array1, array2) {
|
1895
2032
|
var intersection = [];
|
1896
2033
|
|
@@ -2543,7 +2680,7 @@ ObserverSet.prototype.clear = function() {
|
|
2543
2680
|
|
2544
2681
|
|
2545
2682
|
(function() {
|
2546
|
-
var
|
2683
|
+
var META_KEY = Ember.META_KEY,
|
2547
2684
|
guidFor = Ember.guidFor,
|
2548
2685
|
tryFinally = Ember.tryFinally,
|
2549
2686
|
sendEvent = Ember.sendEvent,
|
@@ -2574,10 +2711,10 @@ var metaFor = Ember.meta,
|
|
2574
2711
|
@return {void}
|
2575
2712
|
*/
|
2576
2713
|
function propertyWillChange(obj, keyName) {
|
2577
|
-
var m =
|
2578
|
-
watching = m.watching[keyName] > 0 || keyName === 'length',
|
2579
|
-
proto = m.proto,
|
2580
|
-
desc = m.descs[keyName];
|
2714
|
+
var m = obj[META_KEY],
|
2715
|
+
watching = (m && m.watching[keyName] > 0) || keyName === 'length',
|
2716
|
+
proto = m && m.proto,
|
2717
|
+
desc = m && m.descs[keyName];
|
2581
2718
|
|
2582
2719
|
if (!watching) { return; }
|
2583
2720
|
if (proto === obj) { return; }
|
@@ -2604,10 +2741,10 @@ Ember.propertyWillChange = propertyWillChange;
|
|
2604
2741
|
@return {void}
|
2605
2742
|
*/
|
2606
2743
|
function propertyDidChange(obj, keyName) {
|
2607
|
-
var m =
|
2608
|
-
watching = m.watching[keyName] > 0 || keyName === 'length',
|
2609
|
-
proto = m.proto,
|
2610
|
-
desc = m.descs[keyName];
|
2744
|
+
var m = obj[META_KEY],
|
2745
|
+
watching = (m && m.watching[keyName] > 0) || keyName === 'length',
|
2746
|
+
proto = m && m.proto,
|
2747
|
+
desc = m && m.descs[keyName];
|
2611
2748
|
|
2612
2749
|
if (proto === obj) { return; }
|
2613
2750
|
|
@@ -2680,7 +2817,7 @@ function chainsWillChange(obj, keyName, m) {
|
|
2680
2817
|
}
|
2681
2818
|
|
2682
2819
|
function chainsDidChange(obj, keyName, m, suppressEvents) {
|
2683
|
-
if (!(m.hasOwnProperty('chainWatchers') &&
|
2820
|
+
if (!(m && m.hasOwnProperty('chainWatchers') &&
|
2684
2821
|
m.chainWatchers[keyName])) {
|
2685
2822
|
return;
|
2686
2823
|
}
|
@@ -3705,11 +3842,11 @@ var metaFor = Ember.meta, // utils.js
|
|
3705
3842
|
MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,
|
3706
3843
|
o_defineProperty = Ember.platform.defineProperty;
|
3707
3844
|
|
3708
|
-
Ember.watchKey = function(obj, keyName) {
|
3845
|
+
Ember.watchKey = function(obj, keyName, meta) {
|
3709
3846
|
// can't watch length on Array - it is special...
|
3710
3847
|
if (keyName === 'length' && typeOf(obj) === 'array') { return; }
|
3711
3848
|
|
3712
|
-
var m = metaFor(obj), watching = m.watching;
|
3849
|
+
var m = meta || metaFor(obj), watching = m.watching;
|
3713
3850
|
|
3714
3851
|
// activate watching first time
|
3715
3852
|
if (!watching[keyName]) {
|
@@ -3734,8 +3871,8 @@ Ember.watchKey = function(obj, keyName) {
|
|
3734
3871
|
};
|
3735
3872
|
|
3736
3873
|
|
3737
|
-
Ember.unwatchKey = function(obj, keyName) {
|
3738
|
-
var m = metaFor(obj), watching = m.watching;
|
3874
|
+
Ember.unwatchKey = function(obj, keyName, meta) {
|
3875
|
+
var m = meta || metaFor(obj), watching = m.watching;
|
3739
3876
|
|
3740
3877
|
if (watching[keyName] === 1) {
|
3741
3878
|
watching[keyName] = 0;
|
@@ -3778,7 +3915,8 @@ var metaFor = Ember.meta, // utils.js
|
|
3778
3915
|
warn = Ember.warn,
|
3779
3916
|
watchKey = Ember.watchKey,
|
3780
3917
|
unwatchKey = Ember.unwatchKey,
|
3781
|
-
FIRST_KEY = /^([^\.\*]+)
|
3918
|
+
FIRST_KEY = /^([^\.\*]+)/,
|
3919
|
+
META_KEY = Ember.META_KEY;
|
3782
3920
|
|
3783
3921
|
function firstKey(path) {
|
3784
3922
|
return path.match(FIRST_KEY)[0];
|
@@ -3812,24 +3950,24 @@ function addChainWatcher(obj, keyName, node) {
|
|
3812
3950
|
|
3813
3951
|
if (!nodes[keyName]) { nodes[keyName] = []; }
|
3814
3952
|
nodes[keyName].push(node);
|
3815
|
-
watchKey(obj, keyName);
|
3953
|
+
watchKey(obj, keyName, m);
|
3816
3954
|
}
|
3817
3955
|
|
3818
3956
|
var removeChainWatcher = Ember.removeChainWatcher = function(obj, keyName, node) {
|
3819
3957
|
if (!obj || 'object' !== typeof obj) { return; } // nothing to do
|
3820
3958
|
|
3821
|
-
var m =
|
3822
|
-
if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do
|
3959
|
+
var m = obj[META_KEY];
|
3960
|
+
if (m && !m.hasOwnProperty('chainWatchers')) { return; } // nothing to do
|
3823
3961
|
|
3824
|
-
var nodes = m.chainWatchers;
|
3962
|
+
var nodes = m && m.chainWatchers;
|
3825
3963
|
|
3826
|
-
if (nodes[keyName]) {
|
3964
|
+
if (nodes && nodes[keyName]) {
|
3827
3965
|
nodes = nodes[keyName];
|
3828
3966
|
for (var i = 0, l = nodes.length; i < l; i++) {
|
3829
3967
|
if (nodes[i] === node) { nodes.splice(i, 1); }
|
3830
3968
|
}
|
3831
3969
|
}
|
3832
|
-
unwatchKey(obj, keyName);
|
3970
|
+
unwatchKey(obj, keyName, m);
|
3833
3971
|
};
|
3834
3972
|
|
3835
3973
|
// A ChainNode watches a single key on an object. If you provide a starting
|
@@ -3869,14 +4007,14 @@ var ChainNodePrototype = ChainNode.prototype;
|
|
3869
4007
|
function lazyGet(obj, key) {
|
3870
4008
|
if (!obj) return undefined;
|
3871
4009
|
|
3872
|
-
var meta =
|
4010
|
+
var meta = obj[META_KEY];
|
3873
4011
|
// check if object meant only to be a prototype
|
3874
|
-
if (meta.proto === obj) return undefined;
|
4012
|
+
if (meta && meta.proto === obj) return undefined;
|
3875
4013
|
|
3876
4014
|
if (key === "@each") return get(obj, key);
|
3877
4015
|
|
3878
4016
|
// if a CP only return cached value
|
3879
|
-
var desc = meta.descs[key];
|
4017
|
+
var desc = meta && meta.descs[key];
|
3880
4018
|
if (desc && desc._cacheable) {
|
3881
4019
|
if (key in meta.cache) {
|
3882
4020
|
return meta.cache[key];
|
@@ -4088,12 +4226,14 @@ ChainNodePrototype.didChange = function(events) {
|
|
4088
4226
|
};
|
4089
4227
|
|
4090
4228
|
Ember.finishChains = function(obj) {
|
4091
|
-
|
4229
|
+
// We only create meta if we really have to
|
4230
|
+
var m = obj[META_KEY], chains = m && m.chains;
|
4092
4231
|
if (chains) {
|
4093
4232
|
if (chains.value() !== obj) {
|
4094
|
-
|
4233
|
+
metaFor(obj).chains = chains = chains.copy(obj);
|
4234
|
+
} else {
|
4235
|
+
chains.didChange(null);
|
4095
4236
|
}
|
4096
|
-
chains.didChange(null);
|
4097
4237
|
}
|
4098
4238
|
};
|
4099
4239
|
|
@@ -4161,8 +4301,8 @@ var metaFor = Ember.meta, // utils.js
|
|
4161
4301
|
// get the chains for the current object. If the current object has
|
4162
4302
|
// chains inherited from the proto they will be cloned and reconfigured for
|
4163
4303
|
// the current object.
|
4164
|
-
function chainsFor(obj) {
|
4165
|
-
var m = metaFor(obj), ret = m.chains;
|
4304
|
+
function chainsFor(obj, meta) {
|
4305
|
+
var m = meta || metaFor(obj), ret = m.chains;
|
4166
4306
|
if (!ret) {
|
4167
4307
|
ret = m.chains = new ChainNode(null, null, obj);
|
4168
4308
|
} else if (ret.value() !== obj) {
|
@@ -4171,26 +4311,26 @@ function chainsFor(obj) {
|
|
4171
4311
|
return ret;
|
4172
4312
|
}
|
4173
4313
|
|
4174
|
-
Ember.watchPath = function(obj, keyPath) {
|
4314
|
+
Ember.watchPath = function(obj, keyPath, meta) {
|
4175
4315
|
// can't watch length on Array - it is special...
|
4176
4316
|
if (keyPath === 'length' && typeOf(obj) === 'array') { return; }
|
4177
4317
|
|
4178
|
-
var m = metaFor(obj), watching = m.watching;
|
4318
|
+
var m = meta || metaFor(obj), watching = m.watching;
|
4179
4319
|
|
4180
4320
|
if (!watching[keyPath]) { // activate watching first time
|
4181
4321
|
watching[keyPath] = 1;
|
4182
|
-
chainsFor(obj).add(keyPath);
|
4322
|
+
chainsFor(obj, m).add(keyPath);
|
4183
4323
|
} else {
|
4184
4324
|
watching[keyPath] = (watching[keyPath] || 0) + 1;
|
4185
4325
|
}
|
4186
4326
|
};
|
4187
4327
|
|
4188
|
-
Ember.unwatchPath = function(obj, keyPath) {
|
4189
|
-
var m = metaFor(obj), watching = m.watching;
|
4328
|
+
Ember.unwatchPath = function(obj, keyPath, meta) {
|
4329
|
+
var m = meta || metaFor(obj), watching = m.watching;
|
4190
4330
|
|
4191
4331
|
if (watching[keyPath] === 1) {
|
4192
4332
|
watching[keyPath] = 0;
|
4193
|
-
chainsFor(obj).remove(keyPath);
|
4333
|
+
chainsFor(obj, m).remove(keyPath);
|
4194
4334
|
} else if (watching[keyPath] > 1) {
|
4195
4335
|
watching[keyPath]--;
|
4196
4336
|
}
|
@@ -4234,14 +4374,14 @@ function isKeyName(path) {
|
|
4234
4374
|
@param obj
|
4235
4375
|
@param {String} keyName
|
4236
4376
|
*/
|
4237
|
-
Ember.watch = function(obj, _keyPath) {
|
4377
|
+
Ember.watch = function(obj, _keyPath, m) {
|
4238
4378
|
// can't watch length on Array - it is special...
|
4239
4379
|
if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }
|
4240
4380
|
|
4241
4381
|
if (isKeyName(_keyPath)) {
|
4242
|
-
watchKey(obj, _keyPath);
|
4382
|
+
watchKey(obj, _keyPath, m);
|
4243
4383
|
} else {
|
4244
|
-
watchPath(obj, _keyPath);
|
4384
|
+
watchPath(obj, _keyPath, m);
|
4245
4385
|
}
|
4246
4386
|
};
|
4247
4387
|
|
@@ -4252,14 +4392,14 @@ Ember.isWatching = function isWatching(obj, key) {
|
|
4252
4392
|
|
4253
4393
|
Ember.watch.flushPending = Ember.flushPendingChains;
|
4254
4394
|
|
4255
|
-
Ember.unwatch = function(obj, _keyPath) {
|
4395
|
+
Ember.unwatch = function(obj, _keyPath, m) {
|
4256
4396
|
// can't watch length on Array - it is special...
|
4257
4397
|
if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }
|
4258
4398
|
|
4259
4399
|
if (isKeyName(_keyPath)) {
|
4260
|
-
unwatchKey(obj, _keyPath);
|
4400
|
+
unwatchKey(obj, _keyPath, m);
|
4261
4401
|
} else {
|
4262
|
-
unwatchPath(obj, _keyPath);
|
4402
|
+
unwatchPath(obj, _keyPath, m);
|
4263
4403
|
}
|
4264
4404
|
};
|
4265
4405
|
|
@@ -4274,7 +4414,7 @@ Ember.unwatch = function(obj, _keyPath) {
|
|
4274
4414
|
@param obj
|
4275
4415
|
*/
|
4276
4416
|
Ember.rewatch = function(obj) {
|
4277
|
-
var m =
|
4417
|
+
var m = obj[META_KEY], chains = m && m.chains;
|
4278
4418
|
|
4279
4419
|
// make sure the object has its own guid.
|
4280
4420
|
if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {
|
@@ -4407,7 +4547,7 @@ function addDependentKeys(desc, obj, keyName, meta) {
|
|
4407
4547
|
// Increment the number of times depKey depends on keyName.
|
4408
4548
|
keys[keyName] = (keys[keyName] || 0) + 1;
|
4409
4549
|
// Watch the depKey
|
4410
|
-
watch(obj, depKey);
|
4550
|
+
watch(obj, depKey, meta);
|
4411
4551
|
}
|
4412
4552
|
}
|
4413
4553
|
|
@@ -4426,7 +4566,7 @@ function removeDependentKeys(desc, obj, keyName, meta) {
|
|
4426
4566
|
// Increment the number of times depKey depends on keyName.
|
4427
4567
|
keys[keyName] = (keys[keyName] || 0) - 1;
|
4428
4568
|
// Watch the depKey
|
4429
|
-
unwatch(obj, depKey);
|
4569
|
+
unwatch(obj, depKey, meta);
|
4430
4570
|
}
|
4431
4571
|
}
|
4432
4572
|
|
@@ -4634,7 +4774,7 @@ ComputedPropertyPrototype.property = function() {
|
|
4634
4774
|
|
4635
4775
|
|
4636
4776
|
var addArg = function (property) {
|
4637
|
-
args.push(property);
|
4777
|
+
args.push(property);
|
4638
4778
|
};
|
4639
4779
|
|
4640
4780
|
args = [];
|
@@ -4887,7 +5027,8 @@ Ember.computed = function(func) {
|
|
4887
5027
|
@return {Object} the cached value
|
4888
5028
|
*/
|
4889
5029
|
Ember.cacheFor = function cacheFor(obj, key) {
|
4890
|
-
var
|
5030
|
+
var meta = obj[META_KEY],
|
5031
|
+
cache = meta && meta.cache;
|
4891
5032
|
|
4892
5033
|
if (cache && key in cache) {
|
4893
5034
|
return cache[key];
|
@@ -7463,14 +7604,16 @@ var Mixin, REQUIRED, Alias,
|
|
7463
7604
|
a_slice = [].slice,
|
7464
7605
|
o_create = Ember.create,
|
7465
7606
|
defineProperty = Ember.defineProperty,
|
7466
|
-
guidFor = Ember.guidFor
|
7607
|
+
guidFor = Ember.guidFor,
|
7608
|
+
metaFor = Ember.meta,
|
7609
|
+
META_KEY = Ember.META_KEY;
|
7467
7610
|
|
7468
7611
|
|
7469
7612
|
var expandProperties = Ember.expandProperties;
|
7470
7613
|
|
7471
7614
|
|
7472
7615
|
function mixinsMeta(obj) {
|
7473
|
-
var m =
|
7616
|
+
var m = metaFor(obj, true), ret = m.mixins;
|
7474
7617
|
if (!ret) {
|
7475
7618
|
ret = m.mixins = {};
|
7476
7619
|
} else if (!m.hasOwnProperty('mixins')) {
|
@@ -7655,7 +7798,7 @@ function mergeMixins(mixins, m, descs, values, base, keys) {
|
|
7655
7798
|
if (props === CONTINUE) { continue; }
|
7656
7799
|
|
7657
7800
|
if (props) {
|
7658
|
-
meta =
|
7801
|
+
meta = metaFor(base);
|
7659
7802
|
if (base.willMergeMixin) { base.willMergeMixin(props); }
|
7660
7803
|
concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);
|
7661
7804
|
mergings = concatenatedMixinProperties('mergedProperties', props, values, base);
|
@@ -7713,7 +7856,7 @@ function connectBindings(obj, m) {
|
|
7713
7856
|
}
|
7714
7857
|
|
7715
7858
|
function finishPartial(obj, m) {
|
7716
|
-
connectBindings(obj, m ||
|
7859
|
+
connectBindings(obj, m || metaFor(obj));
|
7717
7860
|
return obj;
|
7718
7861
|
}
|
7719
7862
|
|
@@ -7760,7 +7903,7 @@ function replaceObserversAndListeners(obj, key, observerOrListener) {
|
|
7760
7903
|
}
|
7761
7904
|
|
7762
7905
|
function applyMixin(obj, mixins, partial) {
|
7763
|
-
var descs = {}, values = {}, m =
|
7906
|
+
var descs = {}, values = {}, m = metaFor(obj),
|
7764
7907
|
key, value, desc, keys = [];
|
7765
7908
|
|
7766
7909
|
// Go through all mixins and hashes passed in, and:
|
@@ -7972,7 +8115,8 @@ function _detect(curMixin, targetMixin, seen) {
|
|
7972
8115
|
MixinPrototype.detect = function(obj) {
|
7973
8116
|
if (!obj) { return false; }
|
7974
8117
|
if (obj instanceof Mixin) { return _detect(obj, this, {}); }
|
7975
|
-
var
|
8118
|
+
var m = obj[META_KEY],
|
8119
|
+
mixins = m && m.mixins;
|
7976
8120
|
if (mixins) {
|
7977
8121
|
return !!mixins[guidFor(this)];
|
7978
8122
|
}
|
@@ -8011,7 +8155,8 @@ MixinPrototype.keys = function() {
|
|
8011
8155
|
// returns the mixins currently applied to the specified object
|
8012
8156
|
// TODO: Make Ember.mixin
|
8013
8157
|
Mixin.mixins = function(obj) {
|
8014
|
-
var
|
8158
|
+
var m = obj[META_KEY],
|
8159
|
+
mixins = m && m.mixins, ret = [];
|
8015
8160
|
|
8016
8161
|
if (!mixins) { return ret; }
|
8017
8162
|
|
@@ -9891,7 +10036,7 @@ define("rsvp/promise/all",
|
|
9891
10036
|
```
|
9892
10037
|
|
9893
10038
|
@method all
|
9894
|
-
@for RSVP.Promise
|
10039
|
+
@for Ember.RSVP.Promise
|
9895
10040
|
@param {Array} entries array of promises
|
9896
10041
|
@param {String} label optional string for labeling the promise.
|
9897
10042
|
Useful for tooling.
|
@@ -12619,6 +12764,7 @@ var set = Ember.set, get = Ember.get,
|
|
12619
12764
|
guidFor = Ember.guidFor,
|
12620
12765
|
generateGuid = Ember.generateGuid,
|
12621
12766
|
meta = Ember.meta,
|
12767
|
+
META_KEY = Ember.META_KEY,
|
12622
12768
|
rewatch = Ember.rewatch,
|
12623
12769
|
finishChains = Ember.finishChains,
|
12624
12770
|
sendEvent = Ember.sendEvent,
|
@@ -13312,7 +13458,8 @@ var ClassMixin = Mixin.create({
|
|
13312
13458
|
@param key {String} property name
|
13313
13459
|
*/
|
13314
13460
|
metaForProperty: function(key) {
|
13315
|
-
var
|
13461
|
+
var meta = this.proto()[META_KEY],
|
13462
|
+
desc = meta && meta.descs[key];
|
13316
13463
|
|
13317
13464
|
Ember.assert("metaForProperty() could not find a computed property with key '"+key+"'.", !!desc && desc instanceof Ember.ComputedProperty);
|
13318
13465
|
return desc._meta || {};
|
@@ -20460,7 +20607,7 @@ Ember.ControllerMixin = Ember.Mixin.create(Ember.ActionHandler, {
|
|
20460
20607
|
deprecatedSend: function(actionName) {
|
20461
20608
|
var args = [].slice.call(arguments, 1);
|
20462
20609
|
Ember.assert('' + this + " has the action " + actionName + " but it is not a function", typeof this[actionName] === 'function');
|
20463
|
-
Ember.deprecate('Action handlers implemented directly on controllers are deprecated in favor of action handlers on an `actions` object (' + actionName + ' on ' + this + ')', false);
|
20610
|
+
Ember.deprecate('Action handlers implemented directly on controllers are deprecated in favor of action handlers on an `actions` object ( action: `' + actionName + '` on ' + this + ')', false);
|
20464
20611
|
this[actionName].apply(this, args);
|
20465
20612
|
return;
|
20466
20613
|
}
|