ember-source 2.4.6 → 2.5.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-runtime.js +313 -329
- data/dist/ember-template-compiler.js +368 -532
- data/dist/ember-testing.js +150 -81
- data/dist/ember.debug.js +914 -1056
- data/dist/ember.js +914 -1056
- data/dist/ember.min.js +15 -15
- data/dist/ember.prod.js +746 -963
- metadata +6 -8
- data/dist/ember-tests.js +0 -61579
- data/dist/ember-tests.prod.js +0 -61003
- data/dist/ember.debug.cjs.js +0 -56324
@@ -6,7 +6,7 @@
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
7
7
|
* @license Licensed under MIT license
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
9
|
-
* @version 2.
|
9
|
+
* @version 2.5.0-beta.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, require, requirejs, Ember;
|
@@ -1245,10 +1245,8 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal/core', 'ember-metal/err
|
|
1245
1245
|
|
1246
1246
|
/**
|
1247
1247
|
Display a deprecation warning with the provided message and a stack trace
|
1248
|
-
(Chrome and Firefox only).
|
1249
|
-
|
1250
|
-
* In a production build, this method is defined as an empty function (NOP).
|
1251
|
-
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
1248
|
+
(Chrome and Firefox only). Ember build tools will remove any calls to
|
1249
|
+
`Ember.deprecate()` when doing a production build.
|
1252
1250
|
|
1253
1251
|
@method deprecate
|
1254
1252
|
@param {String} message A description of the deprecation.
|
@@ -1302,7 +1300,7 @@ enifed('ember-debug/handlers', ['exports', 'ember-debug/is-plain-function', 'emb
|
|
1302
1300
|
exports.HANDLERS = HANDLERS;
|
1303
1301
|
|
1304
1302
|
function generateTestAsFunctionDeprecation(source) {
|
1305
|
-
return 'Calling `' + source + '` with a function argument is deprecated. Please ' + 'use `!!Constructor` for constructors, or an `IIFE` to compute the test for deprecation. ' + 'In a future version functions will be treated as truthy values instead of being executed.';
|
1303
|
+
return 'Calling `' + source + '` with a function argument is deprecated. Please ' + 'use `!!Constructor` for constructors, or an `IIFE` to compute the test for deprecation. ' + 'In a future version, functions will be treated as truthy values instead of being executed.';
|
1306
1304
|
}
|
1307
1305
|
|
1308
1306
|
function normalizeTest(test, source) {
|
@@ -1355,10 +1353,9 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1355
1353
|
*/
|
1356
1354
|
|
1357
1355
|
/**
|
1358
|
-
Define an assertion that will throw an exception if the condition is not
|
1359
|
-
|
1360
|
-
|
1361
|
-
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
1356
|
+
Define an assertion that will throw an exception if the condition is not
|
1357
|
+
met. Ember build tools will remove any calls to `Ember.assert()` when
|
1358
|
+
doing a production build. Example:
|
1362
1359
|
|
1363
1360
|
```javascript
|
1364
1361
|
// Test for truthiness
|
@@ -1392,10 +1389,8 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1392
1389
|
});
|
1393
1390
|
|
1394
1391
|
/**
|
1395
|
-
Display a debug notice.
|
1396
|
-
|
1397
|
-
* In a production build, this method is defined as an empty function (NOP).
|
1398
|
-
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
1392
|
+
Display a debug notice. Ember build tools will remove any calls to
|
1393
|
+
`Ember.debug()` when doing a production build.
|
1399
1394
|
|
1400
1395
|
```javascript
|
1401
1396
|
Ember.debug('I\'m a debug notice!');
|
@@ -1412,9 +1407,6 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1412
1407
|
/**
|
1413
1408
|
Display an info notice.
|
1414
1409
|
|
1415
|
-
* In a production build, this method is defined as an empty function (NOP).
|
1416
|
-
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
1417
|
-
|
1418
1410
|
@method info
|
1419
1411
|
@private
|
1420
1412
|
*/
|
@@ -1428,7 +1420,8 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1428
1420
|
Display a deprecation warning with the provided message and a stack trace
|
1429
1421
|
(Chrome and Firefox only) when the assigned method is called.
|
1430
1422
|
|
1431
|
-
|
1423
|
+
Ember build tools will not remove calls to `Ember.deprecateFunc()`, though
|
1424
|
+
no warnings will be shown in production.
|
1432
1425
|
|
1433
1426
|
```javascript
|
1434
1427
|
Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
|
@@ -1438,7 +1431,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1438
1431
|
@param {String} message A description of the deprecation.
|
1439
1432
|
@param {Object} [options] The options object for Ember.deprecate.
|
1440
1433
|
@param {Function} func The new function called to replace its deprecated counterpart.
|
1441
|
-
@return {Function}
|
1434
|
+
@return {Function} A new function that wraps the original function with a deprecation warning
|
1442
1435
|
@private
|
1443
1436
|
*/
|
1444
1437
|
_emberMetalDebug.setDebugFunction('deprecateFunc', function deprecateFunc() {
|
@@ -1479,10 +1472,8 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1479
1472
|
});
|
1480
1473
|
|
1481
1474
|
/**
|
1482
|
-
Run a function meant for debugging.
|
1483
|
-
|
1484
|
-
* In a production build, this method is defined as an empty function (NOP).
|
1485
|
-
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
1475
|
+
Run a function meant for debugging. Ember build tools will remove any calls to
|
1476
|
+
`Ember.runInDebug()` when doing a production build.
|
1486
1477
|
|
1487
1478
|
```javascript
|
1488
1479
|
Ember.runInDebug(() => {
|
@@ -1522,18 +1513,14 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1522
1513
|
@return {void}
|
1523
1514
|
*/
|
1524
1515
|
|
1525
|
-
function _warnIfUsingStrippedFeatureFlags(FEATURES,
|
1516
|
+
function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) {
|
1526
1517
|
if (featuresWereStripped) {
|
1527
1518
|
_emberMetalDebug.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberMetalCore.default.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
|
1528
1519
|
|
1529
|
-
var
|
1530
|
-
|
1531
|
-
|
1532
|
-
if (key === 'isEnabled' || !(key in knownFeatures)) {
|
1533
|
-
continue;
|
1520
|
+
for (var key in FEATURES) {
|
1521
|
+
if (FEATURES.hasOwnProperty(key) && key !== 'isEnabled') {
|
1522
|
+
_emberMetalDebug.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
|
1534
1523
|
}
|
1535
|
-
|
1536
|
-
_emberMetalDebug.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
|
1537
1524
|
}
|
1538
1525
|
}
|
1539
1526
|
}
|
@@ -1543,8 +1530,12 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1543
1530
|
_emberMetalFeatures.FEATURES['features-stripped-test'] = true;
|
1544
1531
|
var featuresWereStripped = true;
|
1545
1532
|
|
1533
|
+
if (_emberMetalFeatures.default('features-stripped-test')) {
|
1534
|
+
exports.featuresWereStripped = featuresWereStripped = false;
|
1535
|
+
}
|
1536
|
+
|
1546
1537
|
delete _emberMetalFeatures.FEATURES['features-stripped-test'];
|
1547
|
-
_warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES,
|
1538
|
+
_warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, featuresWereStripped);
|
1548
1539
|
|
1549
1540
|
// Inform the developer about the Ember Inspector if not installed.
|
1550
1541
|
var isFirefox = _emberMetalEnvironment.default.isFirefox;
|
@@ -1589,18 +1580,18 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1589
1580
|
```
|
1590
1581
|
The handler function takes the following arguments:
|
1591
1582
|
<ul>
|
1592
|
-
<li> <code>message</code> - The message received from the deprecation call
|
1583
|
+
<li> <code>message</code> - The message received from the deprecation call.</li>
|
1593
1584
|
<li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li>
|
1594
1585
|
<ul>
|
1595
|
-
<li> <code>id</code> -
|
1596
|
-
<li> <code>until</code> -
|
1586
|
+
<li> <code>id</code> - An id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>
|
1587
|
+
<li> <code>until</code> - The Ember version number the feature and deprecation will be removed in.</li>
|
1597
1588
|
</ul>
|
1598
|
-
<li> <code>next</code> -
|
1589
|
+
<li> <code>next</code> - A function that calls into the previously registered handler.</li>
|
1599
1590
|
</ul>
|
1600
1591
|
@public
|
1601
1592
|
@static
|
1602
1593
|
@method registerDeprecationHandler
|
1603
|
-
@param handler {Function}
|
1594
|
+
@param handler {Function} A function to handle deprecation calls.
|
1604
1595
|
@since 2.1.0
|
1605
1596
|
*/
|
1606
1597
|
_emberMetalCore.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler;
|
@@ -1618,14 +1609,14 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-metal/debug',
|
|
1618
1609
|
<li> <code>message</code> - The message received from the warn call. </li>
|
1619
1610
|
<li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
|
1620
1611
|
<ul>
|
1621
|
-
<li> <code>id</code> -
|
1612
|
+
<li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>
|
1622
1613
|
</ul>
|
1623
|
-
<li> <code>next</code> -
|
1614
|
+
<li> <code>next</code> - A function that calls into the previously registered handler.</li>
|
1624
1615
|
</ul>
|
1625
1616
|
@public
|
1626
1617
|
@static
|
1627
1618
|
@method registerWarnHandler
|
1628
|
-
@param handler {Function}
|
1619
|
+
@param handler {Function} A function to handle warnings.
|
1629
1620
|
@since 2.1.0
|
1630
1621
|
*/
|
1631
1622
|
_emberMetalCore.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler;
|
@@ -1682,16 +1673,14 @@ enifed('ember-debug/warn', ['exports', 'ember-metal/logger', 'ember-metal/debug'
|
|
1682
1673
|
*/
|
1683
1674
|
|
1684
1675
|
/**
|
1685
|
-
Display a warning with the provided message.
|
1686
|
-
|
1687
|
-
* In a production build, this method is defined as an empty function (NOP).
|
1688
|
-
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
1676
|
+
Display a warning with the provided message. Ember build tools will
|
1677
|
+
remove any calls to `Ember.warn()` when doing a production build.
|
1689
1678
|
|
1690
1679
|
@method warn
|
1691
1680
|
@param {String} message A warning to display.
|
1692
1681
|
@param {Boolean} test An optional boolean. If falsy, the warning
|
1693
1682
|
will be displayed.
|
1694
|
-
@param {Object} options An
|
1683
|
+
@param {Object} options An object that can be used to pass a unique
|
1695
1684
|
`id` for this warning. The `id` can be used by Ember debugging tools
|
1696
1685
|
to change the behavior (raise, log, or silence) for that specific warning.
|
1697
1686
|
The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped"
|
@@ -1787,7 +1776,7 @@ enifed('ember-metal/alias', ['exports', 'ember-metal/debug', 'ember-metal/proper
|
|
1787
1776
|
return _emberMetalProperty_set.set(obj, keyName, value);
|
1788
1777
|
}
|
1789
1778
|
|
1790
|
-
// Backwards compatibility with Ember Data
|
1779
|
+
// Backwards compatibility with Ember Data.
|
1791
1780
|
AliasedProperty.prototype._meta = undefined;
|
1792
1781
|
AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta;
|
1793
1782
|
});
|
@@ -1835,7 +1824,7 @@ enifed("ember-metal/assign", ["exports"], function (exports) {
|
|
1835
1824
|
return original;
|
1836
1825
|
}
|
1837
1826
|
});
|
1838
|
-
enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/
|
1827
|
+
enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) {
|
1839
1828
|
'use strict';
|
1840
1829
|
|
1841
1830
|
exports.bind = bind;
|
@@ -1863,31 +1852,22 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
1863
1852
|
*/
|
1864
1853
|
_emberMetalCore.default.LOG_BINDINGS = false || !!_emberMetalCore.default.ENV.LOG_BINDINGS;
|
1865
1854
|
|
1866
|
-
/**
|
1867
|
-
Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)
|
1868
|
-
instead of local (`foo.bar.baz`).
|
1869
|
-
|
1870
|
-
@method isGlobalPath
|
1871
|
-
@for Ember
|
1872
|
-
@private
|
1873
|
-
@param {String} path
|
1874
|
-
@return Boolean
|
1875
|
-
*/
|
1876
|
-
|
1877
|
-
function getWithGlobals(obj, path) {
|
1878
|
-
return _emberMetalProperty_get.get(_emberMetalPath_cache.isGlobal(path) ? _emberMetalCore.default.lookup : obj, path);
|
1879
|
-
}
|
1880
|
-
|
1881
1855
|
// ..........................................................
|
1882
1856
|
// BINDING
|
1883
1857
|
//
|
1884
1858
|
|
1885
1859
|
function Binding(toPath, fromPath) {
|
1886
|
-
|
1860
|
+
// Configuration
|
1887
1861
|
this._from = fromPath;
|
1888
1862
|
this._to = toPath;
|
1889
|
-
this._readyToSync = undefined;
|
1890
1863
|
this._oneWay = undefined;
|
1864
|
+
|
1865
|
+
// State
|
1866
|
+
this._direction = undefined;
|
1867
|
+
this._readyToSync = undefined;
|
1868
|
+
this._fromObj = undefined;
|
1869
|
+
this._fromPath = undefined;
|
1870
|
+
this._toObj = undefined;
|
1891
1871
|
}
|
1892
1872
|
|
1893
1873
|
/**
|
@@ -1923,7 +1903,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
1923
1903
|
you pass when you `connect()` the binding. It follows the same rules as
|
1924
1904
|
`get()` - see that method for more information.
|
1925
1905
|
@method from
|
1926
|
-
@param {String} path
|
1906
|
+
@param {String} path The property path to connect to.
|
1927
1907
|
@return {Ember.Binding} `this`
|
1928
1908
|
@public
|
1929
1909
|
*/
|
@@ -1940,7 +1920,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
1940
1920
|
you pass when you `connect()` the binding. It follows the same rules as
|
1941
1921
|
`get()` - see that method for more information.
|
1942
1922
|
@method to
|
1943
|
-
@param {String|Tuple} path A property path or tuple
|
1923
|
+
@param {String|Tuple} path A property path or tuple.
|
1944
1924
|
@return {Ember.Binding} `this`
|
1945
1925
|
@public
|
1946
1926
|
*/
|
@@ -1989,19 +1969,42 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
1989
1969
|
connect: function (obj) {
|
1990
1970
|
_emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
|
1991
1971
|
|
1992
|
-
var
|
1993
|
-
|
1994
|
-
_emberMetalProperty_set.trySet(obj, toPath, getWithGlobals(obj, fromPath));
|
1972
|
+
var fromObj = undefined,
|
1973
|
+
fromPath = undefined;
|
1995
1974
|
|
1996
|
-
//
|
1997
|
-
|
1975
|
+
// If the binding's "from" path could be interpreted as a global, verify
|
1976
|
+
// whether the path refers to a global or not by consulting `Ember.lookup`.
|
1977
|
+
if (_emberMetalPath_cache.isGlobalPath(this._from)) {
|
1978
|
+
var _name = _emberMetalPath_cache.getFirstKey(this._from);
|
1979
|
+
var possibleGlobal = _emberMetalCore.default.lookup[_name];
|
1980
|
+
|
1981
|
+
if (possibleGlobal) {
|
1982
|
+
fromObj = possibleGlobal;
|
1983
|
+
fromPath = _emberMetalPath_cache.getTailPath(this._from);
|
1984
|
+
}
|
1985
|
+
}
|
1998
1986
|
|
1999
|
-
|
1987
|
+
if (fromObj === undefined) {
|
1988
|
+
fromObj = obj;
|
1989
|
+
fromPath = this._from;
|
1990
|
+
}
|
1991
|
+
|
1992
|
+
_emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath));
|
1993
|
+
|
1994
|
+
// Add an observer on the object to be notified when the binding should be updated.
|
1995
|
+
_emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange');
|
1996
|
+
|
1997
|
+
// If the binding is a two-way binding, also set up an observer on the target.
|
2000
1998
|
if (!this._oneWay) {
|
2001
|
-
_emberMetalObserver.addObserver(obj,
|
1999
|
+
_emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange');
|
2002
2000
|
}
|
2003
2001
|
|
2002
|
+
_emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect');
|
2003
|
+
|
2004
2004
|
this._readyToSync = true;
|
2005
|
+
this._fromObj = fromObj;
|
2006
|
+
this._fromPath = fromPath;
|
2007
|
+
this._toObj = obj;
|
2005
2008
|
|
2006
2009
|
return this;
|
2007
2010
|
},
|
@@ -2010,25 +2013,22 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
2010
2013
|
Disconnects the binding instance. Changes will no longer be relayed. You
|
2011
2014
|
will not usually need to call this method.
|
2012
2015
|
@method disconnect
|
2013
|
-
@param {Object} obj The root object you passed when connecting the binding.
|
2014
2016
|
@return {Ember.Binding} `this`
|
2015
2017
|
@public
|
2016
2018
|
*/
|
2017
|
-
disconnect: function (
|
2018
|
-
_emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!
|
2019
|
+
disconnect: function () {
|
2020
|
+
_emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj);
|
2019
2021
|
|
2020
|
-
|
2021
|
-
|
2022
|
-
// remove an observer on the object so we're no longer notified of
|
2022
|
+
// Remove an observer on the object so we're no longer notified of
|
2023
2023
|
// changes that should update bindings.
|
2024
|
-
_emberMetalObserver.removeObserver(
|
2024
|
+
_emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange');
|
2025
2025
|
|
2026
|
-
//
|
2027
|
-
if (
|
2028
|
-
_emberMetalObserver.removeObserver(
|
2026
|
+
// If the binding is two-way, remove the observer from the target as well.
|
2027
|
+
if (!this._oneWay) {
|
2028
|
+
_emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange');
|
2029
2029
|
}
|
2030
2030
|
|
2031
|
-
this._readyToSync = false; //
|
2031
|
+
this._readyToSync = false; // Disable scheduled syncs...
|
2032
2032
|
return this;
|
2033
2033
|
},
|
2034
2034
|
|
@@ -2036,22 +2036,22 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
2036
2036
|
// PRIVATE
|
2037
2037
|
//
|
2038
2038
|
|
2039
|
-
/*
|
2039
|
+
/* Called when the from side changes. */
|
2040
2040
|
fromDidChange: function (target) {
|
2041
|
-
this._scheduleSync(
|
2041
|
+
this._scheduleSync('fwd');
|
2042
2042
|
},
|
2043
2043
|
|
2044
|
-
/*
|
2044
|
+
/* Called when the to side changes. */
|
2045
2045
|
toDidChange: function (target) {
|
2046
|
-
this._scheduleSync(
|
2046
|
+
this._scheduleSync('back');
|
2047
2047
|
},
|
2048
2048
|
|
2049
|
-
_scheduleSync: function (
|
2049
|
+
_scheduleSync: function (dir) {
|
2050
2050
|
var existingDir = this._direction;
|
2051
2051
|
|
2052
|
-
//
|
2052
|
+
// If we haven't scheduled the binding yet, schedule it.
|
2053
2053
|
if (existingDir === undefined) {
|
2054
|
-
_emberMetalRun_loop.default.schedule('sync', this,
|
2054
|
+
_emberMetalRun_loop.default.schedule('sync', this, '_sync');
|
2055
2055
|
this._direction = dir;
|
2056
2056
|
}
|
2057
2057
|
|
@@ -2062,44 +2062,46 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
2062
2062
|
}
|
2063
2063
|
},
|
2064
2064
|
|
2065
|
-
_sync: function (
|
2065
|
+
_sync: function () {
|
2066
2066
|
var log = _emberMetalCore.default.LOG_BINDINGS;
|
2067
2067
|
|
2068
|
-
|
2069
|
-
|
2068
|
+
var toObj = this._toObj;
|
2069
|
+
|
2070
|
+
// Don't synchronize destroyed objects or disconnected bindings.
|
2071
|
+
if (toObj.isDestroyed || !this._readyToSync) {
|
2070
2072
|
return;
|
2071
2073
|
}
|
2072
2074
|
|
2073
|
-
//
|
2074
|
-
// synchronizing from
|
2075
|
+
// Get the direction of the binding for the object we are
|
2076
|
+
// synchronizing from.
|
2075
2077
|
var direction = this._direction;
|
2076
2078
|
|
2077
|
-
var
|
2078
|
-
var
|
2079
|
+
var fromObj = this._fromObj;
|
2080
|
+
var fromPath = this._fromPath;
|
2079
2081
|
|
2080
2082
|
this._direction = undefined;
|
2081
2083
|
|
2082
|
-
//
|
2084
|
+
// If we're synchronizing from the remote object...
|
2083
2085
|
if (direction === 'fwd') {
|
2084
|
-
var fromValue =
|
2086
|
+
var fromValue = _emberMetalProperty_get.get(fromObj, fromPath);
|
2085
2087
|
if (log) {
|
2086
|
-
_emberMetalLogger.default.log(' ', this.toString(), '->', fromValue,
|
2088
|
+
_emberMetalLogger.default.log(' ', this.toString(), '->', fromValue, fromObj);
|
2087
2089
|
}
|
2088
2090
|
if (this._oneWay) {
|
2089
|
-
_emberMetalProperty_set.trySet(
|
2091
|
+
_emberMetalProperty_set.trySet(toObj, this._to, fromValue);
|
2090
2092
|
} else {
|
2091
|
-
_emberMetalObserver._suspendObserver(
|
2092
|
-
_emberMetalProperty_set.trySet(
|
2093
|
+
_emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () {
|
2094
|
+
_emberMetalProperty_set.trySet(toObj, this._to, fromValue);
|
2093
2095
|
});
|
2094
2096
|
}
|
2095
|
-
//
|
2097
|
+
// If we're synchronizing *to* the remote object.
|
2096
2098
|
} else if (direction === 'back') {
|
2097
|
-
var toValue = _emberMetalProperty_get.get(
|
2099
|
+
var toValue = _emberMetalProperty_get.get(toObj, this._to);
|
2098
2100
|
if (log) {
|
2099
|
-
_emberMetalLogger.default.log(' ', this.toString(), '<-', toValue,
|
2101
|
+
_emberMetalLogger.default.log(' ', this.toString(), '<-', toValue, toObj);
|
2100
2102
|
}
|
2101
|
-
_emberMetalObserver._suspendObserver(
|
2102
|
-
_emberMetalProperty_set.trySet(
|
2103
|
+
_emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () {
|
2104
|
+
_emberMetalProperty_set.trySet(fromObj, fromPath, toValue);
|
2103
2105
|
});
|
2104
2106
|
}
|
2105
2107
|
}
|
@@ -2140,7 +2142,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
2140
2142
|
An `Ember.Binding` connects the properties of two objects so that whenever
|
2141
2143
|
the value of one property changes, the other property will be changed also.
|
2142
2144
|
|
2143
|
-
## Automatic Creation of Bindings with `/^*Binding/`-named Properties
|
2145
|
+
## Automatic Creation of Bindings with `/^*Binding/`-named Properties.
|
2144
2146
|
|
2145
2147
|
You do not usually create Binding objects directly but instead describe
|
2146
2148
|
bindings in your class or object definition using automatic binding
|
@@ -2189,7 +2191,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
2189
2191
|
All of the examples above show you how to configure a custom binding, but the
|
2190
2192
|
result of these customizations will be a binding template, not a fully active
|
2191
2193
|
Binding instance. The binding will actually become active only when you
|
2192
|
-
instantiate the object the binding belongs to. It is useful however, to
|
2194
|
+
instantiate the object the binding belongs to. It is useful, however, to
|
2193
2195
|
understand what actually happens when the binding is activated.
|
2194
2196
|
|
2195
2197
|
For a binding to function it must have at least a `from` property and a `to`
|
@@ -2288,7 +2290,6 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logge
|
|
2288
2290
|
}
|
2289
2291
|
|
2290
2292
|
exports.Binding = Binding;
|
2291
|
-
exports.isGlobalPath = _emberMetalPath_cache.isGlobal;
|
2292
2293
|
});
|
2293
2294
|
// Ember.LOG_BINDINGS
|
2294
2295
|
enifed('ember-metal/cache', ['exports', 'ember-metal/empty_object'], function (exports, _emberMetalEmpty_object) {
|
@@ -2346,10 +2347,9 @@ enifed('ember-metal/cache', ['exports', 'ember-metal/empty_object'], function (e
|
|
2346
2347
|
}
|
2347
2348
|
};
|
2348
2349
|
});
|
2349
|
-
enifed('ember-metal/chains', ['exports', 'ember-metal/
|
2350
|
+
enifed('ember-metal/chains', ['exports', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/empty_object'], function (exports, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalEmpty_object) {
|
2350
2351
|
'use strict';
|
2351
2352
|
|
2352
|
-
exports.flushPendingChains = flushPendingChains;
|
2353
2353
|
exports.finishChains = finishChains;
|
2354
2354
|
|
2355
2355
|
var FIRST_KEY = /^([^\.]+)/;
|
@@ -2366,9 +2366,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
|
|
2366
2366
|
return !(isObject(obj) && obj.isDescriptor && obj._volatile === false);
|
2367
2367
|
}
|
2368
2368
|
|
2369
|
-
function ChainWatchers(
|
2370
|
-
// this obj would be the referencing chain node's parent node's value
|
2371
|
-
this.obj = obj;
|
2369
|
+
function ChainWatchers() {
|
2372
2370
|
// chain nodes that reference a key in this obj by key
|
2373
2371
|
// we only create ChainWatchers when we are going to add them
|
2374
2372
|
// so create this upfront
|
@@ -2453,29 +2451,8 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
|
|
2453
2451
|
}
|
2454
2452
|
};
|
2455
2453
|
|
2456
|
-
|
2457
|
-
|
2458
|
-
// attempts to add the pendingQueue chains again. If some of them end up
|
2459
|
-
// back in the queue and reschedule is true, schedules a timeout to try
|
2460
|
-
// again.
|
2461
|
-
|
2462
|
-
function flushPendingChains() {
|
2463
|
-
if (pendingQueue.length === 0) {
|
2464
|
-
return;
|
2465
|
-
}
|
2466
|
-
|
2467
|
-
var queue = pendingQueue;
|
2468
|
-
pendingQueue = [];
|
2469
|
-
|
2470
|
-
queue.forEach(function (q) {
|
2471
|
-
return q[0].add(q[1]);
|
2472
|
-
});
|
2473
|
-
|
2474
|
-
_emberMetalDebug.warn('Watching an undefined global, Ember expects watched globals to be ' + 'setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0, { id: 'ember-metal.chains-flush-pending-chains' });
|
2475
|
-
}
|
2476
|
-
|
2477
|
-
function makeChainWatcher(obj) {
|
2478
|
-
return new ChainWatchers(obj);
|
2454
|
+
function makeChainWatcher() {
|
2455
|
+
return new ChainWatchers();
|
2479
2456
|
}
|
2480
2457
|
|
2481
2458
|
function addChainWatcher(obj, keyName, node) {
|
@@ -2598,65 +2575,30 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
|
|
2598
2575
|
// called on the root node of a chain to setup watchers on the specified
|
2599
2576
|
// path.
|
2600
2577
|
add: function (path) {
|
2601
|
-
var
|
2602
|
-
|
2603
|
-
paths = this._paths;
|
2578
|
+
var paths = this._paths;
|
2604
2579
|
paths[path] = (paths[path] || 0) + 1;
|
2605
2580
|
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
// the path was a local path
|
2610
|
-
if (tuple[0] && tuple[0] === obj) {
|
2611
|
-
path = tuple[1];
|
2612
|
-
key = firstKey(path);
|
2613
|
-
path = path.slice(key.length + 1);
|
2614
|
-
|
2615
|
-
// global path, but object does not exist yet.
|
2616
|
-
// put into a queue and try to connect later.
|
2617
|
-
} else if (!tuple[0]) {
|
2618
|
-
pendingQueue.push([this, path]);
|
2619
|
-
tuple.length = 0;
|
2620
|
-
return;
|
2621
|
-
|
2622
|
-
// global path, and object already exists
|
2623
|
-
} else {
|
2624
|
-
src = tuple[0];
|
2625
|
-
key = path.slice(0, 0 - (tuple[1].length + 1));
|
2626
|
-
path = tuple[1];
|
2627
|
-
}
|
2581
|
+
var key = firstKey(path);
|
2582
|
+
var tail = path.slice(key.length + 1);
|
2628
2583
|
|
2629
|
-
|
2630
|
-
this.chain(key, path, src);
|
2584
|
+
this.chain(key, tail);
|
2631
2585
|
},
|
2632
2586
|
|
2633
2587
|
// called on the root node of a chain to teardown watcher on the specified
|
2634
2588
|
// path
|
2635
2589
|
remove: function (path) {
|
2636
|
-
var
|
2637
|
-
|
2638
|
-
paths = this._paths;
|
2590
|
+
var paths = this._paths;
|
2639
2591
|
if (paths[path] > 0) {
|
2640
2592
|
paths[path]--;
|
2641
2593
|
}
|
2642
2594
|
|
2643
|
-
|
2644
|
-
|
2645
|
-
if (tuple[0] === obj) {
|
2646
|
-
path = tuple[1];
|
2647
|
-
key = firstKey(path);
|
2648
|
-
path = path.slice(key.length + 1);
|
2649
|
-
} else {
|
2650
|
-
src = tuple[0];
|
2651
|
-
key = path.slice(0, 0 - (tuple[1].length + 1));
|
2652
|
-
path = tuple[1];
|
2653
|
-
}
|
2595
|
+
var key = firstKey(path);
|
2596
|
+
var tail = path.slice(key.length + 1);
|
2654
2597
|
|
2655
|
-
|
2656
|
-
this.unchain(key, path);
|
2598
|
+
this.unchain(key, tail);
|
2657
2599
|
},
|
2658
2600
|
|
2659
|
-
chain: function (key, path
|
2601
|
+
chain: function (key, path) {
|
2660
2602
|
var chains = this._chains;
|
2661
2603
|
var node;
|
2662
2604
|
if (chains === undefined) {
|
@@ -2666,7 +2608,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
|
|
2666
2608
|
}
|
2667
2609
|
|
2668
2610
|
if (node === undefined) {
|
2669
|
-
node = chains[key] = new ChainNode(this, key,
|
2611
|
+
node = chains[key] = new ChainNode(this, key, undefined);
|
2670
2612
|
}
|
2671
2613
|
|
2672
2614
|
node.count++; // count chains...
|
@@ -2675,7 +2617,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
|
|
2675
2617
|
if (path) {
|
2676
2618
|
key = firstKey(path);
|
2677
2619
|
path = path.slice(key.length + 1);
|
2678
|
-
node.chain(key, path);
|
2620
|
+
node.chain(key, path);
|
2679
2621
|
}
|
2680
2622
|
},
|
2681
2623
|
|
@@ -2722,25 +2664,21 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
|
|
2722
2664
|
}
|
2723
2665
|
|
2724
2666
|
if (affected && this._parent) {
|
2725
|
-
this._parent.populateAffected(this
|
2667
|
+
this._parent.populateAffected(this._key, 1, affected);
|
2726
2668
|
}
|
2727
2669
|
},
|
2728
2670
|
|
2729
|
-
populateAffected: function (
|
2671
|
+
populateAffected: function (path, depth, affected) {
|
2730
2672
|
if (this._key) {
|
2731
2673
|
path = this._key + '.' + path;
|
2732
2674
|
}
|
2733
2675
|
|
2734
2676
|
if (this._parent) {
|
2735
|
-
this._parent.populateAffected(
|
2677
|
+
this._parent.populateAffected(path, depth + 1, affected);
|
2736
2678
|
} else {
|
2737
2679
|
if (depth > 1) {
|
2738
2680
|
affected.push(this.value(), path);
|
2739
2681
|
}
|
2740
|
-
path = 'this.' + path;
|
2741
|
-
if (this._paths[path] > 0) {
|
2742
|
-
affected.push(this.value(), path);
|
2743
|
-
}
|
2744
2682
|
}
|
2745
2683
|
}
|
2746
2684
|
};
|
@@ -2781,6 +2719,10 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
2781
2719
|
|
2782
2720
|
var DEEP_EACH_REGEX = /\.@each\.[^.]+\./;
|
2783
2721
|
|
2722
|
+
// ..........................................................
|
2723
|
+
// COMPUTED PROPERTY
|
2724
|
+
//
|
2725
|
+
|
2784
2726
|
/**
|
2785
2727
|
A computed property transforms an object literal with object's accessor function(s) into a property.
|
2786
2728
|
|
@@ -2883,6 +2825,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
2883
2825
|
|
2884
2826
|
@class ComputedProperty
|
2885
2827
|
@namespace Ember
|
2828
|
+
@constructor
|
2886
2829
|
@public
|
2887
2830
|
*/
|
2888
2831
|
function ComputedProperty(config, opts) {
|
@@ -3041,6 +2984,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
3041
2984
|
@chainable
|
3042
2985
|
@public
|
3043
2986
|
*/
|
2987
|
+
|
3044
2988
|
ComputedPropertyPrototype.meta = function (meta) {
|
3045
2989
|
if (arguments.length === 0) {
|
3046
2990
|
return this._meta || {};
|
@@ -3071,6 +3015,33 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
3071
3015
|
}
|
3072
3016
|
};
|
3073
3017
|
|
3018
|
+
/**
|
3019
|
+
Access the value of the function backing the computed property.
|
3020
|
+
If this property has already been cached, return the cached result.
|
3021
|
+
Otherwise, call the function passing the property name as an argument.
|
3022
|
+
|
3023
|
+
```javascript
|
3024
|
+
let Person = Ember.Object.extend({
|
3025
|
+
fullName: Ember.computed('firstName', 'lastName', function(keyName) {
|
3026
|
+
// the keyName parameter is 'fullName' in this case.
|
3027
|
+
return this.get('firstName') + ' ' + this.get('lastName');
|
3028
|
+
})
|
3029
|
+
});
|
3030
|
+
|
3031
|
+
|
3032
|
+
let tom = Person.create({
|
3033
|
+
firstName: 'Tom',
|
3034
|
+
lastName: 'Dale'
|
3035
|
+
});
|
3036
|
+
|
3037
|
+
tom.get('fullName') // 'Tom Dale'
|
3038
|
+
```
|
3039
|
+
|
3040
|
+
@method get
|
3041
|
+
@param {String} keyName The key being accessed.
|
3042
|
+
@return {Object} The return value of the function backing the CP.
|
3043
|
+
@public
|
3044
|
+
*/
|
3074
3045
|
ComputedPropertyPrototype.get = function (obj, keyName) {
|
3075
3046
|
if (this._volatile) {
|
3076
3047
|
return this._getter.call(obj, keyName);
|
@@ -3102,6 +3073,54 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
3102
3073
|
return ret;
|
3103
3074
|
};
|
3104
3075
|
|
3076
|
+
/**
|
3077
|
+
Set the value of a computed property. If the function that backs your
|
3078
|
+
computed property does not accept arguments then the default action for
|
3079
|
+
setting would be to define the property on the current object, and set
|
3080
|
+
the value of the property to the value being set.
|
3081
|
+
|
3082
|
+
Generally speaking if you intend for your computed property to be set
|
3083
|
+
you should pass `set(key, value)` function in hash as argument to `Ember.computed()` along with `get(key)` function.
|
3084
|
+
|
3085
|
+
```javascript
|
3086
|
+
let Person = Ember.Object.extend({
|
3087
|
+
// these will be supplied by `create`
|
3088
|
+
firstName: null,
|
3089
|
+
lastName: null,
|
3090
|
+
|
3091
|
+
fullName: Ember.computed('firstName', 'lastName', {
|
3092
|
+
// getter
|
3093
|
+
get() {
|
3094
|
+
let firstName = this.get('firstName');
|
3095
|
+
let lastName = this.get('lastName');
|
3096
|
+
|
3097
|
+
return firstName + ' ' + lastName;
|
3098
|
+
},
|
3099
|
+
// setter
|
3100
|
+
set(key, value) {
|
3101
|
+
let [firstName, lastName] = value.split(' ');
|
3102
|
+
|
3103
|
+
this.set('firstName', firstName);
|
3104
|
+
this.set('lastName', lastName);
|
3105
|
+
|
3106
|
+
return value;
|
3107
|
+
}
|
3108
|
+
})
|
3109
|
+
});
|
3110
|
+
|
3111
|
+
let person = Person.create();
|
3112
|
+
|
3113
|
+
person.set('fullName', 'Peter Wagenet');
|
3114
|
+
person.get('firstName'); // 'Peter'
|
3115
|
+
person.get('lastName'); // 'Wagenet'
|
3116
|
+
```
|
3117
|
+
|
3118
|
+
@method set
|
3119
|
+
@param {String} keyName The key being accessed.
|
3120
|
+
@param {Object} newValue The new value being assigned.
|
3121
|
+
@return {Object} The return value of the function backing the CP.
|
3122
|
+
@public
|
3123
|
+
*/
|
3105
3124
|
ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) {
|
3106
3125
|
if (this._readOnly) {
|
3107
3126
|
this._throwReadOnlyError(obj, keyName);
|
@@ -3245,7 +3264,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
3245
3264
|
this.lastName = 'Jones';
|
3246
3265
|
},
|
3247
3266
|
|
3248
|
-
fullName: Ember.computed(
|
3267
|
+
fullName: Ember.computed({
|
3249
3268
|
get(key) {
|
3250
3269
|
return `${this.get('firstName')} ${this.get('lastName')}`;
|
3251
3270
|
},
|
@@ -4023,6 +4042,8 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
|
|
4023
4042
|
Ember may overwrite this namespace and therefore, you should avoid adding any
|
4024
4043
|
new properties.
|
4025
4044
|
|
4045
|
+
You can also use the shorthand `Em` instead of `Ember`.
|
4046
|
+
|
4026
4047
|
At the heart of Ember is Ember-Runtime, a set of core functions that provide
|
4027
4048
|
cross-platform compatibility and object property observing. Ember-Runtime is
|
4028
4049
|
small and performance-focused so you can use it alongside other
|
@@ -4031,7 +4052,7 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
|
|
4031
4052
|
|
4032
4053
|
@class Ember
|
4033
4054
|
@static
|
4034
|
-
@version 2.
|
4055
|
+
@version 2.5.0-beta.1
|
4035
4056
|
@public
|
4036
4057
|
*/
|
4037
4058
|
|
@@ -4073,11 +4094,11 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
|
|
4073
4094
|
|
4074
4095
|
@property VERSION
|
4075
4096
|
@type String
|
4076
|
-
@default '2.
|
4097
|
+
@default '2.5.0-beta.1'
|
4077
4098
|
@static
|
4078
4099
|
@public
|
4079
4100
|
*/
|
4080
|
-
Ember.VERSION = '2.
|
4101
|
+
Ember.VERSION = '2.5.0-beta.1';
|
4081
4102
|
|
4082
4103
|
/**
|
4083
4104
|
The hash of environment variables used to control various configuration
|
@@ -4808,7 +4829,7 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
|
|
4808
4829
|
return func;
|
4809
4830
|
}
|
4810
4831
|
});
|
4811
|
-
enifed('ember-metal/expand_properties', ['exports', 'ember-metal/
|
4832
|
+
enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) {
|
4812
4833
|
'use strict';
|
4813
4834
|
|
4814
4835
|
exports.default = expandProperties;
|
@@ -4819,7 +4840,6 @@ enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], functi
|
|
4819
4840
|
*/
|
4820
4841
|
|
4821
4842
|
var SPLIT_REGEX = /\{|\}/;
|
4822
|
-
|
4823
4843
|
var END_WITH_EACH_REGEX = /\.@each$/;
|
4824
4844
|
|
4825
4845
|
/**
|
@@ -4851,25 +4871,21 @@ enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], functi
|
|
4851
4871
|
*/
|
4852
4872
|
|
4853
4873
|
function expandProperties(pattern, callback) {
|
4854
|
-
|
4855
|
-
|
4856
|
-
}
|
4874
|
+
_emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string');
|
4875
|
+
_emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1);
|
4857
4876
|
|
4858
|
-
|
4859
|
-
|
4860
|
-
var properties = [parts];
|
4877
|
+
var parts = pattern.split(SPLIT_REGEX);
|
4878
|
+
var properties = [parts];
|
4861
4879
|
|
4862
|
-
|
4863
|
-
|
4864
|
-
|
4865
|
-
|
4866
|
-
}
|
4880
|
+
for (var i = 0; i < parts.length; i++) {
|
4881
|
+
var part = parts[i];
|
4882
|
+
if (part.indexOf(',') >= 0) {
|
4883
|
+
properties = duplicateAndReplace(properties, part.split(','), i);
|
4884
|
+
}
|
4885
|
+
}
|
4867
4886
|
|
4868
|
-
|
4869
|
-
|
4870
|
-
});
|
4871
|
-
} else {
|
4872
|
-
callback(pattern.replace(END_WITH_EACH_REGEX, '.[]'));
|
4887
|
+
for (var i = 0; i < properties.length; i++) {
|
4888
|
+
callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]'));
|
4873
4889
|
}
|
4874
4890
|
}
|
4875
4891
|
|
@@ -4905,11 +4921,9 @@ enifed('ember-metal/features', ['exports', 'ember-metal/core', 'ember-metal/assi
|
|
4905
4921
|
@since 1.1.0
|
4906
4922
|
@public
|
4907
4923
|
*/
|
4908
|
-
var
|
4924
|
+
var FEATURES = _emberMetalAssign.default({}, _emberMetalCore.default.ENV.FEATURES);exports.FEATURES = FEATURES;
|
4909
4925
|
// jshint ignore:line
|
4910
|
-
var FEATURES = _emberMetalAssign.default(KNOWN_FEATURES, _emberMetalCore.default.ENV.FEATURES);
|
4911
4926
|
|
4912
|
-
exports.FEATURES = FEATURES;
|
4913
4927
|
/**
|
4914
4928
|
Determine whether the specified `feature` is enabled. Used by Ember's
|
4915
4929
|
build tools to exclude experimental features from beta/stable builds.
|
@@ -4983,7 +4997,7 @@ enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], fu
|
|
4983
4997
|
return ret;
|
4984
4998
|
}
|
4985
4999
|
});
|
4986
|
-
enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/logger', 'ember-metal/property_get', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/property_set', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/computed_macros', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/libraries', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'backburner'], function (exports, _require, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalAssign, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner) {
|
5000
|
+
enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/logger', 'ember-metal/property_get', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/property_set', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/computed_macros', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/run_loop', 'ember-metal/libraries', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'backburner'], function (exports, _require, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalAssign, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner) {
|
4987
5001
|
/**
|
4988
5002
|
@module ember
|
4989
5003
|
@submodule ember-metal
|
@@ -5053,7 +5067,6 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
|
|
5053
5067
|
|
5054
5068
|
_emberMetalCore.default.get = _emberMetalProperty_get.get;
|
5055
5069
|
_emberMetalCore.default.getWithDefault = _emberMetalProperty_get.getWithDefault;
|
5056
|
-
_emberMetalCore.default.normalizeTuple = _emberMetalProperty_get.normalizeTuple;
|
5057
5070
|
_emberMetalCore.default._getPath = _emberMetalProperty_get._getPath;
|
5058
5071
|
|
5059
5072
|
_emberMetalCore.default.on = _emberMetalEvents.on;
|
@@ -5091,7 +5104,6 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
|
|
5091
5104
|
_emberMetalCore.default.watchKey = _emberMetalWatch_key.watchKey;
|
5092
5105
|
_emberMetalCore.default.unwatchKey = _emberMetalWatch_key.unwatchKey;
|
5093
5106
|
|
5094
|
-
_emberMetalCore.default.flushPendingChains = _emberMetalChains.flushPendingChains;
|
5095
5107
|
_emberMetalCore.default.removeChainWatcher = _emberMetalChains.removeChainWatcher;
|
5096
5108
|
_emberMetalCore.default._ChainNode = _emberMetalChains.ChainNode;
|
5097
5109
|
_emberMetalCore.default.finishChains = _emberMetalChains.finishChains;
|
@@ -5127,7 +5139,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
|
|
5127
5139
|
|
5128
5140
|
_emberMetalCore.default.bind = _emberMetalBinding.bind;
|
5129
5141
|
_emberMetalCore.default.Binding = _emberMetalBinding.Binding;
|
5130
|
-
_emberMetalCore.default.isGlobalPath =
|
5142
|
+
_emberMetalCore.default.isGlobalPath = _emberMetalPath_cache.isGlobalPath;
|
5131
5143
|
|
5132
5144
|
_emberMetalCore.default.run = _emberMetalRun_loop.default;
|
5133
5145
|
|
@@ -5149,6 +5161,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
|
|
5149
5161
|
_emberMetalCore.default.isBlank = _emberMetalIs_blank.default;
|
5150
5162
|
_emberMetalCore.default.isPresent = _emberMetalIs_present.default;
|
5151
5163
|
|
5164
|
+
_emberMetalCore.default.assign = Object.assign || _emberMetalAssign.default;
|
5152
5165
|
_emberMetalCore.default.merge = _emberMetalMerge.default;
|
5153
5166
|
|
5154
5167
|
_emberMetalCore.default.FEATURES = _emberMetalFeatures.FEATURES;
|
@@ -5190,6 +5203,10 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
|
|
5190
5203
|
_emberMetalCore.default.Debug.registerWarnHandler = function () {};
|
5191
5204
|
}
|
5192
5205
|
|
5206
|
+
_emberMetalDebug.deprecate('Support for the `ember-legacy-views` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { id: 'ember-legacy-views', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' });
|
5207
|
+
|
5208
|
+
_emberMetalDebug.deprecate('Support for the `ember-legacy-controllers` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_CONTROLLER_SUPPORT, { id: 'ember-legacy-controllers', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_objectcontroller' });
|
5209
|
+
|
5193
5210
|
_emberMetalCore.default.create = _emberMetalDebug.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create);
|
5194
5211
|
_emberMetalCore.default.keys = _emberMetalDebug.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys);
|
5195
5212
|
|
@@ -5720,6 +5737,12 @@ enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/fe
|
|
5720
5737
|
}
|
5721
5738
|
};
|
5722
5739
|
|
5740
|
+
if (_emberMetalFeatures.default('ember-libraries-isregistered')) {
|
5741
|
+
Libraries.prototype.isRegistered = function (name) {
|
5742
|
+
return !!this._getLibraryByName(name);
|
5743
|
+
};
|
5744
|
+
}
|
5745
|
+
|
5723
5746
|
exports.default = Libraries;
|
5724
5747
|
});
|
5725
5748
|
enifed('ember-metal/logger', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) {
|
@@ -6391,6 +6414,9 @@ enifed('ember-metal/merge', ['exports', 'ember-metal/debug', 'ember-metal/featur
|
|
6391
6414
|
*/
|
6392
6415
|
|
6393
6416
|
function merge(original, updates) {
|
6417
|
+
if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
|
6418
|
+
_emberMetalDebug.deprecate('Usage of `Ember.merge` is deprecated, use `Ember.assign` instead.', false, { id: 'ember-metal.merge', until: '3.0.0' });
|
6419
|
+
}
|
6394
6420
|
|
6395
6421
|
if (!updates || typeof updates !== 'object') {
|
6396
6422
|
return original;
|
@@ -8246,9 +8272,9 @@ enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/f
|
|
8246
8272
|
Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');
|
8247
8273
|
|
8248
8274
|
// define a computed property
|
8249
|
-
Ember.defineProperty(contact, 'fullName', Ember.computed(
|
8275
|
+
Ember.defineProperty(contact, 'fullName', Ember.computed(function() {
|
8250
8276
|
return this.firstName+' '+this.lastName;
|
8251
|
-
}));
|
8277
|
+
}).property('firstName', 'lastName'));
|
8252
8278
|
```
|
8253
8279
|
|
8254
8280
|
@private
|
@@ -8630,7 +8656,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-me
|
|
8630
8656
|
exports.endPropertyChanges = endPropertyChanges;
|
8631
8657
|
exports.changeProperties = changeProperties;
|
8632
8658
|
});
|
8633
|
-
enifed('ember-metal/property_get', ['exports', 'ember-metal/
|
8659
|
+
enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) {
|
8634
8660
|
/**
|
8635
8661
|
@module ember-metal
|
8636
8662
|
*/
|
@@ -8638,12 +8664,9 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
|
|
8638
8664
|
'use strict';
|
8639
8665
|
|
8640
8666
|
exports.get = get;
|
8641
|
-
exports.normalizeTuple = normalizeTuple;
|
8642
8667
|
exports._getPath = _getPath;
|
8643
8668
|
exports.getWithDefault = getWithDefault;
|
8644
8669
|
|
8645
|
-
var FIRST_KEY = /^([^\.]+)/;
|
8646
|
-
|
8647
8670
|
// ..........................................................
|
8648
8671
|
// GET AND SET
|
8649
8672
|
//
|
@@ -8709,77 +8732,24 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
|
|
8709
8732
|
}
|
8710
8733
|
}
|
8711
8734
|
|
8712
|
-
/**
|
8713
|
-
Normalizes a target/path pair to reflect that actual target/path that should
|
8714
|
-
be observed, etc. This takes into account passing in global property
|
8715
|
-
paths (i.e. a path beginning with a capital letter not defined on the
|
8716
|
-
target).
|
8717
|
-
|
8718
|
-
@private
|
8719
|
-
@method normalizeTuple
|
8720
|
-
@for Ember
|
8721
|
-
@param {Object} target The current target. May be `null`.
|
8722
|
-
@param {String} path A path on the target or a global property path.
|
8723
|
-
@return {Array} a temporary array with the normalized target/path pair.
|
8724
|
-
*/
|
8725
|
-
|
8726
|
-
function normalizeTuple(target, path) {
|
8727
|
-
var hasThis = _emberMetalPath_cache.hasThis(path);
|
8728
|
-
var isGlobal = !hasThis && _emberMetalPath_cache.isGlobal(path);
|
8729
|
-
var key;
|
8730
|
-
|
8731
|
-
if (!target && !isGlobal) {
|
8732
|
-
return [undefined, ''];
|
8733
|
-
}
|
8734
|
-
|
8735
|
-
if (hasThis) {
|
8736
|
-
path = path.slice(5);
|
8737
|
-
}
|
8738
|
-
|
8739
|
-
if (!target || isGlobal) {
|
8740
|
-
target = _emberMetalCore.default.lookup;
|
8741
|
-
}
|
8742
|
-
|
8743
|
-
if (isGlobal && _emberMetalPath_cache.isPath(path)) {
|
8744
|
-
key = path.match(FIRST_KEY)[0];
|
8745
|
-
target = get(target, key);
|
8746
|
-
path = path.slice(key.length + 1);
|
8747
|
-
}
|
8748
|
-
|
8749
|
-
// must return some kind of path to be valid else other things will break.
|
8750
|
-
validateIsPath(path);
|
8751
|
-
|
8752
|
-
return [target, path];
|
8753
|
-
}
|
8754
|
-
|
8755
|
-
function validateIsPath(path) {
|
8756
|
-
if (!path || path.length === 0) {
|
8757
|
-
throw new _emberMetalError.default('Object in path ' + path + ' could not be found or was destroyed.');
|
8758
|
-
}
|
8759
|
-
}
|
8760
|
-
|
8761
8735
|
function _getPath(root, path) {
|
8762
|
-
var
|
8736
|
+
var obj = root;
|
8737
|
+
var parts = path.split('.');
|
8738
|
+
var len = parts.length;
|
8763
8739
|
|
8764
|
-
|
8765
|
-
|
8740
|
+
for (var i = 0; i < len; i++) {
|
8741
|
+
if (obj == null) {
|
8742
|
+
return obj;
|
8743
|
+
}
|
8766
8744
|
|
8767
|
-
|
8768
|
-
tuple = normalizeTuple(root, path);
|
8769
|
-
root = tuple[0];
|
8770
|
-
path = tuple[1];
|
8771
|
-
tuple.length = 0;
|
8772
|
-
}
|
8745
|
+
obj = get(obj, parts[i]);
|
8773
8746
|
|
8774
|
-
|
8775
|
-
len = parts.length;
|
8776
|
-
for (idx = 0; root != null && idx < len; idx++) {
|
8777
|
-
root = get(root, parts[idx]);
|
8778
|
-
if (root && root.isDestroyed) {
|
8747
|
+
if (obj && obj.isDestroyed) {
|
8779
8748
|
return undefined;
|
8780
8749
|
}
|
8781
8750
|
}
|
8782
|
-
|
8751
|
+
|
8752
|
+
return obj;
|
8783
8753
|
}
|
8784
8754
|
|
8785
8755
|
/**
|
@@ -8849,7 +8819,7 @@ enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal
|
|
8849
8819
|
return setPath(obj, keyName, value, tolerant);
|
8850
8820
|
}
|
8851
8821
|
|
8852
|
-
_emberMetalDebug.assert('calling set on destroyed object', !obj.isDestroyed);
|
8822
|
+
_emberMetalDebug.assert('calling set on destroyed object: ' + _emberMetalUtils.toString(obj) + '.' + keyName + ' = ' + _emberMetalUtils.toString(value), !obj.isDestroyed);
|
8853
8823
|
|
8854
8824
|
if (desc) {
|
8855
8825
|
desc.set(obj, keyName, value);
|
@@ -10343,13 +10313,13 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10343
10313
|
exports.setValue = setValue;
|
10344
10314
|
|
10345
10315
|
/*
|
10346
|
-
Check whether an object is a stream or not
|
10316
|
+
Check whether an object is a stream or not.
|
10347
10317
|
|
10348
10318
|
@private
|
10349
10319
|
@for Ember.stream
|
10350
10320
|
@function isStream
|
10351
|
-
@param {Object|Stream} object
|
10352
|
-
@return {Boolean} `true` if the object is a stream, `false` otherwise
|
10321
|
+
@param {Object|Stream} object Object to check whether it is a stream.
|
10322
|
+
@return {Boolean} `true` if the object is a stream, `false` otherwise.
|
10353
10323
|
*/
|
10354
10324
|
|
10355
10325
|
function isStream(object) {
|
@@ -10363,10 +10333,10 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10363
10333
|
@public
|
10364
10334
|
@for Ember.stream
|
10365
10335
|
@function subscribe
|
10366
|
-
@param {Object|Stream} object
|
10367
|
-
@param {Function} callback
|
10336
|
+
@param {Object|Stream} object Object or stream to potentially subscribe to.
|
10337
|
+
@param {Function} callback Function to run when stream value changes.
|
10368
10338
|
@param {Object} [context] the callback will be executed with this context if it
|
10369
|
-
is provided
|
10339
|
+
is provided.
|
10370
10340
|
*/
|
10371
10341
|
|
10372
10342
|
function subscribe(object, callback, context) {
|
@@ -10382,9 +10352,9 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10382
10352
|
@private
|
10383
10353
|
@for Ember.stream
|
10384
10354
|
@function unsubscribe
|
10385
|
-
@param {Object|Stream} object
|
10386
|
-
@param {Function} callback
|
10387
|
-
@param {Object} [context]
|
10355
|
+
@param {Object|Stream} object Object or stream to potentially unsubscribe from.
|
10356
|
+
@param {Function} callback Function originally passed to `subscribe()`.
|
10357
|
+
@param {Object} [context] Object originally passed to `subscribe()`.
|
10388
10358
|
*/
|
10389
10359
|
|
10390
10360
|
function unsubscribe(object, callback, context) {
|
@@ -10394,14 +10364,14 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10394
10364
|
}
|
10395
10365
|
|
10396
10366
|
/*
|
10397
|
-
Retrieve the value of a stream, or in the case a non-stream object is passed,
|
10367
|
+
Retrieve the value of a stream, or in the case where a non-stream object is passed,
|
10398
10368
|
return the object itself.
|
10399
10369
|
|
10400
10370
|
@private
|
10401
10371
|
@for Ember.stream
|
10402
10372
|
@function read
|
10403
|
-
@param {Object|Stream} object
|
10404
|
-
@return
|
10373
|
+
@param {Object|Stream} object Object to return the value of.
|
10374
|
+
@return The stream's current value, or the non-stream object itself.
|
10405
10375
|
*/
|
10406
10376
|
|
10407
10377
|
function read(object) {
|
@@ -10419,7 +10389,7 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10419
10389
|
@for Ember.stream
|
10420
10390
|
@function readArray
|
10421
10391
|
@param {Array} array The array to read values from
|
10422
|
-
@return {Array}
|
10392
|
+
@return {Array} A new array of the same length with the values of non-stream
|
10423
10393
|
objects mapped from their original positions untouched, and
|
10424
10394
|
the values of stream objects retaining their original position
|
10425
10395
|
and replaced with the stream's current value.
|
@@ -10441,8 +10411,8 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10441
10411
|
@private
|
10442
10412
|
@for Ember.stream
|
10443
10413
|
@function readHash
|
10444
|
-
@param {Object} object The hash to read keys and values from
|
10445
|
-
@return {Object}
|
10414
|
+
@param {Object} object The hash to read keys and values from.
|
10415
|
+
@return {Object} A new object with the same keys as the passed object. The
|
10446
10416
|
property values in the new object are the original values in
|
10447
10417
|
the case of non-stream objects, and the streams' current
|
10448
10418
|
values in the case of stream objects.
|
@@ -10457,14 +10427,14 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10457
10427
|
}
|
10458
10428
|
|
10459
10429
|
/*
|
10460
|
-
Check whether an array contains any stream values
|
10430
|
+
Check whether an array contains any stream values.
|
10461
10431
|
|
10462
10432
|
@private
|
10463
10433
|
@for Ember.stream
|
10464
10434
|
@function scanArray
|
10465
|
-
@param {Array} array
|
10435
|
+
@param {Array} array Array given to a handlebars helper.
|
10466
10436
|
@return {Boolean} `true` if the array contains a stream/bound value, `false`
|
10467
|
-
otherwise
|
10437
|
+
otherwise.
|
10468
10438
|
*/
|
10469
10439
|
|
10470
10440
|
function scanArray(array) {
|
@@ -10482,14 +10452,14 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10482
10452
|
}
|
10483
10453
|
|
10484
10454
|
/*
|
10485
|
-
Check whether a hash has any stream property values
|
10455
|
+
Check whether a hash has any stream property values.
|
10486
10456
|
|
10487
10457
|
@private
|
10488
10458
|
@for Ember.stream
|
10489
10459
|
@function scanHash
|
10490
|
-
@param {Object} hash "hash" argument given to a handlebars helper
|
10460
|
+
@param {Object} hash "hash" argument given to a handlebars helper.
|
10491
10461
|
@return {Boolean} `true` if the object contains a stream/bound value, `false`
|
10492
|
-
otherwise
|
10462
|
+
otherwise.
|
10493
10463
|
*/
|
10494
10464
|
|
10495
10465
|
function scanHash(hash) {
|
@@ -10510,8 +10480,8 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10510
10480
|
this.array = array;
|
10511
10481
|
this.separator = separator;
|
10512
10482
|
|
10513
|
-
//
|
10514
|
-
// as a string literal
|
10483
|
+
// Used by angle bracket components to detect an attribute was provided
|
10484
|
+
// as a string literal.
|
10515
10485
|
this.isConcat = true;
|
10516
10486
|
},
|
10517
10487
|
|
@@ -10526,17 +10496,17 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10526
10496
|
});
|
10527
10497
|
|
10528
10498
|
/*
|
10529
|
-
Join an array, with any streams replaced by their current values
|
10499
|
+
Join an array, with any streams replaced by their current values.
|
10530
10500
|
|
10531
10501
|
@private
|
10532
10502
|
@for Ember.stream
|
10533
10503
|
@function concat
|
10534
10504
|
@param {Array} array An array containing zero or more stream objects and
|
10535
|
-
zero or more non-stream objects
|
10536
|
-
@param {String} separator
|
10505
|
+
zero or more non-stream objects.
|
10506
|
+
@param {String} separator String to be used to join array elements.
|
10537
10507
|
@return {String} String with array elements concatenated and joined by the
|
10538
10508
|
provided separator, and any stream array members having been
|
10539
|
-
replaced by the current value of the stream
|
10509
|
+
replaced by the current value of the stream.
|
10540
10510
|
*/
|
10541
10511
|
|
10542
10512
|
function concat(array, separator) {
|
@@ -10676,9 +10646,9 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
|
|
10676
10646
|
@private
|
10677
10647
|
@for Ember.stream
|
10678
10648
|
@function chain
|
10679
|
-
@param {Object|Stream} value A stream or non-stream object
|
10680
|
-
@param {Function} fn
|
10681
|
-
be run once in the case of a non-stream object
|
10649
|
+
@param {Object|Stream} value A stream or non-stream object.
|
10650
|
+
@param {Function} fn Function to be run when the stream value changes, or to
|
10651
|
+
be run once in the case of a non-stream object.
|
10682
10652
|
@return {Object|Stream} In the case of a stream `value` parameter, a new
|
10683
10653
|
stream that will be updated with the return value of
|
10684
10654
|
the provided function `fn`. In the case of a
|
@@ -10745,6 +10715,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
10745
10715
|
exports.apply = apply;
|
10746
10716
|
exports.applyStr = applyStr;
|
10747
10717
|
exports.lookupDescriptor = lookupDescriptor;
|
10718
|
+
exports.toString = toString;
|
10748
10719
|
var _uuid = 0;
|
10749
10720
|
|
10750
10721
|
/**
|
@@ -11129,7 +11100,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
11129
11100
|
// TYPING & ARRAY MESSAGING
|
11130
11101
|
//
|
11131
11102
|
|
11132
|
-
var
|
11103
|
+
var objectToString = Object.prototype.toString;
|
11133
11104
|
|
11134
11105
|
/**
|
11135
11106
|
Forces the passed object to be part of an array. If the object is already
|
@@ -11193,7 +11164,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
11193
11164
|
return '' + obj;
|
11194
11165
|
}
|
11195
11166
|
// overridden toString
|
11196
|
-
if (typeof obj.toString === 'function' && obj.toString !==
|
11167
|
+
if (typeof obj.toString === 'function' && obj.toString !== objectToString) {
|
11197
11168
|
return obj.toString();
|
11198
11169
|
}
|
11199
11170
|
|
@@ -11211,7 +11182,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
11211
11182
|
}
|
11212
11183
|
|
11213
11184
|
if (v && typeof v.toString !== 'function') {
|
11214
|
-
ret.push(key + ': ' +
|
11185
|
+
ret.push(key + ': ' + objectToString.call(v));
|
11215
11186
|
} else {
|
11216
11187
|
ret.push(key + ': ' + v);
|
11217
11188
|
}
|
@@ -11293,6 +11264,17 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
11293
11264
|
return null;
|
11294
11265
|
}
|
11295
11266
|
|
11267
|
+
// A `toString` util function that supports objects without a `toString`
|
11268
|
+
// method, e.g. an object created with `Object.create(null)`.
|
11269
|
+
|
11270
|
+
function toString(obj) {
|
11271
|
+
if (obj && obj.toString) {
|
11272
|
+
return obj.toString();
|
11273
|
+
} else {
|
11274
|
+
return objectToString.call(obj);
|
11275
|
+
}
|
11276
|
+
}
|
11277
|
+
|
11296
11278
|
exports.GUID_KEY = GUID_KEY;
|
11297
11279
|
exports.makeArray = makeArray;
|
11298
11280
|
exports.canInvoke = canInvoke;
|
@@ -11512,8 +11494,6 @@ enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/wa
|
|
11512
11494
|
return meta && meta.peekWatching(key) || 0;
|
11513
11495
|
}
|
11514
11496
|
|
11515
|
-
watch.flushPending = _emberMetalChains.flushPendingChains;
|
11516
|
-
|
11517
11497
|
function unwatch(obj, _keyPath, m) {
|
11518
11498
|
// can't watch length on Array - it is special...
|
11519
11499
|
if (_keyPath === 'length' && Array.isArray(obj)) {
|
@@ -11705,20 +11685,19 @@ enifed('ember-template-compiler/compat', ['exports', 'ember-metal/core', 'ember-
|
|
11705
11685
|
EmberHandlebars.compile = _emberTemplateCompilerSystemCompile.default;
|
11706
11686
|
EmberHandlebars.template = _emberTemplateCompilerSystemTemplate.default;
|
11707
11687
|
});
|
11708
|
-
enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-
|
11688
|
+
enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/transform-unescaped-inline-link-to', 'ember-template-compiler/plugins/assert-no-view-and-controller-paths', 'ember-template-compiler/plugins/assert-no-view-helper', 'ember-template-compiler/plugins/assert-no-each-in', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo, _emberTemplateCompilerPluginsAssertNoViewAndControllerPaths, _emberTemplateCompilerPluginsAssertNoViewHelper, _emberTemplateCompilerPluginsAssertNoEachIn, _emberTemplateCompilerCompat) {
|
11709
11689
|
'use strict';
|
11710
11690
|
|
11711
11691
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax.default);
|
11712
11692
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default);
|
11713
11693
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass.default);
|
11714
|
-
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformClosureComponentAttrsIntoMut.default);
|
11715
11694
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut.default);
|
11716
11695
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly.default);
|
11717
11696
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents.default);
|
11718
11697
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default);
|
11719
11698
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformTopLevelComponents.default);
|
11720
11699
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo.default);
|
11721
|
-
_emberTemplateCompilerPlugins.registerPlugin('ast',
|
11700
|
+
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsAssertNoEachIn.default);
|
11722
11701
|
|
11723
11702
|
if (_emberMetal.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
11724
11703
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachIntoCollection.default);
|
@@ -11735,13 +11714,56 @@ enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-templa
|
|
11735
11714
|
});
|
11736
11715
|
|
11737
11716
|
// used for adding Ember.Handlebars.compile for backwards compat
|
11717
|
+
enifed('ember-template-compiler/plugins/assert-no-each-in', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
11718
|
+
'use strict';
|
11719
|
+
|
11720
|
+
function AssertNoEachIn() {
|
11721
|
+
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
11722
|
+
|
11723
|
+
this.syntax = null;
|
11724
|
+
this.options = options;
|
11725
|
+
}
|
11726
|
+
|
11727
|
+
AssertNoEachIn.prototype.transform = function AssertNoEachIn_transform(ast) {
|
11728
|
+
if (!!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
11729
|
+
return ast;
|
11730
|
+
}
|
11731
|
+
var walker = new this.syntax.Walker();
|
11732
|
+
var moduleName = this.options && this.options.moduleName;
|
11733
|
+
|
11734
|
+
walker.visit(ast, function (node) {
|
11735
|
+
if (!validate(node)) {
|
11736
|
+
return;
|
11737
|
+
}
|
11738
|
+
assertHelper(moduleName, node);
|
11739
|
+
});
|
11740
|
+
|
11741
|
+
return ast;
|
11742
|
+
};
|
11743
|
+
|
11744
|
+
function assertHelper(moduleName, node) {
|
11745
|
+
var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc);
|
11746
|
+
var singular = node.params[0].original;
|
11747
|
+
var plural = node.params[2].original;
|
11748
|
+
|
11749
|
+
_emberMetalDebug.assert('Using {{#each ' + singular + ' in ' + plural + '}} ' + moduleInfo + 'is no longer supported in Ember 2.0+, please use {{#each ' + plural + ' as |' + singular + '|}}');
|
11750
|
+
}
|
11751
|
+
|
11752
|
+
function validate(node) {
|
11753
|
+
return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'each' && node.params.length === 3 && node.params[1].type === 'PathExpression' && node.params[1].original === 'in';
|
11754
|
+
}
|
11755
|
+
|
11756
|
+
exports.default = AssertNoEachIn;
|
11757
|
+
});
|
11738
11758
|
enifed('ember-template-compiler/plugins/assert-no-view-and-controller-paths', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
11739
11759
|
'use strict';
|
11740
11760
|
|
11741
|
-
function AssertNoViewAndControllerPaths(
|
11761
|
+
function AssertNoViewAndControllerPaths() {
|
11762
|
+
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
11763
|
+
|
11742
11764
|
// set later within HTMLBars to the syntax package
|
11743
11765
|
this.syntax = null;
|
11744
|
-
this.options = options
|
11766
|
+
this.options = options;
|
11745
11767
|
}
|
11746
11768
|
|
11747
11769
|
/**
|
@@ -11816,10 +11838,12 @@ enifed('ember-template-compiler/plugins/assert-no-view-and-controller-paths', ['
|
|
11816
11838
|
enifed('ember-template-compiler/plugins/assert-no-view-helper', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
11817
11839
|
'use strict';
|
11818
11840
|
|
11819
|
-
function AssertNoViewHelper(
|
11841
|
+
function AssertNoViewHelper() {
|
11842
|
+
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
11843
|
+
|
11820
11844
|
// set later within HTMLBars to the syntax package
|
11821
11845
|
this.syntax = null;
|
11822
|
-
this.options = options
|
11846
|
+
this.options = options;
|
11823
11847
|
}
|
11824
11848
|
|
11825
11849
|
/**
|
@@ -11861,45 +11885,6 @@ enifed('ember-template-compiler/plugins/assert-no-view-helper', ['exports', 'emb
|
|
11861
11885
|
|
11862
11886
|
exports.default = AssertNoViewHelper;
|
11863
11887
|
});
|
11864
|
-
enifed('ember-template-compiler/plugins/deprecate-render-block', ['exports', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
11865
|
-
'use strict';
|
11866
|
-
|
11867
|
-
exports.default = DeprecateRenderBlock;
|
11868
|
-
|
11869
|
-
function DeprecateRenderBlock(options) {
|
11870
|
-
this.syntax = null;
|
11871
|
-
this.options = options;
|
11872
|
-
}
|
11873
|
-
|
11874
|
-
DeprecateRenderBlock.prototype.transform = function DeprecateRenderBlock_transform(ast) {
|
11875
|
-
var moduleName = this.options.moduleName;
|
11876
|
-
var walker = new this.syntax.Walker();
|
11877
|
-
|
11878
|
-
walker.visit(ast, function (node) {
|
11879
|
-
if (!validate(node)) {
|
11880
|
-
return;
|
11881
|
-
}
|
11882
|
-
|
11883
|
-
_emberMetalDebug.deprecate(deprecationMessage(moduleName, node), false, {
|
11884
|
-
id: 'ember-template-compiler.deprecate-render-block',
|
11885
|
-
until: '2.4.0',
|
11886
|
-
url: 'http://emberjs.com/deprecations/v2.x#toc_render-helper-with-block'
|
11887
|
-
});
|
11888
|
-
});
|
11889
|
-
|
11890
|
-
return ast;
|
11891
|
-
};
|
11892
|
-
|
11893
|
-
function validate(node) {
|
11894
|
-
return node.type === 'BlockStatement' && node.path.original === 'render';
|
11895
|
-
}
|
11896
|
-
|
11897
|
-
function deprecationMessage(moduleName, node) {
|
11898
|
-
var sourceInformation = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc);
|
11899
|
-
|
11900
|
-
return 'Usage of `render` in block form is deprecated ' + sourceInformation + '.';
|
11901
|
-
}
|
11902
|
-
});
|
11903
11888
|
enifed('ember-template-compiler/plugins/transform-angle-bracket-components', ['exports'], function (exports) {
|
11904
11889
|
'use strict';
|
11905
11890
|
|
@@ -11933,88 +11918,6 @@ enifed('ember-template-compiler/plugins/transform-angle-bracket-components', ['e
|
|
11933
11918
|
|
11934
11919
|
exports.default = TransformAngleBracketComponents;
|
11935
11920
|
});
|
11936
|
-
enifed('ember-template-compiler/plugins/transform-closure-component-attrs-into-mut', ['exports'], function (exports) {
|
11937
|
-
'use strict';
|
11938
|
-
|
11939
|
-
function TransformClosureComponentAttrsIntoMut() {
|
11940
|
-
// set later within HTMLBars to the syntax package
|
11941
|
-
this.syntax = null;
|
11942
|
-
}
|
11943
|
-
|
11944
|
-
/**
|
11945
|
-
@private
|
11946
|
-
@method transform
|
11947
|
-
@param {AST} ast The AST to be transformed.
|
11948
|
-
*/
|
11949
|
-
TransformClosureComponentAttrsIntoMut.prototype.transform = function TransformClosureComponentAttrsIntoMut_transform(ast) {
|
11950
|
-
var b = this.syntax.builders;
|
11951
|
-
var walker = new this.syntax.Walker();
|
11952
|
-
|
11953
|
-
walker.visit(ast, function (node) {
|
11954
|
-
if (validate(node)) {
|
11955
|
-
processExpression(b, node);
|
11956
|
-
}
|
11957
|
-
});
|
11958
|
-
|
11959
|
-
return ast;
|
11960
|
-
};
|
11961
|
-
|
11962
|
-
function processExpression(builder, node) {
|
11963
|
-
processSubExpressionsInNode(builder, node);
|
11964
|
-
|
11965
|
-
if (isComponentClosure(node)) {
|
11966
|
-
mutParameters(builder, node);
|
11967
|
-
}
|
11968
|
-
}
|
11969
|
-
|
11970
|
-
function processSubExpressionsInNode(builder, node) {
|
11971
|
-
for (var i = 0; i < node.params.length; i++) {
|
11972
|
-
if (node.params[i].type === 'SubExpression') {
|
11973
|
-
processExpression(builder, node.params[i]);
|
11974
|
-
}
|
11975
|
-
}
|
11976
|
-
|
11977
|
-
each(node.hash.pairs, function (pair) {
|
11978
|
-
var value = pair.value;
|
11979
|
-
|
11980
|
-
if (value.type === 'SubExpression') {
|
11981
|
-
processExpression(builder, value);
|
11982
|
-
}
|
11983
|
-
});
|
11984
|
-
}
|
11985
|
-
|
11986
|
-
function isComponentClosure(node) {
|
11987
|
-
return node.type === 'SubExpression' && node.path.original === 'component';
|
11988
|
-
}
|
11989
|
-
|
11990
|
-
function mutParameters(builder, node) {
|
11991
|
-
for (var i = 1; i < node.params.length; i++) {
|
11992
|
-
if (node.params[i].type === 'PathExpression') {
|
11993
|
-
node.params[i] = builder.sexpr(builder.path('@mut'), [node.params[i]]);
|
11994
|
-
}
|
11995
|
-
}
|
11996
|
-
|
11997
|
-
each(node.hash.pairs, function (pair) {
|
11998
|
-
var value = pair.value;
|
11999
|
-
|
12000
|
-
if (value.type === 'PathExpression') {
|
12001
|
-
pair.value = builder.sexpr(builder.path('@mut'), [pair.value]);
|
12002
|
-
}
|
12003
|
-
});
|
12004
|
-
}
|
12005
|
-
|
12006
|
-
function validate(node) {
|
12007
|
-
return node.type === 'BlockStatement' || node.type === 'MustacheStatement';
|
12008
|
-
}
|
12009
|
-
|
12010
|
-
function each(list, callback) {
|
12011
|
-
for (var i = 0, l = list.length; i < l; i++) {
|
12012
|
-
callback(list[i]);
|
12013
|
-
}
|
12014
|
-
}
|
12015
|
-
|
12016
|
-
exports.default = TransformClosureComponentAttrsIntoMut;
|
12017
|
-
});
|
12018
11921
|
enifed('ember-template-compiler/plugins/transform-component-attrs-into-mut', ['exports'], function (exports) {
|
12019
11922
|
'use strict';
|
12020
11923
|
|
@@ -12110,75 +12013,6 @@ enifed('ember-template-compiler/plugins/transform-component-curly-to-readonly',
|
|
12110
12013
|
|
12111
12014
|
exports.default = TransformComponentCurlyToReadonly;
|
12112
12015
|
});
|
12113
|
-
enifed('ember-template-compiler/plugins/transform-each-in-to-hash', ['exports'], function (exports) {
|
12114
|
-
/**
|
12115
|
-
@module ember
|
12116
|
-
@submodule ember-htmlbars
|
12117
|
-
*/
|
12118
|
-
|
12119
|
-
/**
|
12120
|
-
An HTMLBars AST transformation that replaces all instances of
|
12121
|
-
|
12122
|
-
```handlebars
|
12123
|
-
{{#each item in items}}
|
12124
|
-
{{/each}}
|
12125
|
-
```
|
12126
|
-
|
12127
|
-
with
|
12128
|
-
|
12129
|
-
```handlebars
|
12130
|
-
{{#each items keyword="item"}}
|
12131
|
-
{{/each}}
|
12132
|
-
```
|
12133
|
-
|
12134
|
-
@class TransformEachInToHash
|
12135
|
-
@private
|
12136
|
-
*/
|
12137
|
-
'use strict';
|
12138
|
-
|
12139
|
-
function TransformEachInToHash(options) {
|
12140
|
-
// set later within HTMLBars to the syntax package
|
12141
|
-
this.syntax = null;
|
12142
|
-
this.options = options || {};
|
12143
|
-
}
|
12144
|
-
|
12145
|
-
/**
|
12146
|
-
@private
|
12147
|
-
@method transform
|
12148
|
-
@param {AST} ast The AST to be transformed.
|
12149
|
-
*/
|
12150
|
-
TransformEachInToHash.prototype.transform = function TransformEachInToHash_transform(ast) {
|
12151
|
-
var pluginContext = this;
|
12152
|
-
var walker = new pluginContext.syntax.Walker();
|
12153
|
-
var b = pluginContext.syntax.builders;
|
12154
|
-
|
12155
|
-
walker.visit(ast, function (node) {
|
12156
|
-
if (pluginContext.validate(node)) {
|
12157
|
-
if (node.program && node.program.blockParams.length) {
|
12158
|
-
throw new Error('You cannot use keyword (`{{each foo in bar}}`) and block params (`{{each bar as |foo|}}`) at the same time.');
|
12159
|
-
}
|
12160
|
-
|
12161
|
-
var removedParams = node.sexpr.params.splice(0, 2);
|
12162
|
-
var keyword = removedParams[0].original;
|
12163
|
-
|
12164
|
-
// TODO: This may not be necessary.
|
12165
|
-
if (!node.sexpr.hash) {
|
12166
|
-
node.sexpr.hash = b.hash();
|
12167
|
-
}
|
12168
|
-
|
12169
|
-
node.sexpr.hash.pairs.push(b.pair('keyword', b.string(keyword)));
|
12170
|
-
}
|
12171
|
-
});
|
12172
|
-
|
12173
|
-
return ast;
|
12174
|
-
};
|
12175
|
-
|
12176
|
-
TransformEachInToHash.prototype.validate = function TransformEachInToHash_validate(node) {
|
12177
|
-
return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.sexpr.path.original === 'each' && node.sexpr.params.length === 3 && node.sexpr.params[1].type === 'PathExpression' && node.sexpr.params[1].original === 'in';
|
12178
|
-
};
|
12179
|
-
|
12180
|
-
exports.default = TransformEachInToHash;
|
12181
|
-
});
|
12182
12016
|
enifed('ember-template-compiler/plugins/transform-each-into-collection', ['exports', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
12183
12017
|
'use strict';
|
12184
12018
|
|
@@ -12268,10 +12102,12 @@ enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent', ['export
|
|
12268
12102
|
@private
|
12269
12103
|
@class TransformInputOnToOnEvent
|
12270
12104
|
*/
|
12271
|
-
function TransformInputOnToOnEvent(
|
12105
|
+
function TransformInputOnToOnEvent() {
|
12106
|
+
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
12107
|
+
|
12272
12108
|
// set later within HTMLBars to the syntax package
|
12273
12109
|
this.syntax = null;
|
12274
|
-
this.options = options
|
12110
|
+
this.options = options;
|
12275
12111
|
}
|
12276
12112
|
|
12277
12113
|
/**
|
@@ -12620,7 +12456,7 @@ enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax', ['e
|
|
12620
12456
|
return segments;
|
12621
12457
|
}
|
12622
12458
|
});
|
12623
|
-
enifed('ember-template-compiler/plugins/transform-top-level-components', ['exports'
|
12459
|
+
enifed('ember-template-compiler/plugins/transform-top-level-components', ['exports'], function (exports) {
|
12624
12460
|
'use strict';
|
12625
12461
|
|
12626
12462
|
function TransformTopLevelComponents() {
|
@@ -12771,8 +12607,8 @@ enifed('ember-template-compiler/system/calculate-location-display', ['exports'],
|
|
12771
12607
|
|
12772
12608
|
exports.default = calculateLocationDisplay;
|
12773
12609
|
|
12774
|
-
function calculateLocationDisplay(moduleName
|
12775
|
-
var loc =
|
12610
|
+
function calculateLocationDisplay(moduleName) {
|
12611
|
+
var loc = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
12776
12612
|
|
12777
12613
|
var _ref = loc.start || {};
|
12778
12614
|
|
@@ -12834,7 +12670,7 @@ enifed('ember-template-compiler/system/compile', ['exports', 'require', 'ember-t
|
|
12834
12670
|
return _emberTemplateCompilerSystemTemplate.default(templateSpec);
|
12835
12671
|
};
|
12836
12672
|
});
|
12837
|
-
enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/
|
12673
|
+
enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/assign', 'ember-template-compiler/plugins'], function (exports, _emberMetalAssign, _emberTemplateCompilerPlugins) {
|
12838
12674
|
/**
|
12839
12675
|
@module ember
|
12840
12676
|
@submodule ember-template-compiler
|
@@ -12874,7 +12710,7 @@ enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-meta
|
|
12874
12710
|
options.buildMeta = function buildMeta(program) {
|
12875
12711
|
return {
|
12876
12712
|
fragmentReason: fragmentReason(program),
|
12877
|
-
revision: 'Ember@2.
|
12713
|
+
revision: 'Ember@2.5.0-beta.1',
|
12878
12714
|
loc: program.loc,
|
12879
12715
|
moduleName: options.moduleName
|
12880
12716
|
};
|