ember-source 2.11.3 → 2.12.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d901c12965c5d4de106da9ff28bd2d5a1b0dcc35
4
- data.tar.gz: 8aa863a4de7d4f775fa1f0fad33ccfceb60563a4
3
+ metadata.gz: a3a1dbced11e6d72e80b21b73ee727c4d324917c
4
+ data.tar.gz: 4d81efcdb70fbafa489b8df51c68c0862a3a19be
5
5
  SHA512:
6
- metadata.gz: 50bf25b89198a62a882ace88ebcbd17d7243c946f13a7918e5bdddffbca5390c2f2a366f9b142d0db9d97029198d39a9dcc6744299e4825dd2206c3f342b68e2
7
- data.tar.gz: 274d9be9e78ef5f4aa910dcda4dc5a139d604ad8ecedc99395a7807027b6398921ef9daaeca545cf1ccf077d0a0760d9e2335f84088f3d1fb20b69a900a855d0
6
+ metadata.gz: c03a38d1130701c83dcc9997a0b5beaf44abd965cde65035ac99195bd5e0beb5a08afde73ae60a09ec201c3c90d2456ed2b73060172ccd9e08a184d7b3a68aa9
7
+ data.tar.gz: a53efb30dbc11de167f6854456d820c27c4b056eb5032662491ceab19d4781ec66bde4a50bbff1609a4a9ef546472a27ae34328cefaf2c978578aab45d8e987a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.11.3
1
+ 2.12.0.beta.1
@@ -6,11 +6,10 @@
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.11.3
9
+ * @version 2.12.0-beta.1
10
10
  */
11
11
 
12
12
  var enifed, requireModule, Ember;
13
- var mainContext = this; // Used in ember-environment/lib/global.js
14
13
 
15
14
  (function() {
16
15
  var isNode = typeof window === 'undefined' &&
@@ -164,7 +163,7 @@ function defaults(obj, defaults) {
164
163
  return obj;
165
164
  }
166
165
 
167
- var babelHelpers = {
166
+ babelHelpers = {
168
167
  inherits: inherits,
169
168
  taggedTemplateLiteralLoose: taggedTemplateLiteralLoose,
170
169
  slice: Array.prototype.slice,
@@ -1188,13 +1187,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
1188
1187
 
1189
1188
  });
1190
1189
  enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) {
1190
+ /* globals Proxy */
1191
1191
  'use strict';
1192
1192
 
1193
+ var _Container$prototype;
1194
+
1193
1195
  exports.default = Container;
1194
1196
  exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations;
1195
1197
 
1196
1198
  var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE');
1199
+ var FACTORY_FOR = _emberUtils.symbol('FACTORY_FOR');
1200
+ exports.FACTORY_FOR = FACTORY_FOR;
1201
+ var LOOKUP_FACTORY = _emberUtils.symbol('LOOKUP_FACTORY');
1197
1202
 
1203
+ exports.LOOKUP_FACTORY = LOOKUP_FACTORY;
1198
1204
  /**
1199
1205
  A container used to instantiate and cache objects.
1200
1206
 
@@ -1220,7 +1226,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1220
1226
  this.isDestroyed = false;
1221
1227
  }
1222
1228
 
1223
- Container.prototype = {
1229
+ Container.prototype = (_Container$prototype = {
1224
1230
  /**
1225
1231
  @private
1226
1232
  @property owner
@@ -1305,57 +1311,150 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1305
1311
  */
1306
1312
  lookupFactory: function (fullName, options) {
1307
1313
  _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName));
1308
- return factoryFor(this, this.registry.normalize(fullName), options);
1309
- },
1310
1314
 
1315
+ _emberMetal.deprecate('Using "_lookupFactory" is deprecated. Please use container.factoryFor instead.', !_emberMetal.isFeatureEnabled('ember-factory-for'), { id: 'container-lookupFactory', until: '2.13.0', url: 'TODO' });
1316
+
1317
+ return deprecatedFactoryFor(this, this.registry.normalize(fullName), options);
1318
+ }
1319
+
1320
+ }, _Container$prototype[LOOKUP_FACTORY] = function (fullName, options) {
1321
+ _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName));
1322
+ return deprecatedFactoryFor(this, this.registry.normalize(fullName), options);
1323
+ }, _Container$prototype[FACTORY_FOR] = function (fullName) {
1324
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1325
+
1326
+ if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) {
1327
+ if (_emberMetal.isFeatureEnabled('ember-factory-for')) {
1328
+ return this.factoryFor(fullName, options);
1329
+ } else {
1330
+ /* This throws in case of a poorly designed build */
1331
+ throw new Error('If ember-no-double-extend is enabled, ember-factory-for must also be enabled');
1332
+ }
1333
+ }
1334
+ var factory = this[LOOKUP_FACTORY](fullName, options);
1335
+ if (factory === undefined) {
1336
+ return;
1337
+ }
1338
+ var manager = new DeprecatedFactoryManager(this, factory, fullName);
1339
+
1340
+ _emberMetal.runInDebug(function () {
1341
+ manager = wrapManagerInDeprecationProxy(manager);
1342
+ });
1343
+
1344
+ return manager;
1345
+ }, _Container$prototype.destroy = function () {
1346
+ eachDestroyable(this, function (item) {
1347
+ if (item.destroy) {
1348
+ item.destroy();
1349
+ }
1350
+ });
1351
+
1352
+ this.isDestroyed = true;
1353
+ }, _Container$prototype.reset = function (fullName) {
1354
+ if (arguments.length > 0) {
1355
+ resetMember(this, this.registry.normalize(fullName));
1356
+ } else {
1357
+ resetCache(this);
1358
+ }
1359
+ }, _Container$prototype.ownerInjection = function () {
1360
+ var _ref;
1361
+
1362
+ return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref;
1363
+ }, _Container$prototype);
1364
+
1365
+ /*
1366
+ * Wrap a factory manager in a proxy which will not permit properties to be
1367
+ * set on the manager.
1368
+ */
1369
+ function wrapManagerInDeprecationProxy(manager) {
1370
+ if (_emberUtils.HAS_NATIVE_PROXY) {
1371
+ var _ret = (function () {
1372
+ var validator = {
1373
+ get: function (obj, prop) {
1374
+ if (prop !== 'class' && prop !== 'create') {
1375
+ throw new Error('You attempted to access "' + prop + '" on a factory manager created by container#factoryFor. "' + prop + '" is not a member of a factory manager."');
1376
+ }
1377
+
1378
+ return obj[prop];
1379
+ },
1380
+ set: function (obj, prop, value) {
1381
+ throw new Error('You attempted to set "' + prop + '" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.');
1382
+ }
1383
+ };
1384
+
1385
+ // Note:
1386
+ // We have to proxy access to the manager here so that private property
1387
+ // access doesn't cause the above errors to occur.
1388
+ var m = manager;
1389
+ var proxiedManager = {
1390
+ class: m.class,
1391
+ create: function (props) {
1392
+ return m.create(props);
1393
+ }
1394
+ };
1395
+
1396
+ return {
1397
+ v: new Proxy(proxiedManager, validator)
1398
+ };
1399
+ })();
1400
+
1401
+ if (typeof _ret === 'object') return _ret.v;
1402
+ }
1403
+
1404
+ return manager;
1405
+ }
1406
+
1407
+ if (_emberMetal.isFeatureEnabled('ember-factory-for')) {
1311
1408
  /**
1312
- A depth first traversal, destroying the container, its descendant containers and all
1313
- their managed objects.
1314
- @private
1315
- @method destroy
1409
+ Given a fullName, return the corresponding factory. The consumer of the factory
1410
+ is responsible for the destruction of any factory instances, as there is no
1411
+ way for the container to ensure instances are destroyed when it itself is
1412
+ destroyed.
1413
+ @public
1414
+ @method factoryFor
1415
+ @param {String} fullName
1416
+ @param {Object} [options]
1417
+ @param {String} [options.source] The fullname of the request source (used for local lookup)
1418
+ @return {any}
1316
1419
  */
1317
- destroy: function () {
1318
- eachDestroyable(this, function (item) {
1319
- if (item.destroy) {
1320
- item.destroy();
1420
+ Container.prototype.factoryFor = function _factoryFor(fullName) {
1421
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1422
+
1423
+ var normalizedName = this.registry.normalize(fullName);
1424
+ _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(normalizedName));
1425
+
1426
+ if (options.source) {
1427
+ normalizedName = this.registry.expandLocalLookup(fullName, options);
1428
+ // if expandLocalLookup returns falsey, we do not support local lookup
1429
+ if (!normalizedName) {
1430
+ return;
1321
1431
  }
1322
- });
1432
+ }
1323
1433
 
1324
- this.isDestroyed = true;
1325
- },
1434
+ var factory = this.registry.resolve(normalizedName);
1326
1435
 
1327
- /**
1328
- Clear either the entire cache or just the cache for a particular key.
1329
- @private
1330
- @method reset
1331
- @param {String} fullName optional key to reset; if missing, resets everything
1332
- */
1333
- reset: function (fullName) {
1334
- if (arguments.length > 0) {
1335
- resetMember(this, this.registry.normalize(fullName));
1336
- } else {
1337
- resetCache(this);
1436
+ if (factory === undefined) {
1437
+ return;
1338
1438
  }
1339
- },
1340
1439
 
1341
- /**
1342
- Returns an object that can be used to provide an owner to a
1343
- manually created instance.
1344
- @private
1345
- @method ownerInjection
1346
- @returns { Object }
1347
- */
1348
- ownerInjection: function () {
1349
- var _ref;
1440
+ var manager = new FactoryManager(this, factory, fullName, normalizedName);
1350
1441
 
1351
- return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref;
1352
- }
1353
- };
1442
+ _emberMetal.runInDebug(function () {
1443
+ manager = wrapManagerInDeprecationProxy(manager);
1444
+ });
1445
+
1446
+ return manager;
1447
+ };
1448
+ }
1354
1449
 
1355
1450
  function isSingleton(container, fullName) {
1356
1451
  return container.registry.getOption(fullName, 'singleton') !== false;
1357
1452
  }
1358
1453
 
1454
+ function shouldInstantiate(container, fullName) {
1455
+ return container.registry.getOption(fullName, 'instantiate') !== false;
1456
+ }
1457
+
1359
1458
  function lookup(container, fullName) {
1360
1459
  var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
1361
1460
 
@@ -1372,17 +1471,76 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1372
1471
  return container.cache[fullName];
1373
1472
  }
1374
1473
 
1375
- var value = instantiate(container, fullName);
1474
+ if (_emberMetal.isFeatureEnabled('ember-factory-for')) {
1475
+ return instantiateFactory(container, fullName, options);
1476
+ } else {
1477
+ var factory = deprecatedFactoryFor(container, fullName);
1478
+ var value = instantiate(factory, {}, container, fullName);
1479
+
1480
+ if (value === undefined) {
1481
+ return;
1482
+ }
1376
1483
 
1377
- if (value === undefined) {
1484
+ if (isSingleton(container, fullName) && options.singleton !== false) {
1485
+ container.cache[fullName] = value;
1486
+ }
1487
+
1488
+ return value;
1489
+ }
1490
+ }
1491
+
1492
+ function isSingletonClass(container, fullName, _ref2) {
1493
+ var instantiate = _ref2.instantiate;
1494
+ var singleton = _ref2.singleton;
1495
+
1496
+ return singleton !== false && isSingleton(container, fullName) && !instantiate && !shouldInstantiate(container, fullName);
1497
+ }
1498
+
1499
+ function isSingletonInstance(container, fullName, _ref3) {
1500
+ var instantiate = _ref3.instantiate;
1501
+ var singleton = _ref3.singleton;
1502
+
1503
+ return singleton !== false && isSingleton(container, fullName) && instantiate !== false && shouldInstantiate(container, fullName);
1504
+ }
1505
+
1506
+ function isFactoryClass(container, fullname, _ref4) {
1507
+ var instantiate = _ref4.instantiate;
1508
+ var singleton = _ref4.singleton;
1509
+
1510
+ return (singleton === false || !isSingleton(container, fullname)) && instantiate === false && !shouldInstantiate(container, fullname);
1511
+ }
1512
+
1513
+ function isFactoryInstance(container, fullName, _ref5) {
1514
+ var instantiate = _ref5.instantiate;
1515
+ var singleton = _ref5.singleton;
1516
+
1517
+ return (singleton !== false || isSingleton(container, fullName)) && instantiate !== false && shouldInstantiate(container, fullName);
1518
+ }
1519
+
1520
+ function instantiateFactory(container, fullName, options) {
1521
+ var factoryManager = container[FACTORY_FOR](fullName);
1522
+
1523
+ if (factoryManager === undefined) {
1378
1524
  return;
1379
1525
  }
1380
1526
 
1381
- if (isSingleton(container, fullName) && options.singleton !== false) {
1382
- container.cache[fullName] = value;
1527
+ // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {}
1528
+ // By default majority of objects fall into this case
1529
+ if (isSingletonInstance(container, fullName, options)) {
1530
+ return container.cache[fullName] = factoryManager.create();
1383
1531
  }
1384
1532
 
1385
- return value;
1533
+ // SomeClass { singleton: false, instantiate: true }
1534
+ if (isFactoryInstance(container, fullName, options)) {
1535
+ return factoryManager.create();
1536
+ }
1537
+
1538
+ // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false }
1539
+ if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) {
1540
+ return factoryManager.class;
1541
+ }
1542
+
1543
+ throw new Error('Could not create factory');
1386
1544
  }
1387
1545
 
1388
1546
  function markInjectionsAsDynamic(injections) {
@@ -1421,14 +1579,13 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1421
1579
  return hash;
1422
1580
  }
1423
1581
 
1424
- function factoryFor(container, fullName) {
1582
+ function deprecatedFactoryFor(container, fullName) {
1425
1583
  var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
1426
1584
 
1427
1585
  var registry = container.registry;
1428
1586
 
1429
1587
  if (options.source) {
1430
1588
  fullName = registry.expandLocalLookup(fullName, options);
1431
-
1432
1589
  // if expandLocalLookup returns falsey, we do not support local lookup
1433
1590
  if (!fullName) {
1434
1591
  return;
@@ -1492,22 +1649,12 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1492
1649
  return injections;
1493
1650
  }
1494
1651
 
1495
- function factoryInjectionsFor(container, fullName) {
1496
- var registry = container.registry;
1497
- var splitName = fullName.split(':');
1498
- var type = splitName[0];
1499
-
1500
- var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName));
1501
- factoryInjections._debugContainerKey = fullName;
1502
-
1503
- return factoryInjections;
1504
- }
1505
-
1506
- function instantiate(container, fullName) {
1507
- var factory = factoryFor(container, fullName);
1652
+ function instantiate(factory, props, container, fullName) {
1508
1653
  var lazyInjections = undefined,
1509
1654
  validationCache = undefined;
1510
1655
 
1656
+ props = props || {};
1657
+
1511
1658
  if (container.registry.getOption(fullName, 'instantiate') === false) {
1512
1659
  return factory;
1513
1660
  }
@@ -1535,7 +1682,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1535
1682
 
1536
1683
  if (typeof factory.extend === 'function') {
1537
1684
  // assume the factory was extendable and is already injected
1538
- obj = factory.create();
1685
+ obj = factory.create(props);
1539
1686
  } else {
1540
1687
  // assume the factory was extendable
1541
1688
  // to create time injections
@@ -1547,7 +1694,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1547
1694
  // This "fake" container will be replaced after instantiation with a
1548
1695
  // property that raises deprecations every time it is accessed.
1549
1696
  injections.container = container._fakeContainerToInject;
1550
- obj = factory.create(injections);
1697
+ obj = factory.create(_emberUtils.assign({}, injections, props));
1551
1698
 
1552
1699
  // TODO - remove when Ember reaches v3.0.0
1553
1700
  if (!Object.isFrozen(obj) && 'container' in obj) {
@@ -1559,6 +1706,17 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1559
1706
  }
1560
1707
  }
1561
1708
 
1709
+ function factoryInjectionsFor(container, fullName) {
1710
+ var registry = container.registry;
1711
+ var splitName = fullName.split(':');
1712
+ var type = splitName[0];
1713
+
1714
+ var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName));
1715
+ factoryInjections._debugContainerKey = fullName;
1716
+
1717
+ return factoryInjections;
1718
+ }
1719
+
1562
1720
  // TODO - remove when Ember reaches v3.0.0
1563
1721
  function injectDeprecatedContainer(object, container) {
1564
1722
  Object.defineProperty(object, 'container', {
@@ -1641,7 +1799,98 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e
1641
1799
  return container[containerProperty].apply(container, arguments);
1642
1800
  };
1643
1801
  }
1802
+
1803
+ var DeprecatedFactoryManager = (function () {
1804
+ function DeprecatedFactoryManager(container, factory, fullName) {
1805
+ this.container = container;
1806
+ this.class = factory;
1807
+ this.fullName = fullName;
1808
+ }
1809
+
1810
+ DeprecatedFactoryManager.prototype.create = function create() {
1811
+ var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
1812
+
1813
+ return instantiate(this.class, props, this.container, this.fullName);
1814
+ };
1815
+
1816
+ return DeprecatedFactoryManager;
1817
+ })();
1818
+
1819
+ var FactoryManager = (function () {
1820
+ function FactoryManager(container, factory, fullName, normalizedName) {
1821
+ this.container = container;
1822
+ this.class = factory;
1823
+ this.fullName = fullName;
1824
+ this.normalizedName = normalizedName;
1825
+ }
1826
+
1827
+ FactoryManager.prototype.create = function create() {
1828
+ var _this = this;
1829
+
1830
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
1831
+
1832
+ var injections = injectionsFor(this.container, this.normalizedName);
1833
+ var props = _emberUtils.assign({}, injections, options);
1834
+
1835
+ props[_emberUtils.NAME_KEY] = this.container.registry.makeToString(this.class, this.fullName);
1836
+
1837
+ _emberMetal.runInDebug(function () {
1838
+ var lazyInjections = undefined;
1839
+ var validationCache = _this.container.validationCache;
1840
+ // Ensure that all lazy injections are valid at instantiation time
1841
+ if (!validationCache[_this.fullName] && _this.class && typeof _this.class._lazyInjections === 'function') {
1842
+ lazyInjections = _this.class._lazyInjections();
1843
+ lazyInjections = _this.container.registry.normalizeInjectionsHash(lazyInjections);
1844
+
1845
+ _this.container.registry.validateInjections(lazyInjections);
1846
+ }
1847
+
1848
+ validationCache[_this.fullName] = true;
1849
+ });
1850
+
1851
+ if (!this.class.create) {
1852
+ throw new Error('Failed to create an instance of \'' + this.normalizedName + '\'. Most likely an improperly defined class or' + ' an invalid module export.');
1853
+ }
1854
+
1855
+ if (this.class.prototype) {
1856
+ injectDeprecatedContainer(this.class.prototype, this.container);
1857
+ }
1858
+
1859
+ return this.class.create(props);
1860
+ };
1861
+
1862
+ return FactoryManager;
1863
+ })();
1644
1864
  });
1865
+
1866
+ /*
1867
+ * This internal version of factoryFor swaps between the public API for
1868
+ * factoryFor (class is the registered class) and a transition implementation
1869
+ * (class is the double-extended class). It is *not* the public API version
1870
+ * of factoryFor, which always returns the registered class.
1871
+ */
1872
+
1873
+ /**
1874
+ A depth first traversal, destroying the container, its descendant containers and all
1875
+ their managed objects.
1876
+ @private
1877
+ @method destroy
1878
+ */
1879
+
1880
+ /**
1881
+ Clear either the entire cache or just the cache for a particular key.
1882
+ @private
1883
+ @method reset
1884
+ @param {String} fullName optional key to reset; if missing, resets everything
1885
+ */
1886
+
1887
+ /**
1888
+ Returns an object that can be used to provide an owner to a
1889
+ manually created instance.
1890
+ @private
1891
+ @method ownerInjection
1892
+ @returns { Object }
1893
+ */
1645
1894
  enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _containerRegistry, _containerContainer) {
1646
1895
  /*
1647
1896
  Public API for the container is still in flux.
@@ -1656,6 +1905,8 @@ enifed('container/index', ['exports', 'container/registry', 'container/container
1656
1905
  exports.privatize = _containerRegistry.privatize;
1657
1906
  exports.Container = _containerContainer.default;
1658
1907
  exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations;
1908
+ exports.FACTORY_FOR = _containerContainer.FACTORY_FOR;
1909
+ exports.LOOKUP_FACTORY = _containerContainer.LOOKUP_FACTORY;
1659
1910
  });
1660
1911
  enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) {
1661
1912
  'use strict';
@@ -2784,7 +3035,6 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb
2784
3035
  'use strict';
2785
3036
 
2786
3037
  exports.default = alias;
2787
- exports.AliasedProperty = AliasedProperty;
2788
3038
 
2789
3039
  var CONSUMED = {};
2790
3040
 
@@ -2792,66 +3042,73 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb
2792
3042
  return new AliasedProperty(altKey);
2793
3043
  }
2794
3044
 
2795
- function AliasedProperty(altKey) {
2796
- this.isDescriptor = true;
2797
- this.altKey = altKey;
2798
- this._dependentKeys = [altKey];
2799
- }
2800
-
2801
- AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype);
3045
+ var AliasedProperty = (function (_Descriptor) {
3046
+ babelHelpers.inherits(AliasedProperty, _Descriptor);
2802
3047
 
2803
- AliasedProperty.prototype.setup = function (obj, keyName) {
2804
- _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName);
2805
- var meta = _emberMetalMeta.meta(obj);
2806
- if (meta.peekWatching(keyName)) {
2807
- _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta);
3048
+ function AliasedProperty(altKey) {
3049
+ _Descriptor.call(this);
3050
+ this.isDescriptor = true;
3051
+ this.altKey = altKey;
3052
+ this._dependentKeys = [altKey];
2808
3053
  }
2809
- };
2810
3054
 
2811
- AliasedProperty.prototype.teardown = function (obj, keyName) {
2812
- var meta = _emberMetalMeta.meta(obj);
2813
- if (meta.peekWatching(keyName)) {
2814
- _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta);
2815
- }
2816
- };
3055
+ AliasedProperty.prototype.setup = function setup(obj, keyName) {
3056
+ _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName);
3057
+ var meta = _emberMetalMeta.meta(obj);
3058
+ if (meta.peekWatching(keyName)) {
3059
+ _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta);
3060
+ }
3061
+ };
2817
3062
 
2818
- AliasedProperty.prototype.willWatch = function (obj, keyName) {
2819
- _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj));
2820
- };
3063
+ AliasedProperty.prototype.teardown = function teardown(obj, keyName) {
3064
+ var meta = _emberMetalMeta.meta(obj);
3065
+ if (meta.peekWatching(keyName)) {
3066
+ _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta);
3067
+ }
3068
+ };
2821
3069
 
2822
- AliasedProperty.prototype.didUnwatch = function (obj, keyName) {
2823
- _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj));
2824
- };
3070
+ AliasedProperty.prototype.willWatch = function willWatch(obj, keyName) {
3071
+ _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj));
3072
+ };
2825
3073
 
2826
- AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) {
2827
- var ret = _emberMetalProperty_get.get(obj, this.altKey);
2828
- var meta = _emberMetalMeta.meta(obj);
2829
- var cache = meta.writableCache();
2830
- if (cache[keyName] !== CONSUMED) {
2831
- cache[keyName] = CONSUMED;
2832
- _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta);
2833
- }
2834
- return ret;
2835
- };
3074
+ AliasedProperty.prototype.didUnwatch = function didUnwatch(obj, keyName) {
3075
+ _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj));
3076
+ };
2836
3077
 
2837
- AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) {
2838
- return _emberMetalProperty_set.set(obj, this.altKey, value);
2839
- };
3078
+ AliasedProperty.prototype.get = function get(obj, keyName) {
3079
+ var ret = _emberMetalProperty_get.get(obj, this.altKey);
3080
+ var meta = _emberMetalMeta.meta(obj);
3081
+ var cache = meta.writableCache();
3082
+ if (cache[keyName] !== CONSUMED) {
3083
+ cache[keyName] = CONSUMED;
3084
+ _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta);
3085
+ }
3086
+ return ret;
3087
+ };
2840
3088
 
2841
- AliasedProperty.prototype.readOnly = function () {
2842
- this.set = AliasedProperty_readOnlySet;
2843
- return this;
2844
- };
3089
+ AliasedProperty.prototype.set = function set(obj, keyName, value) {
3090
+ return _emberMetalProperty_set.set(obj, this.altKey, value);
3091
+ };
3092
+
3093
+ AliasedProperty.prototype.readOnly = function readOnly() {
3094
+ this.set = AliasedProperty_readOnlySet;
3095
+ return this;
3096
+ };
3097
+
3098
+ AliasedProperty.prototype.oneWay = function oneWay() {
3099
+ this.set = AliasedProperty_oneWaySet;
3100
+ return this;
3101
+ };
3102
+
3103
+ return AliasedProperty;
3104
+ })(_emberMetalProperties.Descriptor);
3105
+
3106
+ exports.AliasedProperty = AliasedProperty;
2845
3107
 
2846
3108
  function AliasedProperty_readOnlySet(obj, keyName, value) {
2847
3109
  throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj));
2848
3110
  }
2849
3111
 
2850
- AliasedProperty.prototype.oneWay = function () {
2851
- this.set = AliasedProperty_oneWaySet;
2852
- return this;
2853
- };
2854
-
2855
3112
  function AliasedProperty_oneWaySet(obj, keyName, value) {
2856
3113
  _emberMetalProperties.defineProperty(obj, keyName, null);
2857
3114
  return _emberMetalProperty_set.set(obj, keyName, value);
@@ -2875,41 +3132,42 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
2875
3132
  // BINDING
2876
3133
  //
2877
3134
 
2878
- function Binding(toPath, fromPath) {
2879
- // Configuration
2880
- this._from = fromPath;
2881
- this._to = toPath;
2882
- this._oneWay = undefined;
3135
+ var Binding = (function () {
3136
+ function Binding(toPath, fromPath) {
3137
+ // Configuration
3138
+ this._from = fromPath;
3139
+ this._to = toPath;
3140
+ this._oneWay = undefined;
2883
3141
 
2884
- // State
2885
- this._direction = undefined;
2886
- this._readyToSync = undefined;
2887
- this._fromObj = undefined;
2888
- this._fromPath = undefined;
2889
- this._toObj = undefined;
2890
- }
3142
+ // State
3143
+ this._direction = undefined;
3144
+ this._readyToSync = undefined;
3145
+ this._fromObj = undefined;
3146
+ this._fromPath = undefined;
3147
+ this._toObj = undefined;
3148
+ }
2891
3149
 
2892
- /**
2893
- @class Binding
2894
- @namespace Ember
2895
- @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding
2896
- @public
2897
- */
3150
+ /**
3151
+ @class Binding
3152
+ @namespace Ember
3153
+ @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding
3154
+ @public
3155
+ */
2898
3156
 
2899
- Binding.prototype = {
2900
3157
  /**
2901
3158
  This copies the Binding so it can be connected to another object.
2902
3159
  @method copy
2903
3160
  @return {Ember.Binding} `this`
2904
3161
  @public
2905
3162
  */
2906
- copy: function () {
3163
+
3164
+ Binding.prototype.copy = function copy() {
2907
3165
  var copy = new Binding(this._to, this._from);
2908
3166
  if (this._oneWay) {
2909
3167
  copy._oneWay = true;
2910
3168
  }
2911
3169
  return copy;
2912
- },
3170
+ };
2913
3171
 
2914
3172
  // ..........................................................
2915
3173
  // CONFIG
@@ -2927,10 +3185,11 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
2927
3185
  @return {Ember.Binding} `this`
2928
3186
  @public
2929
3187
  */
2930
- from: function (path) {
3188
+
3189
+ Binding.prototype.from = function from(path) {
2931
3190
  this._from = path;
2932
3191
  return this;
2933
- },
3192
+ };
2934
3193
 
2935
3194
  /**
2936
3195
  This will set the `to` property path to the specified value. It will not
@@ -2944,10 +3203,11 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
2944
3203
  @return {Ember.Binding} `this`
2945
3204
  @public
2946
3205
  */
2947
- to: function (path) {
3206
+
3207
+ Binding.prototype.to = function to(path) {
2948
3208
  this._to = path;
2949
3209
  return this;
2950
- },
3210
+ };
2951
3211
 
2952
3212
  /**
2953
3213
  Configures the binding as one way. A one-way binding will relay changes
@@ -2958,20 +3218,22 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
2958
3218
  @return {Ember.Binding} `this`
2959
3219
  @public
2960
3220
  */
2961
- oneWay: function () {
3221
+
3222
+ Binding.prototype.oneWay = function oneWay() {
2962
3223
  this._oneWay = true;
2963
3224
  return this;
2964
- },
3225
+ };
2965
3226
 
2966
3227
  /**
2967
3228
  @method toString
2968
3229
  @return {String} string representation of binding
2969
3230
  @public
2970
3231
  */
2971
- toString: function () {
3232
+
3233
+ Binding.prototype.toString = function toString() {
2972
3234
  var oneWay = this._oneWay ? '[oneWay]' : '';
2973
3235
  return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay;
2974
- },
3236
+ };
2975
3237
 
2976
3238
  // ..........................................................
2977
3239
  // CONNECT AND SYNC
@@ -2986,7 +3248,8 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
2986
3248
  @return {Ember.Binding} `this`
2987
3249
  @public
2988
3250
  */
2989
- connect: function (obj) {
3251
+
3252
+ Binding.prototype.connect = function connect(obj) {
2990
3253
  _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
2991
3254
 
2992
3255
  var fromObj = undefined,
@@ -3030,7 +3293,7 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
3030
3293
  this._toObj = obj;
3031
3294
 
3032
3295
  return this;
3033
- },
3296
+ };
3034
3297
 
3035
3298
  /**
3036
3299
  Disconnects the binding instance. Changes will no longer be relayed. You
@@ -3039,7 +3302,8 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
3039
3302
  @return {Ember.Binding} `this`
3040
3303
  @public
3041
3304
  */
3042
- disconnect: function () {
3305
+
3306
+ Binding.prototype.disconnect = function disconnect() {
3043
3307
  _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj);
3044
3308
 
3045
3309
  // Remove an observer on the object so we're no longer notified of
@@ -3053,23 +3317,25 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
3053
3317
 
3054
3318
  this._readyToSync = false; // Disable scheduled syncs...
3055
3319
  return this;
3056
- },
3320
+ };
3057
3321
 
3058
3322
  // ..........................................................
3059
3323
  // PRIVATE
3060
3324
  //
3061
3325
 
3062
3326
  /* Called when the from side changes. */
3063
- fromDidChange: function (target) {
3327
+
3328
+ Binding.prototype.fromDidChange = function fromDidChange(target) {
3064
3329
  this._scheduleSync('fwd');
3065
- },
3330
+ };
3066
3331
 
3067
3332
  /* Called when the to side changes. */
3068
- toDidChange: function (target) {
3333
+
3334
+ Binding.prototype.toDidChange = function toDidChange(target) {
3069
3335
  this._scheduleSync('back');
3070
- },
3336
+ };
3071
3337
 
3072
- _scheduleSync: function (dir) {
3338
+ Binding.prototype._scheduleSync = function _scheduleSync(dir) {
3073
3339
  var existingDir = this._direction;
3074
3340
 
3075
3341
  // If we haven't scheduled the binding yet, schedule it.
@@ -3083,9 +3349,11 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
3083
3349
  if (existingDir === 'back' && dir === 'fwd') {
3084
3350
  this._direction = 'fwd';
3085
3351
  }
3086
- },
3352
+ };
3353
+
3354
+ Binding.prototype._sync = function _sync() {
3355
+ var _this = this;
3087
3356
 
3088
- _sync: function () {
3089
3357
  var log = _emberEnvironment.ENV.LOG_BINDINGS;
3090
3358
 
3091
3359
  var toObj = this._toObj;
@@ -3106,30 +3374,35 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember
3106
3374
 
3107
3375
  // If we're synchronizing from the remote object...
3108
3376
  if (direction === 'fwd') {
3109
- var fromValue = _emberMetalProperty_get.get(fromObj, fromPath);
3110
- if (log) {
3111
- _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj);
3112
- }
3113
- if (this._oneWay) {
3114
- _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
3115
- } else {
3116
- _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () {
3117
- _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
3118
- });
3119
- }
3120
- // If we're synchronizing *to* the remote object.
3121
- } else if (direction === 'back') {
3122
- var toValue = _emberMetalProperty_get.get(toObj, this._to);
3377
+ (function () {
3378
+ var fromValue = _emberMetalProperty_get.get(fromObj, fromPath);
3123
3379
  if (log) {
3124
- _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj);
3380
+ _emberConsole.default.log(' ', _this.toString(), '->', fromValue, fromObj);
3125
3381
  }
3126
- _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () {
3127
- _emberMetalProperty_set.trySet(fromObj, fromPath, toValue);
3128
- });
3382
+ if (_this._oneWay) {
3383
+ _emberMetalProperty_set.trySet(toObj, _this._to, fromValue);
3384
+ } else {
3385
+ _emberMetalObserver._suspendObserver(toObj, _this._to, _this, 'toDidChange', function () {
3386
+ _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
3387
+ });
3388
+ }
3389
+ // If we're synchronizing *to* the remote object.
3390
+ })();
3391
+ } else if (direction === 'back') {
3392
+ (function () {
3393
+ var toValue = _emberMetalProperty_get.get(toObj, _this._to);
3394
+ if (log) {
3395
+ _emberConsole.default.log(' ', _this.toString(), '<-', toValue, toObj);
3396
+ }
3397
+ _emberMetalObserver._suspendObserver(fromObj, fromPath, _this, 'fromDidChange', function () {
3398
+ _emberMetalProperty_set.trySet(fromObj, fromPath, toValue);
3399
+ });
3400
+ })();
3129
3401
  }
3130
- }
3402
+ };
3131
3403
 
3132
- };
3404
+ return Binding;
3405
+ })();
3133
3406
 
3134
3407
  function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) {
3135
3408
  var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.';
@@ -3437,24 +3710,24 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3437
3710
  return !(isObject(obj) && obj.isDescriptor && obj._volatile === false);
3438
3711
  }
3439
3712
 
3440
- function ChainWatchers() {
3441
- // chain nodes that reference a key in this obj by key
3442
- // we only create ChainWatchers when we are going to add them
3443
- // so create this upfront
3444
- this.chains = new _emberUtils.EmptyObject();
3445
- }
3713
+ var ChainWatchers = (function () {
3714
+ function ChainWatchers() {
3715
+ // chain nodes that reference a key in this obj by key
3716
+ // we only create ChainWatchers when we are going to add them
3717
+ // so create this upfront
3718
+ this.chains = new _emberUtils.EmptyObject();
3719
+ }
3446
3720
 
3447
- ChainWatchers.prototype = {
3448
- add: function (key, node) {
3721
+ ChainWatchers.prototype.add = function add(key, node) {
3449
3722
  var nodes = this.chains[key];
3450
3723
  if (nodes === undefined) {
3451
3724
  this.chains[key] = [node];
3452
3725
  } else {
3453
3726
  nodes.push(node);
3454
3727
  }
3455
- },
3728
+ };
3456
3729
 
3457
- remove: function (key, node) {
3730
+ ChainWatchers.prototype.remove = function remove(key, node) {
3458
3731
  var nodes = this.chains[key];
3459
3732
  if (nodes) {
3460
3733
  for (var i = 0; i < nodes.length; i++) {
@@ -3464,9 +3737,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3464
3737
  }
3465
3738
  }
3466
3739
  }
3467
- },
3740
+ };
3468
3741
 
3469
- has: function (key, node) {
3742
+ ChainWatchers.prototype.has = function has(key, node) {
3470
3743
  var nodes = this.chains[key];
3471
3744
  if (nodes) {
3472
3745
  for (var i = 0; i < nodes.length; i++) {
@@ -3476,24 +3749,25 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3476
3749
  }
3477
3750
  }
3478
3751
  return false;
3479
- },
3752
+ };
3480
3753
 
3481
- revalidateAll: function () {
3754
+ ChainWatchers.prototype.revalidateAll = function revalidateAll() {
3482
3755
  for (var key in this.chains) {
3483
3756
  this.notify(key, true, undefined);
3484
3757
  }
3485
- },
3758
+ };
3486
3759
 
3487
- revalidate: function (key) {
3760
+ ChainWatchers.prototype.revalidate = function revalidate(key) {
3488
3761
  this.notify(key, true, undefined);
3489
- },
3762
+ };
3490
3763
 
3491
3764
  // key: the string key that is part of a path changed
3492
3765
  // revalidate: boolean; the chains that are watching this value should revalidate
3493
3766
  // callback: function that will be called with the object and path that
3494
3767
  // will be/are invalidated by this key change, depending on
3495
3768
  // whether the revalidate flag is passed
3496
- notify: function (key, revalidate, callback) {
3769
+
3770
+ ChainWatchers.prototype.notify = function notify(key, revalidate, callback) {
3497
3771
  var nodes = this.chains[key];
3498
3772
  if (nodes === undefined || nodes.length === 0) {
3499
3773
  return;
@@ -3519,8 +3793,10 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3519
3793
  var path = affected[i + 1];
3520
3794
  callback(obj, path);
3521
3795
  }
3522
- }
3523
- };
3796
+ };
3797
+
3798
+ return ChainWatchers;
3799
+ })();
3524
3800
 
3525
3801
  function makeChainWatcher() {
3526
3802
  return new ChainWatchers();
@@ -3554,71 +3830,48 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3554
3830
  // A ChainNode watches a single key on an object. If you provide a starting
3555
3831
  // value for the key then the node won't actually watch it. For a root node
3556
3832
  // pass null for parent and key and object for value.
3557
- function ChainNode(parent, key, value) {
3558
- this._parent = parent;
3559
- this._key = key;
3560
-
3561
- // _watching is true when calling get(this._parent, this._key) will
3562
- // return the value of this node.
3563
- //
3564
- // It is false for the root of a chain (because we have no parent)
3565
- // and for global paths (because the parent node is the object with
3566
- // the observer on it)
3567
- this._watching = value === undefined;
3568
-
3569
- this._chains = undefined;
3570
- this._object = undefined;
3571
- this.count = 0;
3572
-
3573
- this._value = value;
3574
- this._paths = {};
3575
- if (this._watching) {
3576
- var obj = parent.value();
3577
3833
 
3578
- if (!isObject(obj)) {
3579
- return;
3580
- }
3834
+ var ChainNode = (function () {
3835
+ function ChainNode(parent, key, value) {
3836
+ this._parent = parent;
3837
+ this._key = key;
3581
3838
 
3582
- this._object = obj;
3839
+ // _watching is true when calling get(this._parent, this._key) will
3840
+ // return the value of this node.
3841
+ //
3842
+ // It is false for the root of a chain (because we have no parent)
3843
+ // and for global paths (because the parent node is the object with
3844
+ // the observer on it)
3845
+ this._watching = value === undefined;
3583
3846
 
3584
- addChainWatcher(this._object, this._key, this);
3585
- }
3586
- }
3847
+ this._chains = undefined;
3848
+ this._object = undefined;
3849
+ this.count = 0;
3587
3850
 
3588
- function lazyGet(obj, key) {
3589
- if (!isObject(obj)) {
3590
- return;
3591
- }
3851
+ this._value = value;
3852
+ this._paths = {};
3853
+ if (this._watching) {
3854
+ var obj = parent.value();
3592
3855
 
3593
- var meta = _emberMetalMeta.peekMeta(obj);
3856
+ if (!isObject(obj)) {
3857
+ return;
3858
+ }
3594
3859
 
3595
- // check if object meant only to be a prototype
3596
- if (meta && meta.proto === obj) {
3597
- return;
3598
- }
3860
+ this._object = obj;
3599
3861
 
3600
- // Use `get` if the return value is an EachProxy or an uncacheable value.
3601
- if (isVolatile(obj[key])) {
3602
- return _emberMetalProperty_get.get(obj, key);
3603
- // Otherwise attempt to get the cached value of the computed property
3604
- } else {
3605
- var cache = meta.readableCache();
3606
- if (cache) {
3607
- return _emberMetalComputed.cacheFor.get(cache, key);
3608
- }
3862
+ addChainWatcher(this._object, this._key, this);
3609
3863
  }
3610
- }
3864
+ }
3611
3865
 
3612
- ChainNode.prototype = {
3613
- value: function () {
3866
+ ChainNode.prototype.value = function value() {
3614
3867
  if (this._value === undefined && this._watching) {
3615
3868
  var obj = this._parent.value();
3616
3869
  this._value = lazyGet(obj, this._key);
3617
3870
  }
3618
3871
  return this._value;
3619
- },
3872
+ };
3620
3873
 
3621
- destroy: function () {
3874
+ ChainNode.prototype.destroy = function destroy() {
3622
3875
  if (this._watching) {
3623
3876
  var obj = this._object;
3624
3877
  if (obj) {
@@ -3626,10 +3879,11 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3626
3879
  }
3627
3880
  this._watching = false; // so future calls do nothing
3628
3881
  }
3629
- },
3882
+ };
3630
3883
 
3631
3884
  // copies a top level object only
3632
- copy: function (obj) {
3885
+
3886
+ ChainNode.prototype.copy = function copy(obj) {
3633
3887
  var ret = new ChainNode(null, null, obj);
3634
3888
  var paths = this._paths;
3635
3889
  var path = undefined;
@@ -3642,11 +3896,12 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3642
3896
  ret.add(path);
3643
3897
  }
3644
3898
  return ret;
3645
- },
3899
+ };
3646
3900
 
3647
3901
  // called on the root node of a chain to setup watchers on the specified
3648
3902
  // path.
3649
- add: function (path) {
3903
+
3904
+ ChainNode.prototype.add = function add(path) {
3650
3905
  var paths = this._paths;
3651
3906
  paths[path] = (paths[path] || 0) + 1;
3652
3907
 
@@ -3654,11 +3909,12 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3654
3909
  var tail = path.slice(key.length + 1);
3655
3910
 
3656
3911
  this.chain(key, tail);
3657
- },
3912
+ };
3658
3913
 
3659
3914
  // called on the root node of a chain to teardown watcher on the specified
3660
3915
  // path
3661
- remove: function (path) {
3916
+
3917
+ ChainNode.prototype.remove = function remove(path) {
3662
3918
  var paths = this._paths;
3663
3919
  if (paths[path] > 0) {
3664
3920
  paths[path]--;
@@ -3668,9 +3924,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3668
3924
  var tail = path.slice(key.length + 1);
3669
3925
 
3670
3926
  this.unchain(key, tail);
3671
- },
3927
+ };
3672
3928
 
3673
- chain: function (key, path) {
3929
+ ChainNode.prototype.chain = function chain(key, path) {
3674
3930
  var chains = this._chains;
3675
3931
  var node = undefined;
3676
3932
  if (chains === undefined) {
@@ -3691,9 +3947,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3691
3947
  path = path.slice(key.length + 1);
3692
3948
  node.chain(key, path);
3693
3949
  }
3694
- },
3950
+ };
3695
3951
 
3696
- unchain: function (key, path) {
3952
+ ChainNode.prototype.unchain = function unchain(key, path) {
3697
3953
  var chains = this._chains;
3698
3954
  var node = chains[key];
3699
3955
 
@@ -3710,9 +3966,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3710
3966
  chains[node._key] = undefined;
3711
3967
  node.destroy();
3712
3968
  }
3713
- },
3969
+ };
3714
3970
 
3715
- notify: function (revalidate, affected) {
3971
+ ChainNode.prototype.notify = function notify(revalidate, affected) {
3716
3972
  if (revalidate && this._watching) {
3717
3973
  var parentValue = this._parent.value();
3718
3974
 
@@ -3746,9 +4002,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3746
4002
  if (affected && this._parent) {
3747
4003
  this._parent.populateAffected(this._key, 1, affected);
3748
4004
  }
3749
- },
4005
+ };
3750
4006
 
3751
- populateAffected: function (path, depth, affected) {
4007
+ ChainNode.prototype.populateAffected = function populateAffected(path, depth, affected) {
3752
4008
  if (this._key) {
3753
4009
  path = this._key + '.' + path;
3754
4010
  }
@@ -3760,8 +4016,34 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge
3760
4016
  affected.push(this.value(), path);
3761
4017
  }
3762
4018
  }
4019
+ };
4020
+
4021
+ return ChainNode;
4022
+ })();
4023
+
4024
+ function lazyGet(obj, key) {
4025
+ if (!isObject(obj)) {
4026
+ return;
4027
+ }
4028
+
4029
+ var meta = _emberMetalMeta.peekMeta(obj);
4030
+
4031
+ // check if object meant only to be a prototype
4032
+ if (meta && meta.proto === obj) {
4033
+ return;
3763
4034
  }
3764
- };
4035
+
4036
+ // Use `get` if the return value is an EachProxy or an uncacheable value.
4037
+ if (isVolatile(obj[key])) {
4038
+ return _emberMetalProperty_get.get(obj, key);
4039
+ // Otherwise attempt to get the cached value of the computed property
4040
+ } else {
4041
+ var cache = meta.readableCache();
4042
+ if (cache) {
4043
+ return _emberMetalComputed.cacheFor.get(cache, key);
4044
+ }
4045
+ }
4046
+ }
3765
4047
 
3766
4048
  function finishChains(obj) {
3767
4049
  // We only create meta if we really have to
@@ -4265,8 +4547,8 @@ enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', '
4265
4547
  this.setProperties({ firstName, lastName });
4266
4548
  return value;
4267
4549
  }
4268
- });
4269
- })
4550
+ })
4551
+ });
4270
4552
 
4271
4553
  let client = Person.create();
4272
4554
  client.get('firstName'); // 'Betty'
@@ -4623,31 +4905,37 @@ enifed("ember-metal/error", ["exports"], function (exports) {
4623
4905
  */
4624
4906
  "use strict";
4625
4907
 
4626
- exports.default = EmberError;
4908
+ var EmberError = (function (_Error) {
4909
+ babelHelpers.inherits(EmberError, _Error);
4627
4910
 
4628
- function EmberError(message) {
4629
- if (!(this instanceof EmberError)) {
4630
- return new EmberError(message);
4631
- }
4911
+ function EmberError(message) {
4912
+ _Error.call(this);
4632
4913
 
4633
- var error = Error.call(this, message);
4914
+ if (!(this instanceof EmberError)) {
4915
+ return new EmberError(message);
4916
+ }
4634
4917
 
4635
- if (Error.captureStackTrace) {
4636
- Error.captureStackTrace(this, EmberError);
4637
- } else {
4638
- this.stack = error.stack;
4918
+ var error = Error.call(this, message);
4919
+
4920
+ if (Error.captureStackTrace) {
4921
+ Error.captureStackTrace(this, EmberError);
4922
+ } else {
4923
+ this.stack = error.stack;
4924
+ }
4925
+
4926
+ this.description = error.description;
4927
+ this.fileName = error.fileName;
4928
+ this.lineNumber = error.lineNumber;
4929
+ this.message = error.message;
4930
+ this.name = error.name;
4931
+ this.number = error.number;
4932
+ this.code = error.code;
4639
4933
  }
4640
4934
 
4641
- this.description = error.description;
4642
- this.fileName = error.fileName;
4643
- this.lineNumber = error.lineNumber;
4644
- this.message = error.message;
4645
- this.name = error.name;
4646
- this.number = error.number;
4647
- this.code = error.code;
4648
- }
4935
+ return EmberError;
4936
+ })(Error);
4649
4937
 
4650
- EmberError.prototype = Object.create(Error.prototype);
4938
+ exports.default = EmberError;
4651
4939
  });
4652
4940
  enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) {
4653
4941
  'use strict';
@@ -4655,7 +4943,6 @@ enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/te
4655
4943
  exports.getOnerror = getOnerror;
4656
4944
  exports.setOnerror = setOnerror;
4657
4945
  exports.dispatchError = dispatchError;
4658
- exports.getDispatchOverride = getDispatchOverride;
4659
4946
  exports.setDispatchOverride = setDispatchOverride;
4660
4947
 
4661
4948
  // To maintain stacktrace consistency across browsers
@@ -4663,7 +4950,7 @@ enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/te
4663
4950
  var stack = error.stack;
4664
4951
  var message = error.message;
4665
4952
 
4666
- if (stack && stack.indexOf(message) === -1) {
4953
+ if (stack && !stack.includes(message)) {
4667
4954
  stack = message + '\n' + stack;
4668
4955
  }
4669
4956
 
@@ -4696,10 +4983,6 @@ enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/te
4696
4983
 
4697
4984
  // allows testing adapter to override dispatch
4698
4985
 
4699
- function getDispatchOverride() {
4700
- return dispatchOverride;
4701
- }
4702
-
4703
4986
  function setDispatchOverride(handler) {
4704
4987
  dispatchOverride = handler;
4705
4988
  }
@@ -5430,6 +5713,9 @@ enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/
5430
5713
  InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown;
5431
5714
  });
5432
5715
  enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) {
5716
+ /* eslint no-console:off */
5717
+ /* global console */
5718
+
5433
5719
  'use strict';
5434
5720
 
5435
5721
  exports.instrument = instrument;
@@ -5566,8 +5852,8 @@ enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-me
5566
5852
  result = payload;
5567
5853
  } finally {
5568
5854
  finalizer();
5569
- return result;
5570
5855
  }
5856
+ return result;
5571
5857
  }
5572
5858
 
5573
5859
  function NOOP() {}
@@ -5887,8 +6173,6 @@ enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (export
5887
6173
  enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) {
5888
6174
  'use strict';
5889
6175
 
5890
- exports.Libraries = Libraries;
5891
-
5892
6176
  /**
5893
6177
  Helper class that allows you to register your library with Ember.
5894
6178
 
@@ -5899,10 +6183,20 @@ enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/fe
5899
6183
  @private
5900
6184
  */
5901
6185
 
5902
- function Libraries() {
5903
- this._registry = [];
5904
- this._coreLibIndex = 0;
5905
- }
6186
+ var Libraries = (function () {
6187
+ function Libraries() {
6188
+ this._registry = [];
6189
+ this._coreLibIndex = 0;
6190
+ }
6191
+
6192
+ Libraries.prototype.isRegistered = function isRegistered(name) {
6193
+ return !!this._getLibraryByName(name);
6194
+ };
6195
+
6196
+ return Libraries;
6197
+ })();
6198
+
6199
+ exports.Libraries = Libraries;
5906
6200
 
5907
6201
  Libraries.prototype = {
5908
6202
  constructor: Libraries,
@@ -6489,7 +6783,6 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e
6489
6783
  // Remove "use strict"; from transpiled module until
6490
6784
  // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
6491
6785
 
6492
- exports.Meta = Meta;
6493
6786
  exports.deleteMeta = deleteMeta;
6494
6787
  exports.meta = meta;
6495
6788
 
@@ -6559,144 +6852,280 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e
6559
6852
  var memberNames = Object.keys(members);
6560
6853
  var META_FIELD = '__ember_meta__';
6561
6854
 
6562
- function Meta(obj, parentMeta) {
6563
- var _this = this;
6564
-
6565
- _emberMetalDebug.runInDebug(function () {
6566
- return counters.metaInstantiated++;
6567
- });
6568
-
6569
- this._cache = undefined;
6570
- this._weak = undefined;
6571
- this._watching = undefined;
6572
- this._mixins = undefined;
6573
- this._bindings = undefined;
6574
- this._values = undefined;
6575
- this._deps = undefined;
6576
- this._chainWatchers = undefined;
6577
- this._chains = undefined;
6578
- this._tag = undefined;
6579
- this._tags = undefined;
6580
-
6581
- // initial value for all flags right now is false
6582
- // see FLAGS const for detailed list of flags used
6583
- this._flags = 0;
6584
-
6585
- // used only internally
6586
- this.source = obj;
6587
-
6588
- // when meta(obj).proto === obj, the object is intended to be only a
6589
- // prototype and doesn't need to actually be observable itself
6590
- this.proto = undefined;
6591
-
6592
- // The next meta in our inheritance chain. We (will) track this
6593
- // explicitly instead of using prototypical inheritance because we
6594
- // have detailed knowledge of how each property should really be
6595
- // inherited, and we can optimize it much better than JS runtimes.
6596
- this.parent = parentMeta;
6855
+ var Meta = (function () {
6856
+ function Meta(obj, parentMeta) {
6857
+ var _this = this;
6597
6858
 
6598
- if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender') || _emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) {
6599
- this._lastRendered = undefined;
6600
6859
  _emberMetalDebug.runInDebug(function () {
6601
- _this._lastRenderedReferenceMap = undefined;
6602
- _this._lastRenderedTemplateMap = undefined;
6860
+ return counters.metaInstantiated++;
6603
6861
  });
6862
+
6863
+ this._cache = undefined;
6864
+ this._weak = undefined;
6865
+ this._watching = undefined;
6866
+ this._mixins = undefined;
6867
+ this._bindings = undefined;
6868
+ this._values = undefined;
6869
+ this._deps = undefined;
6870
+ this._chainWatchers = undefined;
6871
+ this._chains = undefined;
6872
+ this._tag = undefined;
6873
+ this._tags = undefined;
6874
+
6875
+ // initial value for all flags right now is false
6876
+ // see FLAGS const for detailed list of flags used
6877
+ this._flags = 0;
6878
+
6879
+ // used only internally
6880
+ this.source = obj;
6881
+
6882
+ // when meta(obj).proto === obj, the object is intended to be only a
6883
+ // prototype and doesn't need to actually be observable itself
6884
+ this.proto = undefined;
6885
+
6886
+ // The next meta in our inheritance chain. We (will) track this
6887
+ // explicitly instead of using prototypical inheritance because we
6888
+ // have detailed knowledge of how each property should really be
6889
+ // inherited, and we can optimize it much better than JS runtimes.
6890
+ this.parent = parentMeta;
6891
+
6892
+ if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender') || _emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) {
6893
+ this._lastRendered = undefined;
6894
+ _emberMetalDebug.runInDebug(function () {
6895
+ _this._lastRenderedReferenceMap = undefined;
6896
+ _this._lastRenderedTemplateMap = undefined;
6897
+ });
6898
+ }
6899
+
6900
+ this._initializeListeners();
6604
6901
  }
6605
6902
 
6606
- this._initializeListeners();
6607
- }
6903
+ Meta.prototype.isInitialized = function isInitialized(obj) {
6904
+ return this.proto !== obj;
6905
+ };
6608
6906
 
6609
- Meta.prototype.isInitialized = function (obj) {
6610
- return this.proto !== obj;
6611
- };
6907
+ Meta.prototype.destroy = function destroy() {
6908
+ if (this.isMetaDestroyed()) {
6909
+ return;
6910
+ }
6612
6911
 
6613
- var NODE_STACK = [];
6912
+ // remove chainWatchers to remove circular references that would prevent GC
6913
+ var nodes = undefined,
6914
+ key = undefined,
6915
+ nodeObject = undefined;
6916
+ var node = this.readableChains();
6917
+ if (node) {
6918
+ NODE_STACK.push(node);
6919
+ // process tree
6920
+ while (NODE_STACK.length > 0) {
6921
+ node = NODE_STACK.pop();
6922
+ // push children
6923
+ nodes = node._chains;
6924
+ if (nodes) {
6925
+ for (key in nodes) {
6926
+ if (nodes[key] !== undefined) {
6927
+ NODE_STACK.push(nodes[key]);
6928
+ }
6929
+ }
6930
+ }
6614
6931
 
6615
- Meta.prototype.destroy = function () {
6616
- if (this.isMetaDestroyed()) {
6617
- return;
6618
- }
6932
+ // remove chainWatcher in node object
6933
+ if (node._watching) {
6934
+ nodeObject = node._object;
6935
+ if (nodeObject) {
6936
+ var foreignMeta = peekMeta(nodeObject);
6937
+ // avoid cleaning up chain watchers when both current and
6938
+ // foreign objects are being destroyed
6939
+ // if both are being destroyed manual cleanup is not needed
6940
+ // as they will be GC'ed and no non-destroyed references will
6941
+ // be remaining
6942
+ if (foreignMeta && !foreignMeta.isSourceDestroying()) {
6943
+ _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta);
6944
+ }
6945
+ }
6946
+ }
6947
+ }
6948
+ }
6619
6949
 
6620
- // remove chainWatchers to remove circular references that would prevent GC
6621
- var node = undefined,
6622
- nodes = undefined,
6623
- key = undefined,
6624
- nodeObject = undefined;
6625
- node = this.readableChains();
6626
- if (node) {
6627
- NODE_STACK.push(node);
6628
- // process tree
6629
- while (NODE_STACK.length > 0) {
6630
- node = NODE_STACK.pop();
6631
- // push children
6632
- nodes = node._chains;
6633
- if (nodes) {
6634
- for (key in nodes) {
6635
- if (nodes[key] !== undefined) {
6636
- NODE_STACK.push(nodes[key]);
6950
+ this.setMetaDestroyed();
6951
+ };
6952
+
6953
+ Meta.prototype.isSourceDestroying = function isSourceDestroying() {
6954
+ return (this._flags & SOURCE_DESTROYING) !== 0;
6955
+ };
6956
+
6957
+ Meta.prototype.setSourceDestroying = function setSourceDestroying() {
6958
+ this._flags |= SOURCE_DESTROYING;
6959
+ };
6960
+
6961
+ Meta.prototype.isSourceDestroyed = function isSourceDestroyed() {
6962
+ return (this._flags & SOURCE_DESTROYED) !== 0;
6963
+ };
6964
+
6965
+ Meta.prototype.setSourceDestroyed = function setSourceDestroyed() {
6966
+ this._flags |= SOURCE_DESTROYED;
6967
+ };
6968
+
6969
+ Meta.prototype.isMetaDestroyed = function isMetaDestroyed() {
6970
+ return (this._flags & META_DESTROYED) !== 0;
6971
+ };
6972
+
6973
+ Meta.prototype.setMetaDestroyed = function setMetaDestroyed() {
6974
+ this._flags |= META_DESTROYED;
6975
+ };
6976
+
6977
+ Meta.prototype.isProxy = function isProxy() {
6978
+ return (this._flags & IS_PROXY) !== 0;
6979
+ };
6980
+
6981
+ Meta.prototype.setProxy = function setProxy() {
6982
+ this._flags |= IS_PROXY;
6983
+ };
6984
+
6985
+ Meta.prototype._getOrCreateOwnMap = function _getOrCreateOwnMap(key) {
6986
+ return this[key] || (this[key] = new _emberUtils.EmptyObject());
6987
+ };
6988
+
6989
+ Meta.prototype._getInherited = function _getInherited(key) {
6990
+ var pointer = this;
6991
+ while (pointer !== undefined) {
6992
+ if (pointer[key]) {
6993
+ return pointer[key];
6994
+ }
6995
+ pointer = pointer.parent;
6996
+ }
6997
+ };
6998
+
6999
+ Meta.prototype._findInherited = function _findInherited(key, subkey) {
7000
+ var pointer = this;
7001
+ while (pointer !== undefined) {
7002
+ var map = pointer[key];
7003
+ if (map) {
7004
+ var value = map[subkey];
7005
+ if (value !== undefined) {
7006
+ return value;
7007
+ }
7008
+ }
7009
+ pointer = pointer.parent;
7010
+ }
7011
+ };
7012
+
7013
+ // Implements a member that provides a lazily created map of maps,
7014
+ // with inheritance at both levels.
7015
+
7016
+ Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) {
7017
+ _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed());
7018
+
7019
+ var outerMap = this._getOrCreateOwnMap('_deps');
7020
+ var innerMap = outerMap[subkey];
7021
+ if (!innerMap) {
7022
+ innerMap = outerMap[subkey] = new _emberUtils.EmptyObject();
7023
+ }
7024
+ innerMap[itemkey] = value;
7025
+ };
7026
+
7027
+ Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) {
7028
+ var pointer = this;
7029
+ while (pointer !== undefined) {
7030
+ var map = pointer._deps;
7031
+ if (map) {
7032
+ var value = map[subkey];
7033
+ if (value) {
7034
+ if (value[itemkey] !== undefined) {
7035
+ return value[itemkey];
6637
7036
  }
6638
7037
  }
6639
7038
  }
7039
+ pointer = pointer.parent;
7040
+ }
7041
+ };
7042
+
7043
+ Meta.prototype.hasDeps = function hasDeps(subkey) {
7044
+ var pointer = this;
7045
+ while (pointer !== undefined) {
7046
+ if (pointer._deps && pointer._deps[subkey]) {
7047
+ return true;
7048
+ }
7049
+ pointer = pointer.parent;
7050
+ }
7051
+ return false;
7052
+ };
7053
+
7054
+ Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) {
7055
+ return this._forEachIn('_deps', subkey, fn);
7056
+ };
6640
7057
 
6641
- // remove chainWatcher in node object
6642
- if (node._watching) {
6643
- nodeObject = node._object;
6644
- if (nodeObject) {
6645
- var foreignMeta = peekMeta(nodeObject);
6646
- // avoid cleaning up chain watchers when both current and
6647
- // foreign objects are being destroyed
6648
- // if both are being destroyed manual cleanup is not needed
6649
- // as they will be GC'ed and no non-destroyed references will
6650
- // be remaining
6651
- if (foreignMeta && !foreignMeta.isSourceDestroying()) {
6652
- _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta);
7058
+ Meta.prototype._forEachIn = function _forEachIn(key, subkey, fn) {
7059
+ var pointer = this;
7060
+ var seen = new _emberUtils.EmptyObject();
7061
+ var calls = [];
7062
+ while (pointer !== undefined) {
7063
+ var map = pointer[key];
7064
+ if (map) {
7065
+ var innerMap = map[subkey];
7066
+ if (innerMap) {
7067
+ for (var innerKey in innerMap) {
7068
+ if (!seen[innerKey]) {
7069
+ seen[innerKey] = true;
7070
+ calls.push([innerKey, innerMap[innerKey]]);
7071
+ }
6653
7072
  }
6654
7073
  }
6655
7074
  }
7075
+ pointer = pointer.parent;
6656
7076
  }
6657
- }
7077
+ for (var i = 0; i < calls.length; i++) {
7078
+ var _calls$i = calls[i];
7079
+ var innerKey = _calls$i[0];
7080
+ var value = _calls$i[1];
6658
7081
 
6659
- this.setMetaDestroyed();
6660
- };
7082
+ fn(innerKey, value);
7083
+ }
7084
+ };
6661
7085
 
6662
- for (var _name in _emberMetalMeta_listeners.protoMethods) {
6663
- Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name];
6664
- }
6665
- memberNames.forEach(function (name) {
6666
- return members[name](name, Meta);
6667
- });
7086
+ Meta.prototype.readInheritedValue = function readInheritedValue(key, subkey) {
7087
+ var internalKey = '_' + key;
6668
7088
 
6669
- Meta.prototype.isSourceDestroying = function isSourceDestroying() {
6670
- return (this._flags & SOURCE_DESTROYING) !== 0;
6671
- };
7089
+ var pointer = this;
6672
7090
 
6673
- Meta.prototype.setSourceDestroying = function setSourceDestroying() {
6674
- this._flags |= SOURCE_DESTROYING;
6675
- };
7091
+ while (pointer !== undefined) {
7092
+ var map = pointer[internalKey];
7093
+ if (map) {
7094
+ var value = map[subkey];
7095
+ if (value !== undefined || subkey in map) {
7096
+ return map[subkey];
7097
+ }
7098
+ }
7099
+ pointer = pointer.parent;
7100
+ }
6676
7101
 
6677
- Meta.prototype.isSourceDestroyed = function isSourceDestroyed() {
6678
- return (this._flags & SOURCE_DESTROYED) !== 0;
6679
- };
7102
+ return UNDEFINED;
7103
+ };
6680
7104
 
6681
- Meta.prototype.setSourceDestroyed = function setSourceDestroyed() {
6682
- this._flags |= SOURCE_DESTROYED;
6683
- };
7105
+ Meta.prototype.writeValue = function writeValue(obj, key, value) {
7106
+ var descriptor = _emberUtils.lookupDescriptor(obj, key);
7107
+ var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter;
6684
7108
 
6685
- Meta.prototype.isMetaDestroyed = function isMetaDestroyed() {
6686
- return (this._flags & META_DESTROYED) !== 0;
6687
- };
7109
+ if (isMandatorySetter) {
7110
+ this.writeValues(key, value);
7111
+ } else {
7112
+ obj[key] = value;
7113
+ }
7114
+ };
6688
7115
 
6689
- Meta.prototype.setMetaDestroyed = function setMetaDestroyed() {
6690
- this._flags |= META_DESTROYED;
6691
- };
7116
+ return Meta;
7117
+ })();
6692
7118
 
6693
- Meta.prototype.isProxy = function isProxy() {
6694
- return (this._flags & IS_PROXY) !== 0;
6695
- };
7119
+ exports.Meta = Meta;
6696
7120
 
6697
- Meta.prototype.setProxy = function setProxy() {
6698
- this._flags |= IS_PROXY;
6699
- };
7121
+ var NODE_STACK = [];
7122
+
7123
+ for (var _name in _emberMetalMeta_listeners.protoMethods) {
7124
+ Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name];
7125
+ }
7126
+ memberNames.forEach(function (name) {
7127
+ return members[name](name, Meta);
7128
+ });
6700
7129
 
6701
7130
  // Implements a member that is a lazily created, non-inheritable
6702
7131
  // POJO.
@@ -6711,14 +7140,6 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e
6711
7140
  };
6712
7141
  }
6713
7142
 
6714
- Meta.prototype._getOrCreateOwnMap = function (key) {
6715
- var ret = this[key];
6716
- if (!ret) {
6717
- ret = this[key] = new _emberUtils.EmptyObject();
6718
- }
6719
- return ret;
6720
- };
6721
-
6722
7143
  // Implements a member that is a lazily created POJO with inheritable
6723
7144
  // values.
6724
7145
  function inheritedMap(name, Meta) {
@@ -6768,105 +7189,9 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e
6768
7189
  };
6769
7190
  }
6770
7191
 
6771
- Meta.prototype._getInherited = function (key) {
6772
- var pointer = this;
6773
- while (pointer !== undefined) {
6774
- if (pointer[key]) {
6775
- return pointer[key];
6776
- }
6777
- pointer = pointer.parent;
6778
- }
6779
- };
6780
-
6781
- Meta.prototype._findInherited = function (key, subkey) {
6782
- var pointer = this;
6783
- while (pointer !== undefined) {
6784
- var map = pointer[key];
6785
- if (map) {
6786
- var value = map[subkey];
6787
- if (value !== undefined) {
6788
- return value;
6789
- }
6790
- }
6791
- pointer = pointer.parent;
6792
- }
6793
- };
6794
-
6795
7192
  var UNDEFINED = _emberUtils.symbol('undefined');
6796
7193
 
6797
7194
  exports.UNDEFINED = UNDEFINED;
6798
- // Implements a member that provides a lazily created map of maps,
6799
- // with inheritance at both levels.
6800
- Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) {
6801
- _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed());
6802
-
6803
- var outerMap = this._getOrCreateOwnMap('_deps');
6804
- var innerMap = outerMap[subkey];
6805
- if (!innerMap) {
6806
- innerMap = outerMap[subkey] = new _emberUtils.EmptyObject();
6807
- }
6808
- innerMap[itemkey] = value;
6809
- };
6810
-
6811
- Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) {
6812
- var pointer = this;
6813
- while (pointer !== undefined) {
6814
- var map = pointer._deps;
6815
- if (map) {
6816
- var value = map[subkey];
6817
- if (value) {
6818
- if (value[itemkey] !== undefined) {
6819
- return value[itemkey];
6820
- }
6821
- }
6822
- }
6823
- pointer = pointer.parent;
6824
- }
6825
- };
6826
-
6827
- Meta.prototype.hasDeps = function hasDeps(subkey) {
6828
- var pointer = this;
6829
- while (pointer !== undefined) {
6830
- if (pointer._deps && pointer._deps[subkey]) {
6831
- return true;
6832
- }
6833
- pointer = pointer.parent;
6834
- }
6835
- return false;
6836
- };
6837
-
6838
- Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) {
6839
- return this._forEachIn('_deps', subkey, fn);
6840
- };
6841
-
6842
- Meta.prototype._forEachIn = function (key, subkey, fn) {
6843
- var pointer = this;
6844
- var seen = new _emberUtils.EmptyObject();
6845
- var calls = [];
6846
- while (pointer !== undefined) {
6847
- var map = pointer[key];
6848
- if (map) {
6849
- var innerMap = map[subkey];
6850
- if (innerMap) {
6851
- for (var innerKey in innerMap) {
6852
- if (!seen[innerKey]) {
6853
- seen[innerKey] = true;
6854
- calls.push([innerKey, innerMap[innerKey]]);
6855
- }
6856
- }
6857
- }
6858
- }
6859
- pointer = pointer.parent;
6860
- }
6861
- for (var i = 0; i < calls.length; i++) {
6862
- var _calls$i = calls[i];
6863
- var innerKey = _calls$i[0];
6864
- var value = _calls$i[1];
6865
-
6866
- fn(innerKey, value);
6867
- }
6868
- };
6869
-
6870
7195
  // Implements a member that provides a non-heritable, lazily-created
6871
7196
  // object using the method you provide.
6872
7197
  function ownCustomObject(name, Meta) {
@@ -7273,7 +7598,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7273
7598
  */
7274
7599
  exports.detectBinding = detectBinding;
7275
7600
  exports.mixin = mixin;
7276
- exports.default = Mixin;
7277
7601
  exports.hasUnprocessedMixins = hasUnprocessedMixins;
7278
7602
  exports.clearUnprocessedMixins = clearUnprocessedMixins;
7279
7603
  exports.required = required;
@@ -7285,7 +7609,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7285
7609
  function ROOT() {}
7286
7610
  ROOT.__hasSuper = false;
7287
7611
 
7288
- var a_slice = [].slice;
7612
+ var a_slice = Array.prototype.slice;
7613
+ var a_concat = Array.prototype.concat;
7614
+ var isArray = Array.isArray;
7289
7615
 
7290
7616
  function isMethod(obj) {
7291
7617
  return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;
@@ -7309,14 +7635,11 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7309
7635
  }
7310
7636
 
7311
7637
  function concatenatedMixinProperties(concatProp, props, values, base) {
7312
- var concats = undefined;
7313
-
7314
7638
  // reset before adding each new mixin to pickup concats from previous
7315
- concats = values[concatProp] || base[concatProp];
7639
+ var concats = values[concatProp] || base[concatProp];
7316
7640
  if (props[concatProp]) {
7317
- concats = concats ? concats.concat(props[concatProp]) : props[concatProp];
7641
+ concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp];
7318
7642
  }
7319
-
7320
7643
  return concats;
7321
7644
  }
7322
7645
 
@@ -7383,18 +7706,18 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7383
7706
  var baseValue = values[key] || obj[key];
7384
7707
  var ret = undefined;
7385
7708
 
7386
- if (baseValue) {
7387
- if ('function' === typeof baseValue.concat) {
7709
+ if (baseValue === null || baseValue === undefined) {
7710
+ ret = _emberUtils.makeArray(value);
7711
+ } else {
7712
+ if (isArray(baseValue)) {
7388
7713
  if (value === null || value === undefined) {
7389
7714
  ret = baseValue;
7390
7715
  } else {
7391
- ret = baseValue.concat(value);
7716
+ ret = a_concat.call(baseValue, value);
7392
7717
  }
7393
7718
  } else {
7394
- ret = _emberUtils.makeArray(baseValue).concat(value);
7719
+ ret = a_concat.call(_emberUtils.makeArray(baseValue), value);
7395
7720
  }
7396
- } else {
7397
- ret = _emberUtils.makeArray(value);
7398
7721
  }
7399
7722
 
7400
7723
  _emberMetalDebug.runInDebug(function () {
@@ -7413,7 +7736,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7413
7736
  var baseValue = values[key] || obj[key];
7414
7737
 
7415
7738
  _emberMetalDebug.runInDebug(function () {
7416
- if (Array.isArray(value)) {
7739
+ if (isArray(value)) {
7417
7740
  // use conditional to avoid stringifying every time
7418
7741
  _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false);
7419
7742
  }
@@ -7740,41 +8063,86 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7740
8063
  @public
7741
8064
  */
7742
8065
 
7743
- function Mixin(args, properties) {
7744
- this.properties = properties;
8066
+ var Mixin = (function () {
8067
+ function Mixin(args, properties) {
8068
+ this.properties = properties;
8069
+
8070
+ var length = args && args.length;
8071
+
8072
+ if (length > 0) {
8073
+ var m = new Array(length);
8074
+
8075
+ for (var i = 0; i < length; i++) {
8076
+ var x = args[i];
8077
+ if (x instanceof Mixin) {
8078
+ m[i] = x;
8079
+ } else {
8080
+ m[i] = new Mixin(undefined, x);
8081
+ }
8082
+ }
8083
+
8084
+ this.mixins = m;
8085
+ } else {
8086
+ this.mixins = undefined;
8087
+ }
8088
+ this.ownerConstructor = undefined;
8089
+ this._without = undefined;
8090
+ this[_emberUtils.GUID_KEY] = null;
8091
+ this[_emberUtils.NAME_KEY] = null;
8092
+ _emberMetalDebug.debugSeal(this);
8093
+ }
8094
+
8095
+ Mixin.applyPartial = function applyPartial(obj) {
8096
+ var args = a_slice.call(arguments, 1);
8097
+ return applyMixin(obj, args, true);
8098
+ };
8099
+
8100
+ /**
8101
+ @method create
8102
+ @static
8103
+ @param arguments*
8104
+ @public
8105
+ */
8106
+
8107
+ Mixin.create = function create() {
8108
+ // ES6TODO: this relies on a global state?
8109
+ unprocessedFlag = true;
8110
+ var M = this;
8111
+
8112
+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8113
+ args[_key2] = arguments[_key2];
8114
+ }
8115
+
8116
+ return new M(args, undefined);
8117
+ };
8118
+
8119
+ // returns the mixins currently applied to the specified object
8120
+ // TODO: Make Ember.mixin
8121
+
8122
+ Mixin.mixins = function mixins(obj) {
8123
+ var m = _emberMetalMeta.peekMeta(obj);
8124
+ var ret = [];
8125
+ if (!m) {
8126
+ return ret;
8127
+ }
7745
8128
 
7746
- var length = args && args.length;
8129
+ m.forEachMixins(function (key, currentMixin) {
8130
+ // skip primitive mixins since these are always anonymous
8131
+ if (!currentMixin.properties) {
8132
+ ret.push(currentMixin);
8133
+ }
8134
+ });
7747
8135
 
7748
- if (length > 0) {
7749
- var m = new Array(length);
8136
+ return ret;
8137
+ };
7750
8138
 
7751
- for (var i = 0; i < length; i++) {
7752
- var x = args[i];
7753
- if (x instanceof Mixin) {
7754
- m[i] = x;
7755
- } else {
7756
- m[i] = new Mixin(undefined, x);
7757
- }
7758
- }
8139
+ return Mixin;
8140
+ })();
7759
8141
 
7760
- this.mixins = m;
7761
- } else {
7762
- this.mixins = undefined;
7763
- }
7764
- this.ownerConstructor = undefined;
7765
- this._without = undefined;
7766
- this[_emberUtils.GUID_KEY] = null;
7767
- this[_emberUtils.NAME_KEY] = null;
7768
- _emberMetalDebug.debugSeal(this);
7769
- }
8142
+ exports.default = Mixin;
7770
8143
 
7771
8144
  Mixin._apply = applyMixin;
7772
8145
 
7773
- Mixin.applyPartial = function (obj) {
7774
- var args = a_slice.call(arguments, 1);
7775
- return applyMixin(obj, args, true);
7776
- };
7777
-
7778
8146
  Mixin.finishPartial = finishPartial;
7779
8147
 
7780
8148
  var unprocessedFlag = false;
@@ -7787,24 +8155,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7787
8155
  unprocessedFlag = false;
7788
8156
  }
7789
8157
 
7790
- /**
7791
- @method create
7792
- @static
7793
- @param arguments*
7794
- @public
7795
- */
7796
- Mixin.create = function () {
7797
- // ES6TODO: this relies on a global state?
7798
- unprocessedFlag = true;
7799
- var M = this;
7800
-
7801
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
7802
- args[_key2] = arguments[_key2];
7803
- }
7804
-
7805
- return new M(args, undefined);
7806
- };
7807
-
7808
8158
  var MixinPrototype = Mixin.prototype;
7809
8159
 
7810
8160
  /**
@@ -7938,25 +8288,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
7938
8288
 
7939
8289
  _emberMetalDebug.debugSeal(MixinPrototype);
7940
8290
 
7941
- // returns the mixins currently applied to the specified object
7942
- // TODO: Make Ember.mixin
7943
- Mixin.mixins = function (obj) {
7944
- var m = _emberMetalMeta.peekMeta(obj);
7945
- var ret = [];
7946
- if (!m) {
7947
- return ret;
7948
- }
7949
-
7950
- m.forEachMixins(function (key, currentMixin) {
7951
- // skip primitive mixins since these are always anonymous
7952
- if (!currentMixin.properties) {
7953
- ret.push(currentMixin);
7954
- }
7955
- });
7956
-
7957
- return ret;
7958
- };
7959
-
7960
8291
  var REQUIRED = new _emberMetalProperties.Descriptor();
7961
8292
  REQUIRED.toString = function () {
7962
8293
  return '(Required Property)';
@@ -8160,7 +8491,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb
8160
8491
  }
8161
8492
 
8162
8493
  exports.Mixin = Mixin;
8163
- exports.required = required;
8164
8494
  exports.REQUIRED = REQUIRED;
8165
8495
  });
8166
8496
  enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) {
@@ -8280,8 +8610,6 @@ enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/
8280
8610
  enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) {
8281
8611
  'use strict';
8282
8612
 
8283
- exports.default = ObserverSet;
8284
-
8285
8613
  /*
8286
8614
  this.observerSet = {
8287
8615
  [senderGuid]: { // variable name: `keySet`
@@ -8301,53 +8629,59 @@ enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/event
8301
8629
  ]
8302
8630
  */
8303
8631
 
8304
- function ObserverSet() {
8305
- this.clear();
8306
- }
8632
+ var ObserverSet = (function () {
8633
+ function ObserverSet() {
8634
+ this.clear();
8635
+ }
8307
8636
 
8308
- ObserverSet.prototype.add = function (sender, keyName, eventName) {
8309
- var observerSet = this.observerSet;
8310
- var observers = this.observers;
8311
- var senderGuid = _emberUtils.guidFor(sender);
8312
- var keySet = observerSet[senderGuid];
8313
- var index = undefined;
8637
+ ObserverSet.prototype.add = function add(sender, keyName, eventName) {
8638
+ var observerSet = this.observerSet;
8639
+ var observers = this.observers;
8640
+ var senderGuid = _emberUtils.guidFor(sender);
8641
+ var keySet = observerSet[senderGuid];
8642
+ var index = undefined;
8314
8643
 
8315
- if (!keySet) {
8316
- observerSet[senderGuid] = keySet = {};
8317
- }
8318
- index = keySet[keyName];
8319
- if (index === undefined) {
8320
- index = observers.push({
8321
- sender: sender,
8322
- keyName: keyName,
8323
- eventName: eventName,
8324
- listeners: []
8325
- }) - 1;
8326
- keySet[keyName] = index;
8327
- }
8328
- return observers[index].listeners;
8329
- };
8644
+ if (!keySet) {
8645
+ observerSet[senderGuid] = keySet = {};
8646
+ }
8647
+ index = keySet[keyName];
8648
+ if (index === undefined) {
8649
+ index = observers.push({
8650
+ sender: sender,
8651
+ keyName: keyName,
8652
+ eventName: eventName,
8653
+ listeners: []
8654
+ }) - 1;
8655
+ keySet[keyName] = index;
8656
+ }
8657
+ return observers[index].listeners;
8658
+ };
8330
8659
 
8331
- ObserverSet.prototype.flush = function () {
8332
- var observers = this.observers;
8333
- var i = undefined,
8334
- observer = undefined,
8335
- sender = undefined;
8336
- this.clear();
8337
- for (i = 0; i < observers.length; ++i) {
8338
- observer = observers[i];
8339
- sender = observer.sender;
8340
- if (sender.isDestroying || sender.isDestroyed) {
8341
- continue;
8660
+ ObserverSet.prototype.flush = function flush() {
8661
+ var observers = this.observers;
8662
+ var i = undefined,
8663
+ observer = undefined,
8664
+ sender = undefined;
8665
+ this.clear();
8666
+ for (i = 0; i < observers.length; ++i) {
8667
+ observer = observers[i];
8668
+ sender = observer.sender;
8669
+ if (sender.isDestroying || sender.isDestroyed) {
8670
+ continue;
8671
+ }
8672
+ _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);
8342
8673
  }
8343
- _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);
8344
- }
8345
- };
8674
+ };
8346
8675
 
8347
- ObserverSet.prototype.clear = function () {
8348
- this.observerSet = {};
8349
- this.observers = [];
8350
- };
8676
+ ObserverSet.prototype.clear = function clear() {
8677
+ this.observerSet = {};
8678
+ this.observers = [];
8679
+ };
8680
+
8681
+ return ObserverSet;
8682
+ })();
8683
+
8684
+ exports.default = ObserverSet;
8351
8685
  });
8352
8686
  enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) {
8353
8687
  'use strict';
@@ -9270,7 +9604,7 @@ enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', '
9270
9604
 
9271
9605
  var onErrorTarget = {
9272
9606
  get onerror() {
9273
- return _emberMetalError_handler.dispatchError;
9607
+ return _emberMetalError_handler.getOnerror();
9274
9608
  },
9275
9609
  set onerror(handler) {
9276
9610
  return _emberMetalError_handler.setOnerror(handler);
@@ -10704,21 +11038,22 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim
10704
11038
  return spaceship(v.localeCompare(w), 0);
10705
11039
 
10706
11040
  case 'array':
10707
- var vLen = v.length;
10708
- var wLen = w.length;
10709
- var len = Math.min(vLen, wLen);
10710
-
10711
- for (var i = 0; i < len; i++) {
10712
- var r = compare(v[i], w[i]);
10713
- if (r !== 0) {
10714
- return r;
11041
+ {
11042
+ var vLen = v.length;
11043
+ var wLen = w.length;
11044
+ var len = Math.min(vLen, wLen);
11045
+
11046
+ for (var i = 0; i < len; i++) {
11047
+ var r = compare(v[i], w[i]);
11048
+ if (r !== 0) {
11049
+ return r;
11050
+ }
10715
11051
  }
10716
- }
10717
-
10718
- // all elements are equal now
10719
- // shorter array should be ordered first
10720
- return spaceship(vLen, wLen);
10721
11052
 
11053
+ // all elements are equal now
11054
+ // shorter array should be ordered first
11055
+ return spaceship(vLen, wLen);
11056
+ }
10722
11057
  case 'instance':
10723
11058
  if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) {
10724
11059
  return v.compare(v, w);
@@ -11012,16 +11347,16 @@ enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], fun
11012
11347
 
11013
11348
  ```javascript
11014
11349
  let Hamster = Ember.Object.extend({
11015
- napTime: Ember.computed.equal('state', 'sleepy')
11350
+ satisfied: Ember.computed.equal('percentCarrotsEaten', 100)
11016
11351
  });
11017
11352
 
11018
11353
  let hamster = Hamster.create();
11019
11354
 
11020
- hamster.get('napTime'); // false
11021
- hamster.set('state', 'sleepy');
11022
- hamster.get('napTime'); // true
11023
- hamster.set('state', 'hungry');
11024
- hamster.get('napTime'); // false
11355
+ hamster.get('satisfied'); // false
11356
+ hamster.set('percentCarrotsEaten', 100);
11357
+ hamster.get('satisfied'); // true
11358
+ hamster.set('percentCarrotsEaten', 50);
11359
+ hamster.get('satisfied'); // false
11025
11360
  ```
11026
11361
 
11027
11362
  @method equal
@@ -12164,7 +12499,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils
12164
12499
 
12165
12500
  if (activeObservers) {
12166
12501
  activeObservers.forEach(function (args) {
12167
- return _emberMetal.removeObserver.apply(null, args);
12502
+ return _emberMetal.removeObserver.apply(undefined, args);
12168
12503
  });
12169
12504
  }
12170
12505
 
@@ -12177,7 +12512,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils
12177
12512
 
12178
12513
  var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop;
12179
12514
  var args = [_this5, path, sortPropertyDidChange];
12180
- _emberMetal.addObserver.apply(null, args);
12515
+ _emberMetal.addObserver.apply(undefined, args);
12181
12516
  return args;
12182
12517
  });
12183
12518
 
@@ -13479,9 +13814,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', '
13479
13814
  }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () {
13480
13815
  return objectAt(this, _emberMetal.get(this, 'length') - 1);
13481
13816
  }).readOnly(), _Mixin$create.contains = function (obj) {
13482
- if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {
13483
- _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' });
13484
- }
13817
+ _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' });
13485
13818
 
13486
13819
  return this.indexOf(obj) >= 0;
13487
13820
  }, _Mixin$create.slice = function (beginIndex, endIndex) {
@@ -13555,6 +13888,27 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', '
13555
13888
  return arrayContentWillChange(this, startIdx, removeAmt, addAmt);
13556
13889
  }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) {
13557
13890
  return arrayContentDidChange(this, startIdx, removeAmt, addAmt);
13891
+ }, _Mixin$create.includes = function (obj, startAt) {
13892
+ var len = _emberMetal.get(this, 'length');
13893
+
13894
+ if (startAt === undefined) {
13895
+ startAt = 0;
13896
+ }
13897
+
13898
+ if (startAt < 0) {
13899
+ startAt += len;
13900
+ }
13901
+
13902
+ for (var idx = startAt; idx < len; idx++) {
13903
+ var currentObj = objectAt(this, idx);
13904
+
13905
+ // SameValueZero comparison (NaN !== NaN)
13906
+ if (obj === currentObj || obj !== obj && currentObj !== currentObj) {
13907
+ return true;
13908
+ }
13909
+ }
13910
+
13911
+ return false;
13558
13912
  }, _Mixin$create['@each'] = _emberMetal.computed(function () {
13559
13913
  // TODO use Symbol or add to meta
13560
13914
  if (!this.__each) {
@@ -13564,55 +13918,6 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', '
13564
13918
  return this.__each;
13565
13919
  }).volatile().readOnly(), _Mixin$create));
13566
13920
 
13567
- if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {
13568
- ArrayMixin.reopen({
13569
- /**
13570
- Returns `true` if the passed object can be found in the array.
13571
- This method is a Polyfill for ES 2016 Array.includes.
13572
- If no `startAt` argument is given, the starting location to
13573
- search is 0. If it's negative, searches from the index of
13574
- `this.length + startAt` by asc.
13575
- ```javascript
13576
- [1, 2, 3].includes(2); // true
13577
- [1, 2, 3].includes(4); // false
13578
- [1, 2, 3].includes(3, 2); // true
13579
- [1, 2, 3].includes(3, 3); // false
13580
- [1, 2, 3].includes(3, -1); // true
13581
- [1, 2, 3].includes(1, -1); // false
13582
- [1, 2, 3].includes(1, -4); // true
13583
- [1, 2, NaN].includes(NaN); // true
13584
- ```
13585
- @method includes
13586
- @param {Object} obj The object to search for.
13587
- @param {Number} startAt optional starting location to search, default 0
13588
- @return {Boolean} `true` if object is found in the array.
13589
- @public
13590
- */
13591
- includes: function (obj, startAt) {
13592
- var len = _emberMetal.get(this, 'length');
13593
-
13594
- if (startAt === undefined) {
13595
- startAt = 0;
13596
- }
13597
-
13598
- if (startAt < 0) {
13599
- startAt += len;
13600
- }
13601
-
13602
- for (var idx = startAt; idx < len; idx++) {
13603
- var currentObj = objectAt(this, idx);
13604
-
13605
- // SameValueZero comparison (NaN !== NaN)
13606
- if (obj === currentObj || obj !== obj && currentObj !== currentObj) {
13607
- return true;
13608
- }
13609
- }
13610
-
13611
- return false;
13612
- }
13613
- });
13614
- }
13615
-
13616
13921
  exports.default = ArrayMixin;
13617
13922
  });
13618
13923
  // ES6TODO: Ember.A
@@ -13808,6 +14113,29 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', '
13808
14113
  @public
13809
14114
  */
13810
14115
 
14116
+ /**
14117
+ Returns `true` if the passed object can be found in the array.
14118
+ This method is a Polyfill for ES 2016 Array.includes.
14119
+ If no `startAt` argument is given, the starting location to
14120
+ search is 0. If it's negative, searches from the index of
14121
+ `this.length + startAt` by asc.
14122
+ ```javascript
14123
+ [1, 2, 3].includes(2); // true
14124
+ [1, 2, 3].includes(4); // false
14125
+ [1, 2, 3].includes(3, 2); // true
14126
+ [1, 2, 3].includes(3, 3); // false
14127
+ [1, 2, 3].includes(3, -1); // true
14128
+ [1, 2, 3].includes(1, -1); // false
14129
+ [1, 2, 3].includes(1, -4); // true
14130
+ [1, 2, NaN].includes(NaN); // true
14131
+ ```
14132
+ @method includes
14133
+ @param {Object} obj The object to search for.
14134
+ @param {Number} startAt optional starting location to search, default 0
14135
+ @return {Boolean} `true` if object is found in the array.
14136
+ @public
14137
+ */
14138
+
13811
14139
  /**
13812
14140
  Returns a special object that can be used to observe individual properties
13813
14141
  on the array. Just get an equivalent property on this object and it will
@@ -13867,13 +14195,15 @@ enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (
13867
14195
  compare: null
13868
14196
  });
13869
14197
  });
13870
- enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) {
14198
+ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) {
13871
14199
  /**
13872
14200
  @module ember
13873
14201
  @submodule ember-runtime
13874
14202
  */
13875
14203
  'use strict';
13876
14204
 
14205
+ var _containerProxyMixin;
14206
+
13877
14207
  /**
13878
14208
  ContainerProxyMixin is used to provide public access to specific
13879
14209
  container functionality.
@@ -13881,7 +14211,7 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], funct
13881
14211
  @class ContainerProxyMixin
13882
14212
  @private
13883
14213
  */
13884
- exports.default = _emberMetal.Mixin.create({
14214
+ var containerProxyMixin = (_containerProxyMixin = {
13885
14215
  /**
13886
14216
  The container stores state.
13887
14217
  @private
@@ -13902,6 +14232,7 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], funct
13902
14232
  ```
13903
14233
  @public
13904
14234
  @method ownerInjection
14235
+ @since 2.3.0
13905
14236
  @return {Object}
13906
14237
  */
13907
14238
  ownerInjection: function () {
@@ -13952,34 +14283,51 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], funct
13952
14283
  */
13953
14284
  _lookupFactory: function (fullName, options) {
13954
14285
  return this.__container__.lookupFactory(fullName, options);
13955
- },
14286
+ }
13956
14287
 
13957
- /**
13958
- Given a name and a source path, resolve the fullName
13959
- @private
13960
- @method _resolveLocalLookupName
13961
- @param {String} fullName
13962
- @param {String} source
13963
- @return {String}
13964
- */
13965
- _resolveLocalLookupName: function (name, source) {
13966
- return this.__container__.registry.expandLocalLookup('component:' + name, {
13967
- source: source
13968
- });
13969
- },
14288
+ }, _containerProxyMixin[_container.FACTORY_FOR] = function () {
14289
+ var _container__;
13970
14290
 
13971
- /**
13972
- @private
13973
- */
13974
- willDestroy: function () {
13975
- this._super.apply(this, arguments);
14291
+ return (_container__ = this.__container__)[_container.FACTORY_FOR].apply(_container__, arguments);
14292
+ }, _containerProxyMixin[_container.LOOKUP_FACTORY] = function () {
14293
+ var _container__2;
13976
14294
 
13977
- if (this.__container__) {
13978
- _emberMetal.run(this.__container__, 'destroy');
13979
- }
14295
+ return (_container__2 = this.__container__)[_container.LOOKUP_FACTORY].apply(_container__2, arguments);
14296
+ }, _containerProxyMixin._resolveLocalLookupName = function (name, source) {
14297
+ return this.__container__.registry.expandLocalLookup('component:' + name, {
14298
+ source: source
14299
+ });
14300
+ }, _containerProxyMixin.willDestroy = function () {
14301
+ this._super.apply(this, arguments);
14302
+
14303
+ if (this.__container__) {
14304
+ _emberMetal.run(this.__container__, 'destroy');
13980
14305
  }
13981
- });
14306
+ }, _containerProxyMixin);
14307
+
14308
+ if (_emberMetal.isFeatureEnabled('ember-factory-for')) {
14309
+ containerProxyMixin.factoryFor = function ContainerProxyMixin_factoryFor(fullName) {
14310
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
14311
+
14312
+ return this.__container__.factoryFor(fullName, options);
14313
+ };
14314
+ }
14315
+
14316
+ exports.default = _emberMetal.Mixin.create(containerProxyMixin);
13982
14317
  });
14318
+
14319
+ /**
14320
+ Given a name and a source path, resolve the fullName
14321
+ @private
14322
+ @method _resolveLocalLookupName
14323
+ @param {String} fullName
14324
+ @param {String} source
14325
+ @return {String}
14326
+ */
14327
+
14328
+ /**
14329
+ @private
14330
+ */
13983
14331
  enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) {
13984
14332
  'use strict';
13985
14333
 
@@ -14324,9 +14672,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta
14324
14672
  @public
14325
14673
  */
14326
14674
  contains: function (obj) {
14327
- if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {
14328
- _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' });
14329
- }
14675
+ _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' });
14330
14676
 
14331
14677
  var found = this.find(function (item) {
14332
14678
  return item === obj;
@@ -14847,14 +15193,15 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta
14847
15193
  @public
14848
15194
  */
14849
15195
  without: function (value) {
14850
- if (!this.contains(value)) {
15196
+ if (!this.includes(value)) {
14851
15197
  return this; // nothing to do
14852
15198
  }
14853
15199
 
14854
15200
  var ret = emberA();
14855
15201
 
14856
15202
  this.forEach(function (k) {
14857
- if (k !== value) {
15203
+ // SameValueZero comparison (NaN !== NaN)
15204
+ if (!(k === value || k !== k && value !== value)) {
14858
15205
  ret[ret.length] = k;
14859
15206
  }
14860
15207
  });
@@ -15110,99 +15457,74 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta
15110
15457
  }
15111
15458
  return 0;
15112
15459
  });
15113
- }
15114
- });
15460
+ },
15115
15461
 
15116
- if (_emberMetal.isFeatureEnabled('ember-runtime-computed-uniq-by')) {
15117
- Enumerable.reopen({
15118
- /**
15119
- Returns a new enumerable that contains only items containing a unique property value.
15120
- The default implementation returns an array regardless of the receiver type.
15121
- ```javascript
15122
- let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
15123
- arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }]
15124
- ```
15125
- @method uniqBy
15126
- @return {Ember.Enumerable}
15127
- @public
15128
- */
15129
-
15130
- uniqBy: function (key) {
15131
- var ret = emberA();
15132
- var seen = new _emberUtils.EmptyObject();
15133
-
15134
- this.forEach(function (item) {
15135
- var guid = _emberUtils.guidFor(_emberMetal.get(item, key));
15136
- if (!(guid in seen)) {
15137
- seen[guid] = true;
15138
- ret.push(item);
15139
- }
15140
- });
15462
+ /**
15463
+ Returns a new enumerable that contains only items containing a unique property value.
15464
+ The default implementation returns an array regardless of the receiver type.
15465
+ ```javascript
15466
+ let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
15467
+ arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }]
15468
+ ```
15469
+ @method uniqBy
15470
+ @return {Ember.Enumerable}
15471
+ @public
15472
+ */
15141
15473
 
15142
- return ret;
15143
- }
15144
- });
15145
- }
15474
+ uniqBy: function (key) {
15475
+ var ret = emberA();
15476
+ var seen = new _emberUtils.EmptyObject();
15146
15477
 
15147
- if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {
15148
- Enumerable.reopen({
15149
- /**
15150
- Returns `true` if the passed object can be found in the enumerable.
15151
- ```javascript
15152
- [1, 2, 3].includes(2); // true
15153
- [1, 2, 3].includes(4); // false
15154
- [1, 2, undefined].includes(undefined); // true
15155
- [1, 2, null].includes(null); // true
15156
- [1, 2, NaN].includes(NaN); // true
15157
- ```
15158
- @method includes
15159
- @param {Object} obj The object to search for.
15160
- @return {Boolean} `true` if object is found in the enumerable.
15161
- @public
15162
- */
15163
- includes: function (obj) {
15164
- _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1);
15165
-
15166
- var len = _emberMetal.get(this, 'length');
15167
- var idx = undefined,
15168
- next = undefined;
15169
- var last = null;
15170
- var found = false;
15171
-
15172
- var context = popCtx();
15173
-
15174
- for (idx = 0; idx < len && !found; idx++) {
15175
- next = this.nextObject(idx, last, context);
15176
-
15177
- found = obj === next || obj !== obj && next !== next;
15178
-
15179
- last = next;
15478
+ this.forEach(function (item) {
15479
+ var guid = _emberUtils.guidFor(_emberMetal.get(item, key));
15480
+ if (!(guid in seen)) {
15481
+ seen[guid] = true;
15482
+ ret.push(item);
15180
15483
  }
15484
+ });
15181
15485
 
15182
- next = last = null;
15183
- context = pushCtx(context);
15486
+ return ret;
15487
+ },
15184
15488
 
15185
- return found;
15186
- },
15489
+ /**
15490
+ Returns `true` if the passed object can be found in the enumerable.
15491
+ ```javascript
15492
+ [1, 2, 3].includes(2); // true
15493
+ [1, 2, 3].includes(4); // false
15494
+ [1, 2, undefined].includes(undefined); // true
15495
+ [1, 2, null].includes(null); // true
15496
+ [1, 2, NaN].includes(NaN); // true
15497
+ ```
15498
+ @method includes
15499
+ @param {Object} obj The object to search for.
15500
+ @return {Boolean} `true` if object is found in the enumerable.
15501
+ @public
15502
+ */
15503
+ includes: function (obj) {
15504
+ _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1);
15187
15505
 
15188
- without: function (value) {
15189
- if (!this.includes(value)) {
15190
- return this; // nothing to do
15191
- }
15506
+ var len = _emberMetal.get(this, 'length');
15507
+ var idx = undefined,
15508
+ next = undefined;
15509
+ var last = null;
15510
+ var found = false;
15192
15511
 
15193
- var ret = emberA();
15512
+ var context = popCtx();
15194
15513
 
15195
- this.forEach(function (k) {
15196
- // SameValueZero comparison (NaN !== NaN)
15197
- if (!(k === value || k !== k && value !== value)) {
15198
- ret[ret.length] = k;
15199
- }
15200
- });
15514
+ for (idx = 0; idx < len && !found; idx++) {
15515
+ next = this.nextObject(idx, last, context);
15201
15516
 
15202
- return ret;
15517
+ found = obj === next || obj !== obj && next !== next;
15518
+
15519
+ last = next;
15203
15520
  }
15204
- });
15205
- }
15521
+
15522
+ next = last = null;
15523
+ context = pushCtx(context);
15524
+
15525
+ return found;
15526
+ }
15527
+ });
15206
15528
 
15207
15529
  exports.default = Enumerable;
15208
15530
  });
@@ -15796,13 +16118,7 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-r
15796
16118
  @public
15797
16119
  */
15798
16120
  addObject: function (obj) {
15799
- var included = undefined;
15800
-
15801
- if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {
15802
- included = this.includes(obj);
15803
- } else {
15804
- included = this.contains(obj);
15805
- }
16121
+ var included = this.includes(obj);
15806
16122
 
15807
16123
  if (!included) {
15808
16124
  this.pushObject(obj);
@@ -16059,7 +16375,7 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (
16059
16375
  args[_key] = arguments[_key];
16060
16376
  }
16061
16377
 
16062
- return _emberMetal.getProperties.apply(null, [this].concat(args));
16378
+ return _emberMetal.getProperties.apply(undefined, [this].concat(args));
16063
16379
  },
16064
16380
 
16065
16381
  /**
@@ -16215,34 +16531,31 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (
16215
16531
  will be notified. Note that the observers are triggered any time the
16216
16532
  value is set, regardless of whether it has actually changed. Your
16217
16533
  observer should be prepared to handle that.
16218
- You can also pass an optional context parameter to this method. The
16219
- context will be passed to your observer method whenever it is triggered.
16220
- Note that if you add the same target/method pair on a key multiple times
16221
- with different context parameters, your observer will only be called once
16222
- with the last context you passed.
16223
16534
  ### Observer Methods
16224
- Observer methods you pass should generally have the following signature if
16225
- you do not pass a `context` parameter:
16535
+ Observer methods have the following signature:
16226
16536
  ```javascript
16227
- fooDidChange: function(sender, key, value, rev) { };
16537
+ export default Ember.Component.extend({
16538
+ init() {
16539
+ this._super(...arguments);
16540
+ this.addObserver('foo', this, 'fooDidChange');
16541
+ },
16542
+ fooDidChange(sender, key, value, rev) {
16543
+ // your code
16544
+ }
16545
+ });
16228
16546
  ```
16229
- The sender is the object that changed. The key is the property that
16230
- changes. The value property is currently reserved and unused. The rev
16547
+ The `sender` is the object that changed. The `key` is the property that
16548
+ changes. The `value` property is currently reserved and unused. The `rev`
16231
16549
  is the last property revision of the object when it changed, which you can
16232
16550
  use to detect if the key value has really changed or not.
16233
- If you pass a `context` parameter, the context will be passed before the
16234
- revision like so:
16235
- ```javascript
16236
- fooDidChange: function(sender, key, value, context, rev) { };
16237
- ```
16238
- Usually you will not need the value, context or revision parameters at
16551
+ Usually you will not need the value or revision parameters at
16239
16552
  the end. In this case, it is common to write observer methods that take
16240
16553
  only a sender and key value as parameters or, if you aren't interested in
16241
16554
  any of these values, to write an observer that has no parameters at all.
16242
16555
  @method addObserver
16243
- @param {String} key The key to observe
16556
+ @param {String} key The key to observer
16244
16557
  @param {Object} target The target object to invoke
16245
- @param {String|Function} method The method to invoke
16558
+ @param {String|Function} method The method to invoke.
16246
16559
  @public
16247
16560
  */
16248
16561
  addObserver: function (key, target, method) {
@@ -16254,9 +16567,9 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (
16254
16567
  the same key, target, and method you passed to `addObserver()` and your
16255
16568
  target will no longer receive notifications.
16256
16569
  @method removeObserver
16257
- @param {String} key The key to observe
16570
+ @param {String} key The key to observer
16258
16571
  @param {Object} target The target object to invoke
16259
- @param {String|Function} method The method to invoke
16572
+ @param {String|Function} method The method to invoke.
16260
16573
  @public
16261
16574
  */
16262
16575
  removeObserver: function (key, target, method) {
@@ -16933,10 +17246,14 @@ enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environm
16933
17246
  var ret = undefined;
16934
17247
 
16935
17248
  if (target.send) {
16936
- ret = target.send.apply(target, args(actionContext, action));
17249
+ var _target;
17250
+
17251
+ ret = (_target = target).send.apply(_target, args(actionContext, action));
16937
17252
  } else {
17253
+ var _target2;
17254
+
16938
17255
  _emberMetal.assert('The action \'' + action + '\' did not exist on ' + target, typeof target[action] === 'function');
16939
- ret = target[action].apply(target, args(actionContext));
17256
+ ret = (_target2 = target)[action].apply(_target2, args(actionContext));
16940
17257
  }
16941
17258
 
16942
17259
  if (ret !== false) {
@@ -17402,133 +17719,137 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
17402
17719
  // possible.
17403
17720
 
17404
17721
  var wasApplied = false;
17405
- var initProperties;
17722
+ var initProperties = undefined;
17406
17723
 
17407
- var Class = function () {
17408
- if (!wasApplied) {
17409
- Class.proto(); // prepare prototype...
17410
- }
17411
-
17412
- if (arguments.length > 0) {
17413
- initProperties = [arguments[0]];
17414
- }
17724
+ var Class = (function () {
17725
+ function Class() {
17726
+ if (!wasApplied) {
17727
+ Class.proto(); // prepare prototype...
17728
+ }
17415
17729
 
17416
- this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY);
17417
- var m = _emberMetal.meta(this);
17418
- var proto = m.proto;
17419
- m.proto = this;
17420
- if (initProperties) {
17421
- // capture locally so we can clear the closed over variable
17422
- var props = initProperties;
17423
- initProperties = null;
17730
+ if (arguments.length > 0) {
17731
+ initProperties = [arguments[0]];
17732
+ }
17424
17733
 
17425
- var concatenatedProperties = this.concatenatedProperties;
17426
- var mergedProperties = this.mergedProperties;
17734
+ this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY);
17735
+ var m = _emberMetal.meta(this);
17736
+ var proto = m.proto;
17737
+ m.proto = this;
17738
+ if (initProperties) {
17739
+ // capture locally so we can clear the closed over variable
17740
+ var props = initProperties;
17741
+ initProperties = null;
17427
17742
 
17428
- for (var i = 0; i < props.length; i++) {
17429
- var properties = props[i];
17743
+ var concatenatedProperties = this.concatenatedProperties;
17744
+ var mergedProperties = this.mergedProperties;
17430
17745
 
17431
- _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin));
17746
+ for (var i = 0; i < props.length; i++) {
17747
+ var properties = props[i];
17748
+ _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin));
17432
17749
 
17433
- if (typeof properties !== 'object' && properties !== undefined) {
17434
- throw new _emberMetal.Error('Ember.Object.create only accepts objects.');
17435
- }
17750
+ if (typeof properties !== 'object' && properties !== undefined) {
17751
+ throw new _emberMetal.Error('Ember.Object.create only accepts objects.');
17752
+ }
17436
17753
 
17437
- if (!properties) {
17438
- continue;
17439
- }
17754
+ if (!properties) {
17755
+ continue;
17756
+ }
17440
17757
 
17441
- var keyNames = Object.keys(properties);
17758
+ var keyNames = Object.keys(properties);
17442
17759
 
17443
- for (var j = 0; j < keyNames.length; j++) {
17444
- var keyName = keyNames[j];
17445
- var value = properties[keyName];
17760
+ for (var j = 0; j < keyNames.length; j++) {
17761
+ var keyName = keyNames[j];
17762
+ var value = properties[keyName];
17446
17763
 
17447
- if (_emberMetal.detectBinding(keyName)) {
17448
- m.writeBindings(keyName, value);
17449
- }
17764
+ if (_emberMetal.detectBinding(keyName)) {
17765
+ m.writeBindings(keyName, value);
17766
+ }
17450
17767
 
17451
- var possibleDesc = this[keyName];
17452
- var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
17768
+ var possibleDesc = this[keyName];
17769
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
17453
17770
 
17454
- _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty));
17455
- _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));
17456
- _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this)));
17771
+ _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty));
17772
+ _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));
17773
+ _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this)));
17457
17774
 
17458
- if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) {
17459
- var baseValue = this[keyName];
17775
+ if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) {
17776
+ var baseValue = this[keyName];
17460
17777
 
17461
- if (baseValue) {
17462
- if ('function' === typeof baseValue.concat) {
17463
- value = baseValue.concat(value);
17778
+ if (baseValue) {
17779
+ if ('function' === typeof baseValue.concat) {
17780
+ value = baseValue.concat(value);
17781
+ } else {
17782
+ value = _emberUtils.makeArray(baseValue).concat(value);
17783
+ }
17464
17784
  } else {
17465
- value = _emberUtils.makeArray(baseValue).concat(value);
17785
+ value = _emberUtils.makeArray(value);
17466
17786
  }
17467
- } else {
17468
- value = _emberUtils.makeArray(value);
17469
17787
  }
17470
- }
17471
17788
 
17472
- if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) {
17473
- var originalValue = this[keyName];
17789
+ if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) {
17790
+ var originalValue = this[keyName];
17474
17791
 
17475
- value = _emberUtils.assign({}, originalValue, value);
17476
- }
17792
+ value = _emberUtils.assign({}, originalValue, value);
17793
+ }
17477
17794
 
17478
- if (desc) {
17479
- desc.set(this, keyName, value);
17480
- } else {
17481
- if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {
17482
- this.setUnknownProperty(keyName, value);
17795
+ if (desc) {
17796
+ desc.set(this, keyName, value);
17483
17797
  } else {
17484
- if (_emberMetal.isFeatureEnabled('mandatory-setter')) {
17485
- _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter
17798
+ if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {
17799
+ this.setUnknownProperty(keyName, value);
17486
17800
  } else {
17487
- this[keyName] = value;
17488
- }
17801
+ if (_emberMetal.isFeatureEnabled('mandatory-setter')) {
17802
+ _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter
17803
+ } else {
17804
+ this[keyName] = value;
17805
+ }
17806
+ }
17489
17807
  }
17490
17808
  }
17491
17809
  }
17492
17810
  }
17493
- }
17494
17811
 
17495
- finishPartial(this, m);
17812
+ finishPartial(this, m);
17496
17813
 
17497
- this.init.apply(this, arguments);
17814
+ this.init.apply(this, arguments);
17498
17815
 
17499
- this[POST_INIT]();
17500
-
17501
- m.proto = proto;
17502
- _emberMetal.finishChains(this);
17503
- _emberMetal.sendEvent(this, 'init');
17504
- };
17816
+ this[POST_INIT]();
17505
17817
 
17506
- Class.toString = _emberMetal.Mixin.prototype.toString;
17507
- Class.willReopen = function () {
17508
- if (wasApplied) {
17509
- Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin);
17818
+ m.proto = proto;
17819
+ _emberMetal.finishChains(this);
17820
+ _emberMetal.sendEvent(this, 'init');
17510
17821
  }
17511
17822
 
17512
- wasApplied = false;
17513
- };
17823
+ Class.willReopen = function willReopen() {
17824
+ if (wasApplied) {
17825
+ Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin);
17826
+ }
17514
17827
 
17515
- Class._initProperties = function (args) {
17516
- initProperties = args;
17517
- };
17828
+ wasApplied = false;
17829
+ };
17518
17830
 
17519
- Class.proto = function () {
17520
- var superclass = Class.superclass;
17521
- if (superclass) {
17522
- superclass.proto();
17523
- }
17831
+ Class._initProperties = function _initProperties(args) {
17832
+ initProperties = args;
17833
+ };
17524
17834
 
17525
- if (!wasApplied) {
17526
- wasApplied = true;
17527
- Class.PrototypeMixin.applyPartial(Class.prototype);
17528
- }
17835
+ Class.proto = function proto() {
17836
+ var superclass = Class.superclass;
17837
+ if (superclass) {
17838
+ superclass.proto();
17839
+ }
17529
17840
 
17530
- return this.prototype;
17531
- };
17841
+ if (!wasApplied) {
17842
+ wasApplied = true;
17843
+ Class.PrototypeMixin.applyPartial(Class.prototype);
17844
+ }
17845
+
17846
+ return this.prototype;
17847
+ };
17848
+
17849
+ return Class;
17850
+ })();
17851
+
17852
+ Class.toString = _emberMetal.Mixin.prototype.toString;
17532
17853
 
17533
17854
  return Class;
17534
17855
  }
@@ -17633,7 +17954,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
17633
17954
  }, _Mixin$create.toString = function () {
17634
17955
  var hasToStringExtension = typeof this.toStringExtension === 'function';
17635
17956
  var extension = hasToStringExtension ? ':' + this.toStringExtension() : '';
17636
- var ret = '<' + this.constructor.toString() + ':' + _emberUtils.guidFor(this) + extension + '>';
17957
+ var ret = '<' + (this[_emberUtils.NAME_KEY] || this.constructor.toString()) + ':' + _emberUtils.guidFor(this) + extension + '>';
17637
17958
 
17638
17959
  return ret;
17639
17960
  }, _Mixin$create));
@@ -17653,7 +17974,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
17653
17974
  isMethod: false
17654
17975
  }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () {
17655
17976
  var Class = makeCtor();
17656
- var proto;
17977
+ var proto = undefined;
17657
17978
  Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin);
17658
17979
  Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin);
17659
17980
 
@@ -17709,27 +18030,27 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
17709
18030
  var possibleDesc = proto[key];
17710
18031
  var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
17711
18032
 
17712
- _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty);
18033
+ _emberMetal.assert('metaForProperty() could not find a computed property with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty);
17713
18034
  return desc._meta || {};
17714
18035
  }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () {
17715
18036
  hasCachedComputedProperties = true;
17716
18037
  var proto = this.proto();
17717
- var property;
18038
+ var property = undefined;
17718
18039
  var properties = [];
17719
18040
 
17720
- for (var name in proto) {
17721
- property = proto[name];
18041
+ for (var _name in proto) {
18042
+ property = proto[_name];
17722
18043
 
17723
18044
  if (property && property.isDescriptor) {
17724
18045
  properties.push({
17725
- name: name,
18046
+ name: _name,
17726
18047
  meta: property._meta
17727
18048
  });
17728
18049
  }
17729
18050
  }
17730
18051
  return properties;
17731
18052
  }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) {
17732
- var property;
18053
+ var property = undefined;
17733
18054
  var empty = {};
17734
18055
 
17735
18056
  var properties = _emberMetal.get(this, '_computedProperties');
@@ -17764,7 +18085,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
17764
18085
  ClassMixinProps._lazyInjections = function () {
17765
18086
  var injections = {};
17766
18087
  var proto = this.proto();
17767
- var key, desc;
18088
+ var key = undefined;
18089
+ var desc = undefined;
17768
18090
 
17769
18091
  for (key in proto) {
17770
18092
  desc = proto[key];
@@ -18020,7 +18342,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
18020
18342
  ```javascript
18021
18343
  const Person = Ember.Object.extend({
18022
18344
  say(thing) {
18023
- var name = this.get('name');
18345
+ let name = this.get('name');
18024
18346
  alert(`${name} says: ${thing}`);
18025
18347
  }
18026
18348
  });
@@ -18175,7 +18497,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met
18175
18497
  You can pass a hash of these values to a computed property like this:
18176
18498
  ```javascript
18177
18499
  person: Ember.computed(function() {
18178
- var personId = this.get('personId');
18500
+ let personId = this.get('personId');
18179
18501
  return Person.create({ id: personId });
18180
18502
  }).meta({ type: Person })
18181
18503
  ```
@@ -18640,6 +18962,8 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-en
18640
18962
  */
18641
18963
  'use strict';
18642
18964
 
18965
+ var _NativeArray;
18966
+
18643
18967
  // Add Ember.Array to Array.prototype. Remove methods with native
18644
18968
  // implementations and supply some more optimized versions of generic methods
18645
18969
  // because they are so common.
@@ -18729,7 +19053,7 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-en
18729
19053
  });
18730
19054
 
18731
19055
  exports.NativeArray // TODO: only use default export
18732
- = NativeArray = NativeArray.without.apply(NativeArray, ignore);
19056
+ = NativeArray = (_NativeArray = NativeArray).without.apply(_NativeArray, ignore);
18733
19057
 
18734
19058
  /**
18735
19059
  Creates an `Ember.NativeArray` from an Array like object.
@@ -19414,12 +19738,12 @@ enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-r
19414
19738
  enifed("ember/features", ["exports"], function (exports) {
19415
19739
  "use strict";
19416
19740
 
19417
- exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true };
19741
+ exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-improved-instrumentation": false, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "ember-factory-for": true, "ember-no-double-extend": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true };
19418
19742
  });
19419
19743
  enifed("ember/version", ["exports"], function (exports) {
19420
19744
  "use strict";
19421
19745
 
19422
- exports.default = "2.11.3";
19746
+ exports.default = "2.12.0-beta.1";
19423
19747
  });
19424
19748
  enifed('rsvp', ['exports'], function (exports) {
19425
19749
  'use strict';
@@ -19843,7 +20167,6 @@ enifed('rsvp', ['exports'], function (exports) {
19843
20167
  } else {
19844
20168
  if (then$$ === GET_THEN_ERROR) {
19845
20169
  reject(promise, GET_THEN_ERROR.error);
19846
- GET_THEN_ERROR.error = null;
19847
20170
  } else if (then$$ === undefined) {
19848
20171
  fulfill(promise, maybeThenable);
19849
20172
  } else if (isFunction(then$$)) {
@@ -19971,10 +20294,10 @@ enifed('rsvp', ['exports'], function (exports) {
19971
20294
  if (value === TRY_CATCH_ERROR) {
19972
20295
  failed = true;
19973
20296
  error = value.error;
19974
- value.error = null; // release
20297
+ value = null;
19975
20298
  } else {
19976
- succeeded = true;
19977
- }
20299
+ succeeded = true;
20300
+ }
19978
20301
 
19979
20302
  if (promise === value) {
19980
20303
  reject(promise, withOwnPromise());
@@ -20758,7 +21081,7 @@ enifed('rsvp', ['exports'], function (exports) {
20758
21081
  try {
20759
21082
  return findAuthor(); // succeed or fail
20760
21083
  } catch(error) {
20761
- return findOtherAuthor();
21084
+ return findOtherAuther();
20762
21085
  } finally {
20763
21086
  // always runs
20764
21087
  // doesn't affect the return value
@@ -20769,7 +21092,7 @@ enifed('rsvp', ['exports'], function (exports) {
20769
21092
 
20770
21093
  ```js
20771
21094
  findAuthor().catch(function(reason){
20772
- return findOtherAuthor();
21095
+ return findOtherAuther();
20773
21096
  }).finally(function(){
20774
21097
  // author was either found, or not
20775
21098
  });