ember-source 2.18.2 → 3.0.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
  SHA256:
3
- metadata.gz: ff2f362bd7e57fd5a1cc22508caa36c91acab8dd60cd5e85cfb88f3141b99150
4
- data.tar.gz: 79e301edaad5b4137976e34d560d97ebf48c8bd91a4762d1f6422735e8c1cd17
3
+ metadata.gz: 767aa99d524af25f77b556b708430bd94091a07d7599f1880edec25394bda0d8
4
+ data.tar.gz: df8a0bc3d99c799a1ca8b789f5ce715da2456fe5633eb1b61239a81c8a985a14
5
5
  SHA512:
6
- metadata.gz: bb7977b177d602a2109d79bda376b88c73ed3f6b8bc51bee38ccc4cbe9631e6379ca9828163ca919a2a7fe48662b8eb070fe99b3d41db5fd1169d0f249e6aacf
7
- data.tar.gz: 98dda3212e0649fea3a630a04a4ae8ef02dae6c979fad95beeebcbebbc27250175e2dfee6194b368fdf2bfca2fff385e7189425a74470dff29b2cae1fc363c42
6
+ metadata.gz: 8a35ae1e8487074bc9379983fe043140cec35eacabee5ad1ec8847849401a53d0305ce4bf66c0b877bc32953963e15909038f9eeed90c8b3280aa655953ad87b
7
+ data.tar.gz: ba81b6bcbcfc0c483c56d38b3e485f3efd292b2df0cb35ca9dcd501c56e74659ca18cda64ce28f3c3b9ed2c6e6313cbfe0c0d2d66c37b3fbbc157769e0011af7
@@ -1,17 +1,19 @@
1
1
  (function() {
2
2
  /*!
3
3
  * @overview Ember - JavaScript Application Framework
4
- * @copyright Copyright 2011-2017 Tilde Inc. and contributors
4
+ * @copyright Copyright 2011-2018 Tilde Inc. and contributors
5
5
  * Portions Copyright 2006-2011 Strobe Inc.
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.18.2
9
+ * @version 3.0.0-beta.1
10
10
  */
11
11
 
12
- /*global process */
12
+ /*globals process */
13
13
  var enifed, requireModule, Ember;
14
- var mainContext = this; // Used in ember-environment/lib/global.js
14
+
15
+ // Used in ember-environment/lib/global.js
16
+ mainContext = this; // eslint-disable-line no-undef
15
17
 
16
18
  (function() {
17
19
  function missingModule(name, referrerName) {
@@ -113,29 +115,11 @@ var mainContext = this; // Used in ember-environment/lib/global.js
113
115
  }
114
116
  })();
115
117
 
116
- enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features) {
118
+ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features', 'ember-environment'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features, _emberEnvironment) {
117
119
  'use strict';
118
120
 
119
121
  exports.Container = exports.privatize = exports.Registry = undefined;
120
122
 
121
-
122
- /* globals Proxy */
123
- var CONTAINER_OVERRIDE = (0, _emberUtils.symbol)('CONTAINER_OVERRIDE');
124
-
125
- /**
126
- A container used to instantiate and cache objects.
127
-
128
- Every `Container` must be associated with a `Registry`, which is referenced
129
- to determine the factory and options that should be used to instantiate
130
- objects.
131
-
132
- The public API for `Container` is still in flux and should not be considered
133
- stable.
134
-
135
- @private
136
- @class Container
137
- */
138
-
139
123
  var Container = function () {
140
124
  function Container(registry) {
141
125
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -145,7 +129,6 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
145
129
  this.owner = options.owner || null;
146
130
  this.cache = (0, _emberUtils.dictionary)(options.cache || null);
147
131
  this.factoryManagerCache = (0, _emberUtils.dictionary)(options.factoryManagerCache || null);
148
- this[CONTAINER_OVERRIDE] = undefined;
149
132
  this.isDestroyed = false;
150
133
 
151
134
  if (true) {
@@ -297,7 +280,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
297
280
  function wrapManagerInDeprecationProxy(manager) {
298
281
  if (_emberUtils.HAS_NATIVE_PROXY) {
299
282
  var validator = {
300
- set: function (obj, prop, value) {
283
+ set: function (obj, prop) {
301
284
  throw new Error('You attempted to set "' + prop + '" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.');
302
285
  }
303
286
  };
@@ -558,6 +541,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
558
541
  }();
559
542
 
560
543
  var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/;
544
+ var missingResolverFunctionsDeprecation = 'Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.';
561
545
 
562
546
  /**
563
547
  A registry used to store factory and option information keyed
@@ -581,7 +565,11 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
581
565
  this.fallback = options.fallback || null;
582
566
  this.resolver = options.resolver || null;
583
567
 
584
- if (typeof this.resolver === 'function') {
568
+ if (_emberEnvironment.ENV._ENABLE_RESOLVER_FUNCTION_SUPPORT !== true) {
569
+ (true && !(typeof this.resolver !== 'function') && (0, _emberDebug.assert)(missingResolverFunctionsDeprecation, typeof this.resolver !== 'function'));
570
+ }
571
+
572
+ if (typeof this.resolver === 'function' && _emberEnvironment.ENV._ENABLE_RESOLVER_FUNCTION_SUPPORT === true) {
585
573
  deprecateResolverFunction(this);
586
574
  }
587
575
 
@@ -593,7 +581,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
593
581
  this._localLookupCache = Object.create(null);
594
582
  this._normalizeCache = (0, _emberUtils.dictionary)(null);
595
583
  this._resolveCache = (0, _emberUtils.dictionary)(null);
596
- this._failCache = (0, _emberUtils.dictionary)(null);
584
+ this._failSet = new Set();
597
585
 
598
586
  this._options = (0, _emberUtils.dictionary)(null);
599
587
  this._typeOptions = (0, _emberUtils.dictionary)(null);
@@ -678,7 +666,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
678
666
  (true && !(!this._resolveCache[normalizedName]) && (0, _emberDebug.assert)('Cannot re-register: \'' + fullName + '\', as it has already been resolved.', !this._resolveCache[normalizedName]));
679
667
 
680
668
 
681
- delete this._failCache[normalizedName];
669
+ this._failSet.delete(normalizedName);
682
670
  this.registrations[normalizedName] = factory;
683
671
  this._options[normalizedName] = options;
684
672
  };
@@ -693,8 +681,8 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
693
681
 
694
682
  delete this.registrations[normalizedName];
695
683
  delete this._resolveCache[normalizedName];
696
- delete this._failCache[normalizedName];
697
684
  delete this._options[normalizedName];
685
+ this._failSet.delete(normalizedName);
698
686
  };
699
687
 
700
688
  Registry.prototype.resolve = function resolve(fullName, options) {
@@ -832,9 +820,6 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
832
820
  };
833
821
 
834
822
  Registry.prototype.knownForType = function knownForType(type) {
835
- var fallbackKnown = void 0,
836
- resolverKnown = void 0;
837
-
838
823
  var localKnown = (0, _emberUtils.dictionary)(null);
839
824
  var registeredNames = Object.keys(this.registrations);
840
825
  for (var index = 0; index < registeredNames.length; index++) {
@@ -846,6 +831,8 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
846
831
  }
847
832
  }
848
833
 
834
+ var fallbackKnown = void 0,
835
+ resolverKnown = void 0;
849
836
  if (this.fallback !== null) {
850
837
  fallbackKnown = this.fallback.knownForType(type);
851
838
  }
@@ -907,7 +894,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
907
894
  }();
908
895
 
909
896
  function deprecateResolverFunction(registry) {
910
- (true && !(false) && (0, _emberDebug.deprecate)('Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.', false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'https://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }));
897
+ (true && !(false) && (0, _emberDebug.deprecate)(missingResolverFunctionsDeprecation, false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'https://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }));
911
898
 
912
899
  registry.resolver = { resolve: registry.resolver };
913
900
  }
@@ -991,7 +978,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
991
978
  if (cached !== undefined) {
992
979
  return cached;
993
980
  }
994
- if (registry._failCache[cacheKey]) {
981
+ if (registry._failSet.has(cacheKey)) {
995
982
  return;
996
983
  }
997
984
 
@@ -1006,7 +993,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
1006
993
  }
1007
994
 
1008
995
  if (resolved === undefined) {
1009
- registry._failCache[cacheKey] = true;
996
+ registry._failSet.add(cacheKey);
1010
997
  } else {
1011
998
  registry._resolveCache[cacheKey] = resolved;
1012
999
  }
@@ -1120,41 +1107,8 @@ enifed('ember-babel', ['exports'], function (exports) {
1120
1107
 
1121
1108
  var slice = exports.slice = Array.prototype.slice;
1122
1109
  });
1123
- enifed('ember-console', ['exports', 'ember-environment'], function (exports, _emberEnvironment) {
1124
- 'use strict';
1125
-
1126
- function K() {}
1127
-
1128
- function consoleMethod(name) {
1129
- var consoleObj = void 0;
1130
- if (_emberEnvironment.context.imports.console) {
1131
- consoleObj = _emberEnvironment.context.imports.console;
1132
- } else if (typeof console !== 'undefined') {
1133
- // eslint-disable-line no-undef
1134
- consoleObj = console; // eslint-disable-line no-undef
1135
- }
1136
-
1137
- var method = typeof consoleObj === 'object' ? consoleObj[name] : null;
1138
-
1139
- if (typeof method !== 'function') {
1140
- return;
1141
- }
1142
-
1143
- return method.bind(consoleObj);
1144
- }
1145
-
1146
- function assertPolyfill(test, message) {
1147
- if (!test) {
1148
- try {
1149
- // attempt to preserve the stack
1150
- throw new Error('assertion failed: ' + message);
1151
- } catch (error) {
1152
- setTimeout(function () {
1153
- throw error;
1154
- }, 0);
1155
- }
1156
- }
1157
- }
1110
+ enifed("ember-console", ["exports"], function (exports) {
1111
+ "use strict";
1158
1112
 
1159
1113
  /**
1160
1114
  Inside Ember-Metal, simply uses the methods from `imports.console`.
@@ -1165,93 +1119,36 @@ enifed('ember-console', ['exports', 'ember-environment'], function (exports, _em
1165
1119
  @public
1166
1120
  */
1167
1121
  var index = {
1168
- /**
1169
- Logs the arguments to the console.
1170
- You can pass as many arguments as you want and they will be joined together with a space.
1171
- ```javascript
1172
- var foo = 1;
1173
- Ember.Logger.log('log value of foo:', foo);
1174
- // "log value of foo: 1" will be printed to the console
1175
- ```
1176
- @method log
1177
- @for Ember.Logger
1178
- @param {*} arguments
1179
- @public
1180
- */
1181
- log: consoleMethod('log') || K,
1122
+ log: function () {
1123
+ var _console;
1182
1124
 
1183
- /**
1184
- Prints the arguments to the console with a warning icon.
1185
- You can pass as many arguments as you want and they will be joined together with a space.
1186
- ```javascript
1187
- Ember.Logger.warn('Something happened!');
1188
- // "Something happened!" will be printed to the console with a warning icon.
1189
- ```
1190
- @method warn
1191
- @for Ember.Logger
1192
- @param {*} arguments
1193
- @public
1194
- */
1195
- warn: consoleMethod('warn') || K,
1125
+ return (_console = console).log.apply(_console, arguments);
1126
+ },
1127
+ warn: function () {
1128
+ var _console2;
1196
1129
 
1197
- /**
1198
- Prints the arguments to the console with an error icon, red text and a stack trace.
1199
- You can pass as many arguments as you want and they will be joined together with a space.
1200
- ```javascript
1201
- Ember.Logger.error('Danger! Danger!');
1202
- // "Danger! Danger!" will be printed to the console in red text.
1203
- ```
1204
- @method error
1205
- @for Ember.Logger
1206
- @param {*} arguments
1207
- @public
1208
- */
1209
- error: consoleMethod('error') || K,
1130
+ return (_console2 = console).warn.apply(_console2, arguments);
1131
+ },
1132
+ error: function () {
1133
+ var _console3;
1210
1134
 
1211
- /**
1212
- Logs the arguments to the console.
1213
- You can pass as many arguments as you want and they will be joined together with a space.
1214
- ```javascript
1215
- var foo = 1;
1216
- Ember.Logger.info('log value of foo:', foo);
1217
- // "log value of foo: 1" will be printed to the console
1218
- ```
1219
- @method info
1220
- @for Ember.Logger
1221
- @param {*} arguments
1222
- @public
1223
- */
1224
- info: consoleMethod('info') || K,
1135
+ return (_console3 = console).error.apply(_console3, arguments);
1136
+ },
1137
+ info: function () {
1138
+ var _console4;
1225
1139
 
1226
- /**
1227
- Logs the arguments to the console in blue text.
1228
- You can pass as many arguments as you want and they will be joined together with a space.
1229
- ```javascript
1230
- var foo = 1;
1231
- Ember.Logger.debug('log value of foo:', foo);
1232
- // "log value of foo: 1" will be printed to the console
1233
- ```
1234
- @method debug
1235
- @for Ember.Logger
1236
- @param {*} arguments
1237
- @public
1238
- */
1239
- debug: consoleMethod('debug') || consoleMethod('info') || K,
1140
+ return (_console4 = console).info.apply(_console4, arguments);
1141
+ },
1142
+ debug: function () {
1143
+ var _console5, _console6;
1240
1144
 
1241
- /**
1242
- If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
1243
- ```javascript
1244
- Ember.Logger.assert(true); // undefined
1245
- Ember.Logger.assert(true === false); // Throws an Assertion failed error.
1246
- Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message.
1247
- ```
1248
- @method assert
1249
- @for Ember.Logger
1250
- @param {Boolean} bool Value to test
1251
- @param {String} message Assertion message on failed
1252
- @public
1253
- */
1254
- assert: consoleMethod('assert') || assertPolyfill
1145
+ return console.debug && (_console5 = console).debug.apply(_console5, arguments) || (_console6 = console).info.apply(_console6, arguments); // eslint-disable-line no-console
1146
+ },
1147
+ assert: function () {
1148
+ var _console7;
1149
+
1150
+ return (_console7 = console).assert.apply(_console7, arguments);
1151
+ }
1255
1152
  };
1256
1153
 
1257
1154
  exports.default = index;
@@ -1396,7 +1293,6 @@ enifed('ember-environment', ['exports'], function (exports) {
1396
1293
  hasDOM: true,
1397
1294
  isChrome: !!window.chrome && !window.opera,
1398
1295
  isFirefox: typeof InstallTrigger !== 'undefined',
1399
- isPhantom: !!window.callPhantom,
1400
1296
  location: window.location,
1401
1297
  history: window.history,
1402
1298
  userAgent: window.navigator.userAgent,
@@ -1405,7 +1301,6 @@ enifed('ember-environment', ['exports'], function (exports) {
1405
1301
  hasDOM: false,
1406
1302
  isChrome: false,
1407
1303
  isFirefox: false,
1408
- isPhantom: false,
1409
1304
  location: null,
1410
1305
  history: null,
1411
1306
  userAgent: 'Lynx (textmode)',
@@ -1416,12 +1311,12 @@ enifed('ember-environment', ['exports'], function (exports) {
1416
1311
  exports.context = context;
1417
1312
  exports.environment = environment;
1418
1313
  });
1419
- enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-debug', 'ember-babel', 'ember/features', '@glimmer/reference', 'require', 'ember-console', 'backburner'], function (exports, emberEnvironment, emberUtils, emberDebug, emberBabel, ember_features, _glimmer_reference, require, Logger, Backburner) {
1314
+ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-debug', 'ember/features', 'ember-babel', '@glimmer/reference', 'require', 'backburner', 'ember-console'], function (exports, emberEnvironment, emberUtils, emberDebug, features, emberBabel, reference, require, Backburner, Logger) {
1420
1315
  'use strict';
1421
1316
 
1422
- require = 'default' in require ? require['default'] : require;
1423
- Logger = 'default' in Logger ? Logger['default'] : Logger;
1424
- Backburner = 'default' in Backburner ? Backburner['default'] : Backburner;
1317
+ require = require && require.hasOwnProperty('default') ? require['default'] : require;
1318
+ Backburner = Backburner && Backburner.hasOwnProperty('default') ? Backburner['default'] : Backburner;
1319
+ Logger = Logger && Logger.hasOwnProperty('default') ? Logger['default'] : Logger;
1425
1320
 
1426
1321
  /**
1427
1322
  @module ember
@@ -1642,11 +1537,16 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1642
1537
  */
1643
1538
  function addListener(obj, eventName, target, method, once) {
1644
1539
  true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to addListener', !!obj && !!eventName);
1645
- true && !(eventName !== 'didInitAttrs') && emberDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', {
1646
- id: 'ember-views.did-init-attrs',
1647
- until: '3.0.0',
1648
- url: 'https://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs'
1649
- });
1540
+
1541
+ if (emberEnvironment.ENV._ENABLE_DID_INIT_ATTRS_SUPPORT === true) {
1542
+ true && !(eventName !== 'didInitAttrs') && emberDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', {
1543
+ id: 'ember-views.did-init-attrs',
1544
+ until: '3.0.0',
1545
+ url: 'https://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs'
1546
+ });
1547
+ } else {
1548
+ true && !(eventName !== 'didInitAttrs') && emberDebug.assert('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + ' is no longer supported.', eventName !== 'didInitAttrs');
1549
+ }
1650
1550
 
1651
1551
  if (!method && 'function' === typeof target) {
1652
1552
  method = target;
@@ -1746,7 +1646,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1746
1646
  @param obj
1747
1647
  */
1748
1648
  function watchedEvents(obj) {
1749
- var meta$$1 = exports.peekMeta(obj);
1649
+ var meta$$1 = peekMeta(obj);
1750
1650
  return meta$$1 !== undefined ? meta$$1.watchedEvents() : [];
1751
1651
  }
1752
1652
 
@@ -1769,7 +1669,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1769
1669
  */
1770
1670
  function sendEvent(obj, eventName, params, actions, _meta) {
1771
1671
  if (actions === undefined) {
1772
- var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
1672
+ var meta$$1 = _meta === undefined ? peekMeta(obj) : _meta;
1773
1673
  actions = typeof meta$$1 === 'object' && meta$$1 !== null && meta$$1.matchingListeners(eventName);
1774
1674
  }
1775
1675
 
@@ -1821,7 +1721,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1821
1721
  @param {String} eventName
1822
1722
  */
1823
1723
  function hasListeners(obj, eventName) {
1824
- var meta$$1 = exports.peekMeta(obj);
1724
+ var meta$$1 = peekMeta(obj);
1825
1725
  if (meta$$1 === undefined) {
1826
1726
  return false;
1827
1727
  }
@@ -1839,7 +1739,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1839
1739
  */
1840
1740
  function listenersFor(obj, eventName) {
1841
1741
  var ret = [];
1842
- var meta$$1 = exports.peekMeta(obj);
1742
+ var meta$$1 = peekMeta(obj);
1843
1743
  var actions = meta$$1 !== undefined ? meta$$1.matchingListeners(eventName) : undefined;
1844
1744
 
1845
1745
  if (actions === undefined) {
@@ -1912,12 +1812,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1912
1812
  }
1913
1813
 
1914
1814
  function makeTag() {
1915
- return new _glimmer_reference.DirtyableTag();
1815
+ return new reference.DirtyableTag();
1916
1816
  }
1917
1817
 
1918
1818
  function tagForProperty(object, propertyKey, _meta) {
1919
1819
  if (typeof object !== 'object' || object === null) {
1920
- return _glimmer_reference.CONSTANT_TAG;
1820
+ return reference.CONSTANT_TAG;
1921
1821
  }
1922
1822
 
1923
1823
  var meta$$1 = _meta === undefined ? meta(object) : _meta;
@@ -1939,7 +1839,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1939
1839
  var meta$$1 = _meta === undefined ? meta(object) : _meta;
1940
1840
  return meta$$1.writableTag(makeTag);
1941
1841
  } else {
1942
- return _glimmer_reference.CONSTANT_TAG;
1842
+ return reference.CONSTANT_TAG;
1943
1843
  }
1944
1844
  }
1945
1845
 
@@ -2049,175 +1949,23 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2049
1949
  return ObserverSet;
2050
1950
  }();
2051
1951
 
2052
- /**
2053
- @module ember
2054
- */
2055
- var id = 0;
2056
-
2057
- // Returns whether Type(value) is Object according to the terminology in the spec
2058
- function isObject$1(value) {
2059
- return typeof value === 'object' && value !== null || typeof value === 'function';
2060
- }
2061
-
2062
- /*
2063
- * @class Ember.WeakMap
2064
- * @public
2065
- * @category ember-metal-weakmap
2066
- *
2067
- * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects).
2068
- *
2069
- * There is a small but important caveat. This implementation assumes that the
2070
- * weak map will live longer (in the sense of garbage collection) than all of its
2071
- * keys, otherwise it is possible to leak the values stored in the weak map. In
2072
- * practice, most use cases satisfy this limitation which is why it is included
2073
- * in ember-metal.
2074
- */
2075
- var WeakMapPolyfill = function () {
2076
- function WeakMapPolyfill(iterable) {
2077
- emberBabel.classCallCheck(this, WeakMapPolyfill);
2078
-
2079
- this._id = emberUtils.GUID_KEY + id++;
2080
-
2081
- if (iterable === null || iterable === undefined) {
2082
- return;
2083
- } else if (Array.isArray(iterable)) {
2084
- for (var i = 0; i < iterable.length; i++) {
2085
- var _iterable$i = iterable[i],
2086
- key = _iterable$i[0],
2087
- value = _iterable$i[1];
2088
-
2089
- this.set(key, value);
2090
- }
2091
- } else {
2092
- throw new TypeError('The weak map constructor polyfill only supports an array argument');
2093
- }
2094
- }
2095
-
2096
- /*
2097
- * @method get
2098
- * @param key {Object | Function}
2099
- * @return {Any} stored value
2100
- */
2101
-
2102
- WeakMapPolyfill.prototype.get = function get(obj) {
2103
- if (!isObject$1(obj)) {
2104
- return undefined;
2105
- }
2106
-
2107
- var meta$$1 = exports.peekMeta(obj);
2108
- if (meta$$1 !== undefined) {
2109
- var map = meta$$1.readableWeak();
2110
- if (map !== undefined) {
2111
- var val = map[this._id];
2112
- if (val === UNDEFINED) {
2113
- return undefined;
2114
- }
2115
- return val;
2116
- }
2117
- }
2118
- };
2119
-
2120
- /*
2121
- * @method set
2122
- * @param key {Object | Function}
2123
- * @param value {Any}
2124
- * @return {WeakMap} the weak map
2125
- */
2126
-
2127
- WeakMapPolyfill.prototype.set = function set(obj, value) {
2128
- if (!isObject$1(obj)) {
2129
- throw new TypeError('Invalid value used as weak map key');
2130
- }
2131
-
2132
- if (value === undefined) {
2133
- value = UNDEFINED;
2134
- }
2135
-
2136
- meta(obj).writableWeak()[this._id] = value;
2137
-
2138
- return this;
2139
- };
2140
-
2141
- /*
2142
- * @method has
2143
- * @param key {Object | Function}
2144
- * @return {boolean} if the key exists
2145
- */
2146
-
2147
- WeakMapPolyfill.prototype.has = function has(obj) {
2148
- if (!isObject$1(obj)) {
2149
- return false;
2150
- }
2151
-
2152
- var meta$$1 = exports.peekMeta(obj);
2153
- if (meta$$1 !== undefined) {
2154
- var map = meta$$1.readableWeak();
2155
- if (map !== undefined) {
2156
- return map[this._id] !== undefined;
2157
- }
2158
- }
2159
-
2160
- return false;
2161
- };
2162
-
2163
- /*
2164
- * @method delete
2165
- * @param key {Object | Function}
2166
- * @return {boolean} if the key was deleted
2167
- */
2168
-
2169
- WeakMapPolyfill.prototype.delete = function _delete(obj) {
2170
- if (this.has(obj)) {
2171
- delete exports.peekMeta(obj).writableWeak()[this._id];
2172
- return true;
2173
- } else {
2174
- return false;
2175
- }
2176
- };
2177
-
2178
- /*
2179
- * @method toString
2180
- * @return {String}
2181
- */
2182
-
2183
- WeakMapPolyfill.prototype.toString = function toString$$1() {
2184
- return '[object WeakMap]';
2185
- };
2186
-
2187
- return WeakMapPolyfill;
2188
- }();
2189
-
2190
- var WeakMap$1 = emberUtils.HAS_NATIVE_WEAKMAP ? WeakMap : WeakMapPolyfill;
2191
-
2192
1952
  exports.runInTransaction = void 0;
2193
1953
  exports.didRender = void 0;
2194
1954
  exports.assertNotRendered = void 0;
2195
1955
 
2196
1956
  // detect-backtracking-rerender by default is debug build only
2197
- // detect-glimmer-allow-backtracking-rerender can be enabled in custom builds
2198
- if (ember_features.EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER || ember_features.EMBER_GLIMMER_ALLOW_BACKTRACKING_RERENDER) {
1957
+ if (features.EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) {
2199
1958
 
2200
- // there are 4 states
1959
+ // there are 2 states
2201
1960
 
2202
- // NATIVE WEAKMAP AND DEBUG
1961
+ // DEBUG
2203
1962
  // tracks lastRef and lastRenderedIn per rendered object and key during a transaction
2204
1963
  // release everything via normal weakmap semantics by just derefencing the weakmap
2205
1964
 
2206
- // NATIVE WEAKMAP AND RELEASE
1965
+ // RELEASE
2207
1966
  // tracks transactionId per rendered object and key during a transaction
2208
1967
  // release everything via normal weakmap semantics by just derefencing the weakmap
2209
1968
 
2210
- // WEAKMAP POLYFILL AND DEBUG
2211
- // tracks lastRef and lastRenderedIn per rendered object and key during a transaction
2212
- // since lastRef retains a lot of app state (will have a ref to the Container)
2213
- // if the object rendered is retained (like a immutable POJO in module state)
2214
- // during acceptance tests this adds up and obfuscates finding other leaks.
2215
-
2216
- // WEAKMAP POLYFILL AND RELEASE
2217
- // tracks transactionId per rendered object and key during a transaction
2218
- // leaks it because small and likely not worth tracking it since it will only
2219
- // be leaked if the object is retained
2220
-
2221
1969
  var TransactionRunner = function () {
2222
1970
  function TransactionRunner() {
2223
1971
  emberBabel.classCallCheck(this, TransactionRunner);
@@ -2225,16 +1973,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2225
1973
  this.transactionId = 0;
2226
1974
  this.inTransaction = false;
2227
1975
  this.shouldReflush = false;
2228
- this.weakMap = new WeakMap$1();
1976
+ this.weakMap = new WeakMap();
2229
1977
  {
2230
1978
  // track templates
2231
1979
  this.debugStack = undefined;
2232
-
2233
- if (!emberUtils.HAS_NATIVE_WEAKMAP) {
2234
- // DEBUG AND POLYFILL
2235
- // needs obj tracking
2236
- this.objs = [];
2237
- }
2238
1980
  }
2239
1981
  }
2240
1982
 
@@ -2248,13 +1990,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2248
1990
  return this.shouldReflush;
2249
1991
  };
2250
1992
 
2251
- TransactionRunner.prototype.didRender = function didRender(object, key, reference) {
1993
+ TransactionRunner.prototype.didRender = function didRender(object, key, reference$$1) {
2252
1994
  if (!this.inTransaction) {
2253
1995
  return;
2254
1996
  }
2255
1997
  {
2256
1998
  this.setKey(object, key, {
2257
- lastRef: reference,
1999
+ lastRef: reference$$1,
2258
2000
  lastRenderedIn: this.debugStack.peek()
2259
2001
  });
2260
2002
  }
@@ -2286,13 +2028,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2286
2028
  label = 'the same value';
2287
2029
  }
2288
2030
 
2289
- var message = 'You modified "' + label + '" twice on ' + object + ' in a single render. It was rendered in ' + lastRenderedIn + ' and modified in ' + currentlyIn + '. This was unreliable and slow in Ember 1.x and';
2290
-
2291
- if (ember_features.EMBER_GLIMMER_ALLOW_BACKTRACKING_RERENDER) {
2292
- true && !false && emberDebug.deprecate(message + ' will be removed in Ember 3.0.', false, { id: 'ember-views.render-double-modify', until: '3.0.0' });
2293
- } else {
2294
- true && !false && emberDebug.assert(message + ' is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false);
2295
- }
2031
+ true && !false && emberDebug.assert('You modified "' + label + '" twice on ' + object + ' in a single render. It was rendered in ' + lastRenderedIn + ' and modified in ' + currentlyIn + '. This was unreliable and slow in Ember 1.x and is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false);
2296
2032
  }
2297
2033
 
2298
2034
  this.shouldReflush = true;
@@ -2329,11 +2065,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2329
2065
  TransactionRunner.prototype.createMap = function createMap(object) {
2330
2066
  var map = Object.create(null);
2331
2067
  this.weakMap.set(object, map);
2332
- if (true && !emberUtils.HAS_NATIVE_WEAKMAP) {
2333
- // POLYFILL AND DEBUG
2334
- // requires tracking objects
2335
- this.objs.push(object);
2336
- }
2337
2068
  return map;
2338
2069
  };
2339
2070
 
@@ -2358,28 +2089,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2358
2089
  };
2359
2090
 
2360
2091
  TransactionRunner.prototype.clearObjectMap = function clearObjectMap() {
2361
- if (emberUtils.HAS_NATIVE_WEAKMAP) {
2362
- // NATIVE AND (DEBUG OR RELEASE)
2363
- // if we have a real native weakmap
2364
- // releasing the ref will allow the values to be GCed
2365
- this.weakMap = new WeakMap$1();
2366
- } else {
2367
- // POLYFILL AND DEBUG
2368
- // with a polyfill the weakmap keys must be cleared since
2369
- // they have the last reference, acceptance tests will leak
2370
- // the container if you render a immutable object retained
2371
- // in module scope.
2372
- var objs = this.objs,
2373
- weakMap = this.weakMap;
2374
-
2375
- this.objs = [];
2376
- for (var i = 0; i < objs.length; i++) {
2377
- weakMap.delete(objs[i]);
2378
- }
2379
- }
2380
- // POLYFILL AND RELEASE
2381
- // we leak the key map if the object is retained but this is
2382
- // a POJO of keys to transaction ids
2092
+ this.weakMap = new WeakMap();
2383
2093
  };
2384
2094
 
2385
2095
  return TransactionRunner;
@@ -2398,6 +2108,182 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2398
2108
  };
2399
2109
  }
2400
2110
 
2111
+ function watchPath(obj, keyPath, meta$$1) {
2112
+ if (typeof obj !== 'object' || obj === null) {
2113
+ return;
2114
+ }
2115
+ var m = meta$$1 === undefined ? meta(obj) : meta$$1;
2116
+ var counter = m.peekWatching(keyPath) || 0;
2117
+
2118
+ m.writeWatching(keyPath, counter + 1);
2119
+ if (counter === 0) {
2120
+ // activate watching first time
2121
+ m.writableChains(makeChainNode).add(keyPath);
2122
+ }
2123
+ }
2124
+
2125
+ function unwatchPath(obj, keyPath, meta$$1) {
2126
+ if (typeof obj !== 'object' || obj === null) {
2127
+ return;
2128
+ }
2129
+ var m = meta$$1 === undefined ? peekMeta(obj) : meta$$1;
2130
+
2131
+ if (m === undefined) {
2132
+ return;
2133
+ }
2134
+ var counter = m.peekWatching(keyPath) || 0;
2135
+
2136
+ if (counter === 1) {
2137
+ m.writeWatching(keyPath, 0);
2138
+ m.writableChains(makeChainNode).remove(keyPath);
2139
+ } else if (counter > 1) {
2140
+ m.writeWatching(keyPath, counter - 1);
2141
+ }
2142
+ }
2143
+
2144
+ /**
2145
+ @module ember
2146
+ */
2147
+ /**
2148
+ Starts watching a property on an object. Whenever the property changes,
2149
+ invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the
2150
+ primitive used by observers and dependent keys; usually you will never call
2151
+ this method directly but instead use higher level methods like
2152
+ `Ember.addObserver()`
2153
+
2154
+ @private
2155
+ @method watch
2156
+ @for Ember
2157
+ @param obj
2158
+ @param {String} _keyPath
2159
+ */
2160
+ function watch(obj, _keyPath, m) {
2161
+ if (isPath(_keyPath)) {
2162
+ watchPath(obj, _keyPath, m);
2163
+ } else {
2164
+ watchKey(obj, _keyPath, m);
2165
+ }
2166
+ }
2167
+
2168
+ function isWatching(obj, key) {
2169
+ return watcherCount(obj, key) > 0;
2170
+ }
2171
+
2172
+ function watcherCount(obj, key) {
2173
+ var meta$$1 = peekMeta(obj);
2174
+ return meta$$1 !== undefined && meta$$1.peekWatching(key) || 0;
2175
+ }
2176
+
2177
+ function unwatch(obj, _keyPath, m) {
2178
+ if (isPath(_keyPath)) {
2179
+ unwatchPath(obj, _keyPath, m);
2180
+ } else {
2181
+ unwatchKey(obj, _keyPath, m);
2182
+ }
2183
+ }
2184
+
2185
+ /**
2186
+ @module @ember/object
2187
+ */
2188
+
2189
+ var AFTER_OBSERVERS = ':change';
2190
+ var BEFORE_OBSERVERS = ':before';
2191
+
2192
+ function changeEvent(keyName) {
2193
+ return keyName + AFTER_OBSERVERS;
2194
+ }
2195
+
2196
+ function beforeEvent(keyName) {
2197
+ return keyName + BEFORE_OBSERVERS;
2198
+ }
2199
+
2200
+ /**
2201
+ @method addObserver
2202
+ @static
2203
+ @for @ember/object/observers
2204
+ @param obj
2205
+ @param {String} _path
2206
+ @param {Object|Function} target
2207
+ @param {Function|String} [method]
2208
+ @public
2209
+ */
2210
+ function addObserver(obj, _path, target, method) {
2211
+ addListener(obj, changeEvent(_path), target, method);
2212
+ watch(obj, _path);
2213
+
2214
+ return this;
2215
+ }
2216
+
2217
+ function observersFor(obj, path) {
2218
+ return listenersFor(obj, changeEvent(path));
2219
+ }
2220
+
2221
+ /**
2222
+ @method removeObserver
2223
+ @static
2224
+ @for @ember/object/observers
2225
+ @param obj
2226
+ @param {String} path
2227
+ @param {Object|Function} target
2228
+ @param {Function|String} [method]
2229
+ @public
2230
+ */
2231
+ function removeObserver(obj, path, target, method) {
2232
+ unwatch(obj, path);
2233
+ removeListener(obj, changeEvent(path), target, method);
2234
+
2235
+ return this;
2236
+ }
2237
+
2238
+ /**
2239
+ @method _addBeforeObserver
2240
+ @static
2241
+ @for @ember/object/observers
2242
+ @param obj
2243
+ @param {String} path
2244
+ @param {Object|Function} target
2245
+ @param {Function|String} [method]
2246
+ @deprecated
2247
+ @private
2248
+ */
2249
+ function _addBeforeObserver(obj, path, target, method) {
2250
+ addListener(obj, beforeEvent(path), target, method);
2251
+ watch(obj, path);
2252
+
2253
+ return this;
2254
+ }
2255
+
2256
+ // Suspend observer during callback.
2257
+ //
2258
+ // This should only be used by the target of the observer
2259
+ // while it is setting the observed path.
2260
+ function _suspendObserver(obj, path, target, method, callback) {
2261
+ return suspendListener(obj, changeEvent(path), target, method, callback);
2262
+ }
2263
+
2264
+ function _suspendObservers(obj, paths, target, method, callback) {
2265
+ var events = paths.map(changeEvent);
2266
+ return suspendListeners(obj, events, target, method, callback);
2267
+ }
2268
+
2269
+ /**
2270
+ @method removeBeforeObserver
2271
+ @static
2272
+ @for @ember/object/observers
2273
+ @param obj
2274
+ @param {String} path
2275
+ @param {Object|Function} target
2276
+ @param {Function|String} [method]
2277
+ @deprecated
2278
+ @private
2279
+ */
2280
+ function _removeBeforeObserver(obj, path, target, method) {
2281
+ unwatch(obj, path);
2282
+ removeListener(obj, beforeEvent(path), target, method);
2283
+
2284
+ return this;
2285
+ }
2286
+
2401
2287
  /**
2402
2288
  @module ember
2403
2289
  @private
@@ -2430,16 +2316,15 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2430
2316
  @private
2431
2317
  */
2432
2318
  function propertyWillChange(obj, keyName, _meta) {
2433
- var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
2319
+ var meta$$1 = _meta === undefined ? peekMeta(obj) : _meta;
2434
2320
  if (meta$$1 !== undefined && !meta$$1.isInitialized(obj)) {
2435
2321
  return;
2436
2322
  }
2437
2323
 
2438
2324
  var watching = meta$$1 !== undefined && meta$$1.peekWatching(keyName) > 0;
2439
- var possibleDesc = obj[keyName];
2440
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2325
+ var possibleDesc = descriptorFor(obj, keyName, meta$$1);
2441
2326
 
2442
- if (isDescriptor && possibleDesc.willChange) {
2327
+ if (possibleDesc !== undefined && possibleDesc.willChange) {
2443
2328
  possibleDesc.willChange(obj, keyName);
2444
2329
  }
2445
2330
 
@@ -2468,18 +2353,17 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2468
2353
  @private
2469
2354
  */
2470
2355
  function propertyDidChange(obj, keyName, _meta) {
2471
- var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
2356
+ var meta$$1 = _meta === undefined ? peekMeta(obj) : _meta;
2472
2357
  var hasMeta = meta$$1 !== undefined;
2473
2358
 
2474
2359
  if (hasMeta && !meta$$1.isInitialized(obj)) {
2475
2360
  return;
2476
2361
  }
2477
2362
 
2478
- var possibleDesc = obj[keyName];
2479
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2363
+ var possibleDesc = descriptorFor(obj, keyName, meta$$1);
2480
2364
 
2481
2365
  // shouldn't this mean that we're watching this key?
2482
- if (isDescriptor && possibleDesc.didChange) {
2366
+ if (possibleDesc !== undefined && possibleDesc.didChange) {
2483
2367
  possibleDesc.didChange(obj, keyName);
2484
2368
  }
2485
2369
 
@@ -2500,7 +2384,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2500
2384
  markObjectAsDirty(meta$$1, keyName);
2501
2385
  }
2502
2386
 
2503
- if (ember_features.EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER || ember_features.EMBER_GLIMMER_ALLOW_BACKTRACKING_RERENDER) {
2387
+ if (features.EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) {
2504
2388
  exports.assertNotRendered(obj, keyName, meta$$1);
2505
2389
  }
2506
2390
  }
@@ -2546,8 +2430,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2546
2430
  }
2547
2431
 
2548
2432
  function iterDeps(method, obj, depKey, seen, meta$$1) {
2549
- var possibleDesc = void 0,
2550
- isDescriptor = void 0;
2433
+ var possibleDesc = void 0;
2551
2434
  var guid = emberUtils.guidFor(obj);
2552
2435
  var current = seen[guid];
2553
2436
 
@@ -2566,10 +2449,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2566
2449
  return;
2567
2450
  }
2568
2451
 
2569
- possibleDesc = obj[key];
2570
- isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2452
+ possibleDesc = descriptorFor(obj, key, meta$$1);
2571
2453
 
2572
- if (isDescriptor && possibleDesc._suspended === obj) {
2454
+ if (possibleDesc !== undefined && possibleDesc._suspended === obj) {
2573
2455
  return;
2574
2456
  }
2575
2457
 
@@ -2632,13 +2514,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2632
2514
 
2633
2515
  @method changeProperties
2634
2516
  @param {Function} callback
2635
- @param [binding]
2636
2517
  @private
2637
2518
  */
2638
- function changeProperties(callback, binding) {
2519
+ function changeProperties(callback) {
2639
2520
  beginPropertyChanges();
2640
2521
  try {
2641
- callback.call(binding);
2522
+ callback();
2642
2523
  } finally {
2643
2524
  endPropertyChanges();
2644
2525
  }
@@ -2685,7 +2566,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2685
2566
  return;
2686
2567
  }
2687
2568
 
2688
- var eventName = keyName + ':before';
2569
+ var eventName = beforeEvent(keyName);
2689
2570
  var listeners = void 0,
2690
2571
  added = void 0;
2691
2572
  if (deferred > 0) {
@@ -2700,7 +2581,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2700
2581
  return;
2701
2582
  }
2702
2583
 
2703
- var eventName = keyName + ':change';
2584
+ var eventName = changeEvent(keyName);
2704
2585
  var listeners = void 0;
2705
2586
  if (deferred > 0) {
2706
2587
  listeners = observerSet.add(obj, keyName, eventName);
@@ -2729,29 +2610,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2729
2610
  this.isDescriptor = true;
2730
2611
  }
2731
2612
 
2732
- var REDEFINE_SUPPORTED = function () {
2733
- // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9
2734
- var a = Object.create(Object.prototype, {
2735
- prop: {
2736
- configurable: true,
2737
- value: 1
2738
- }
2739
- });
2740
-
2741
- Object.defineProperty(a, 'prop', {
2742
- configurable: true,
2743
- value: 2
2744
- });
2745
-
2746
- return a.prop === 2;
2747
- }();
2748
2613
  // ..........................................................
2749
2614
  // DEFINING PROPERTIES API
2750
2615
  //
2751
2616
 
2752
2617
  function MANDATORY_SETTER_FUNCTION(name) {
2753
2618
  function SETTER_FUNCTION(value) {
2754
- var m = exports.peekMeta(this);
2619
+ var m = peekMeta(this);
2755
2620
  if (!m.isInitialized(this)) {
2756
2621
  m.writeValues(name, value);
2757
2622
  } else {
@@ -2765,7 +2630,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2765
2630
 
2766
2631
  function DEFAULT_GETTER_FUNCTION(name) {
2767
2632
  return function GETTER_FUNCTION() {
2768
- var meta$$1 = exports.peekMeta(this);
2633
+ var meta$$1 = peekMeta(this);
2769
2634
  if (meta$$1 !== undefined) {
2770
2635
  return meta$$1.peekValues(name);
2771
2636
  }
@@ -2774,7 +2639,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2774
2639
 
2775
2640
  function INHERITING_GETTER_FUNCTION(name) {
2776
2641
  function IGETTER_FUNCTION() {
2777
- var meta$$1 = exports.peekMeta(this);
2642
+ var meta$$1 = peekMeta(this);
2778
2643
  var val = void 0;
2779
2644
  if (meta$$1 !== undefined) {
2780
2645
  val = meta$$1.readInheritedValue('values', name);
@@ -2792,6 +2657,78 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2792
2657
  return IGETTER_FUNCTION;
2793
2658
  }
2794
2659
 
2660
+ var DESCRIPTOR_GETTER_FUNCTION = void 0;
2661
+
2662
+ if (features.EMBER_METAL_ES5_GETTERS) {
2663
+ DESCRIPTOR_GETTER_FUNCTION = function (name, descriptor) {
2664
+ return function CPGETTER_FUNCTION() {
2665
+ return descriptor.get(this, name);
2666
+ };
2667
+ };
2668
+ } else if (features.DESCRIPTOR_TRAP) {
2669
+ // Future traveler, although this code looks scary. It merely exists in
2670
+ // development to aid in development asertions. Production builds of
2671
+ // ember strip this entire branch out.
2672
+ var messageFor = function (obj, keyName, property, value) {
2673
+ return 'You attempted to access the `' + keyName + '.' + property + '` property ' + ('(of ' + obj + '). Due to certain internal implementation details of Ember, ') + ('the `' + keyName + '` property previously contained an internal "descriptor" ') + ('object (a private API), therefore `' + keyName + '.' + property + '` would have ') + ('been `' + String(value).replace(/\n/g, ' ') + '`. This internal implementation ') + 'detail was never intended to be a public (or even intimate) API.\n\n' + 'This internal implementation detail has now changed and the (still private) ' + '"descriptor" object has been relocated to the object\'s "meta" (also a ' + ('private API). Soon, accessing `' + keyName + '` on this object will ') + 'return the computed value (see RFC #281 for more details).\n\n' + 'If you are seeing this error, you are likely using an addon that ' + 'relies on this now-defunct private implementation detail. If you can, ' + 'find out which addon is doing this from the stack trace below and ' + 'report this bug to the addon authors. If you feel stuck, the Ember ' + 'Community Slack (https://ember-community-slackin.herokuapp.com/) ' + 'may be able to offer some help.\n\n' + 'If you are an addon author and need help transitioning your code, ' + 'please get in touch in the #dev-ember channel in the Ember Community ' + 'Slack.';
2674
+ };
2675
+
2676
+ var trapFor = void 0;
2677
+
2678
+ if (emberUtils.HAS_NATIVE_PROXY) {
2679
+ /* globals Proxy */
2680
+ trapFor = function (obj, keyName, descriptor) {
2681
+ return new Proxy(descriptor, {
2682
+ get: function (descriptor, property) {
2683
+ if (property === DESCRIPTOR) {
2684
+ return descriptor;
2685
+ } else if (property === 'toString' || property == 'valueOf' || Symbol && property === Symbol.toPrimitive) {
2686
+ return function () {
2687
+ return '[COMPUTED PROPERTY]';
2688
+ };
2689
+ }
2690
+
2691
+ true && !false && emberDebug.assert(messageFor(obj, keyName, property, descriptor[property]));
2692
+ }
2693
+ });
2694
+ };
2695
+ } else {
2696
+ trapFor = function (obj, keyName, descriptor) {
2697
+ var trap = Object.create(null);
2698
+
2699
+ Object.defineProperty(trap, DESCRIPTOR, {
2700
+ configurable: false,
2701
+ enumerable: false,
2702
+ writable: false,
2703
+ value: descriptor
2704
+ });
2705
+
2706
+ trap.toString = trap.valueOf = function () {
2707
+ return '[COMPUTED PROPERTY]';
2708
+ };
2709
+
2710
+ // Without a proxy, we can only trap the "likely" properties
2711
+ ['isDescriptor', 'setup', 'teardown', 'get', '_getter', 'set', '_setter', 'meta'].forEach(function (property) {
2712
+ Object.defineProperty(trap, property, {
2713
+ configurable: false,
2714
+ enumerable: false,
2715
+ get: function () {
2716
+ true && !false && emberDebug.assert(messageFor(obj, keyName, property, descriptor[property]));
2717
+ }
2718
+ });
2719
+ });
2720
+
2721
+ return trap;
2722
+ };
2723
+ }
2724
+
2725
+ DESCRIPTOR_GETTER_FUNCTION = function (name, descriptor) {
2726
+ return function CPGETTER_FUNCTION() {
2727
+ return trapFor(this, name, descriptor);
2728
+ };
2729
+ };
2730
+ }
2731
+
2795
2732
  /**
2796
2733
  NOTE: This is a low-level method used by other parts of the API. You almost
2797
2734
  never want to call this method directly. Instead you should use
@@ -2846,31 +2783,42 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2846
2783
 
2847
2784
  var watchEntry = meta$$1.peekWatching(keyName);
2848
2785
  var watching = watchEntry !== undefined && watchEntry > 0;
2849
- var possibleDesc = obj[keyName];
2850
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2786
+ var previousDesc = descriptorFor(obj, keyName, meta$$1);
2787
+ var wasDescriptor = previousDesc !== undefined;
2851
2788
 
2852
- if (isDescriptor) {
2853
- possibleDesc.teardown(obj, keyName, meta$$1);
2789
+ if (wasDescriptor) {
2790
+ previousDesc.teardown(obj, keyName, meta$$1);
2791
+
2792
+ if (features.EMBER_METAL_ES5_GETTERS) {
2793
+ meta$$1.removeDescriptors(keyName);
2794
+ }
2854
2795
  }
2855
2796
 
2856
2797
  var value = void 0;
2857
2798
  if (desc instanceof Descriptor) {
2858
2799
  value = desc;
2859
- if (ember_features.MANDATORY_SETTER) {
2860
- if (watching) {
2861
- Object.defineProperty(obj, keyName, {
2862
- configurable: true,
2863
- enumerable: true,
2864
- writable: true,
2865
- value: value
2866
- });
2867
- } else {
2868
- obj[keyName] = value;
2869
- }
2800
+
2801
+ if (features.EMBER_METAL_ES5_GETTERS || features.DESCRIPTOR_TRAP) {
2802
+ Object.defineProperty(obj, keyName, {
2803
+ configurable: true,
2804
+ enumerable: true,
2805
+ get: DESCRIPTOR_GETTER_FUNCTION(keyName, value)
2806
+ });
2807
+ } else if (features.MANDATORY_SETTER && watching) {
2808
+ Object.defineProperty(obj, keyName, {
2809
+ configurable: true,
2810
+ enumerable: true,
2811
+ writable: true,
2812
+ value: value
2813
+ });
2870
2814
  } else {
2871
2815
  obj[keyName] = value;
2872
2816
  }
2873
2817
 
2818
+ if (features.EMBER_METAL_ES5_GETTERS) {
2819
+ meta$$1.writeDescriptors(keyName, value);
2820
+ }
2821
+
2874
2822
  didDefineComputedProperty(obj.constructor);
2875
2823
 
2876
2824
  if (typeof desc.setup === 'function') {
@@ -2879,25 +2827,24 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2879
2827
  } else if (desc === undefined || desc === null) {
2880
2828
  value = data;
2881
2829
 
2882
- if (ember_features.MANDATORY_SETTER) {
2883
- if (watching) {
2884
- meta$$1.writeValues(keyName, data);
2830
+ if (features.MANDATORY_SETTER && watching) {
2831
+ meta$$1.writeValues(keyName, data);
2885
2832
 
2886
- var defaultDescriptor = {
2887
- configurable: true,
2888
- enumerable: true,
2889
- set: MANDATORY_SETTER_FUNCTION(keyName),
2890
- get: DEFAULT_GETTER_FUNCTION(keyName)
2891
- };
2833
+ var defaultDescriptor = {
2834
+ configurable: true,
2835
+ enumerable: true,
2836
+ set: MANDATORY_SETTER_FUNCTION(keyName),
2837
+ get: DEFAULT_GETTER_FUNCTION(keyName)
2838
+ };
2892
2839
 
2893
- if (REDEFINE_SUPPORTED) {
2894
- Object.defineProperty(obj, keyName, defaultDescriptor);
2895
- } else {
2896
- handleBrokenPhantomDefineProperty(obj, keyName, defaultDescriptor);
2897
- }
2898
- } else {
2899
- obj[keyName] = data;
2900
- }
2840
+ Object.defineProperty(obj, keyName, defaultDescriptor);
2841
+ } else if ((features.EMBER_METAL_ES5_GETTERS || features.DESCRIPTOR_TRAP) && wasDescriptor) {
2842
+ Object.defineProperty(obj, keyName, {
2843
+ configurable: true,
2844
+ enumerable: true,
2845
+ writable: true,
2846
+ value: value
2847
+ });
2901
2848
  } else {
2902
2849
  obj[keyName] = data;
2903
2850
  }
@@ -2939,12 +2886,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2939
2886
  }
2940
2887
  }
2941
2888
 
2942
- function handleBrokenPhantomDefineProperty(obj, keyName, desc) {
2943
- // https://github.com/ariya/phantomjs/issues/11856
2944
- Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' });
2945
- Object.defineProperty(obj, keyName, desc);
2946
- }
2947
-
2948
2889
  var handleMandatorySetter = void 0;
2949
2890
 
2950
2891
  function watchKey(obj, keyName, _meta) {
@@ -2958,9 +2899,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2958
2899
 
2959
2900
  if (count === 0) {
2960
2901
  // activate watching first time
2961
- var possibleDesc = obj[keyName];
2962
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2963
- if (isDescriptor && possibleDesc.willWatch) {
2902
+ var possibleDesc = descriptorFor(obj, keyName, meta$$1);
2903
+
2904
+ if (possibleDesc !== undefined && possibleDesc.willWatch) {
2964
2905
  possibleDesc.willWatch(obj, keyName, meta$$1);
2965
2906
  }
2966
2907
 
@@ -2968,14 +2909,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2968
2909
  obj.willWatchProperty(keyName);
2969
2910
  }
2970
2911
 
2971
- if (ember_features.MANDATORY_SETTER) {
2912
+ if (features.MANDATORY_SETTER) {
2972
2913
  // NOTE: this is dropped for prod + minified builds
2973
2914
  handleMandatorySetter(meta$$1, obj, keyName);
2974
2915
  }
2975
2916
  }
2976
2917
  }
2977
2918
 
2978
- if (ember_features.MANDATORY_SETTER) {
2919
+ if (features.MANDATORY_SETTER) {
2979
2920
  var _hasOwnProperty = function (obj, key) {
2980
2921
  return Object.prototype.hasOwnProperty.call(obj, key);
2981
2922
  };
@@ -2989,15 +2930,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2989
2930
  handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) {
2990
2931
  var descriptor = emberUtils.lookupDescriptor(obj, keyName);
2991
2932
  var hasDescriptor = descriptor !== null;
2992
- var configurable = hasDescriptor ? descriptor.configurable : true;
2993
- var isWritable = hasDescriptor ? descriptor.writable : true;
2994
- var hasValue = hasDescriptor ? 'value' in descriptor : true;
2995
2933
  var possibleDesc = hasDescriptor && descriptor.value;
2996
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2997
-
2998
- if (isDescriptor) {
2934
+ if (isDescriptor(possibleDesc)) {
2999
2935
  return;
3000
2936
  }
2937
+ var configurable = hasDescriptor ? descriptor.configurable : true;
2938
+ var isWritable = hasDescriptor ? descriptor.writable : true;
2939
+ var hasValue = hasDescriptor ? 'value' in descriptor : true;
3001
2940
 
3002
2941
  // this x in Y deopts, so keeping it in this function is better;
3003
2942
  if (configurable && isWritable && hasValue && keyName in obj) {
@@ -3024,7 +2963,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3024
2963
  if (typeof obj !== 'object' || obj === null) {
3025
2964
  return;
3026
2965
  }
3027
- var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
2966
+ var meta$$1 = _meta === undefined ? peekMeta(obj) : _meta;
3028
2967
 
3029
2968
  // do nothing of this object has already been destroyed
3030
2969
  if (meta$$1 === undefined || meta$$1.isSourceDestroyed()) {
@@ -3035,10 +2974,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3035
2974
  if (count === 1) {
3036
2975
  meta$$1.writeWatching(keyName, 0);
3037
2976
 
3038
- var possibleDesc = obj[keyName];
3039
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
2977
+ var possibleDesc = descriptorFor(obj, keyName, meta$$1);
2978
+ var _isDescriptor = possibleDesc !== undefined;
3040
2979
 
3041
- if (isDescriptor && possibleDesc.didUnwatch) {
2980
+ if (_isDescriptor && possibleDesc.didUnwatch) {
3042
2981
  possibleDesc.didUnwatch(obj, keyName, meta$$1);
3043
2982
  }
3044
2983
 
@@ -3046,7 +2985,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3046
2985
  obj.didUnwatchProperty(keyName);
3047
2986
  }
3048
2987
 
3049
- if (ember_features.MANDATORY_SETTER) {
2988
+ if (features.MANDATORY_SETTER) {
3050
2989
  // It is true, the following code looks quite WAT. But have no fear, It
3051
2990
  // exists purely to improve development ergonomics and is removed from
3052
2991
  // ember.min.js and ember.prod.js builds.
@@ -3055,7 +2994,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3055
2994
  // for mutation, will bypass observation. This code exists to assert when
3056
2995
  // that occurs, and attempt to provide more helpful feedback. The alternative
3057
2996
  // is tricky to debug partially observable properties.
3058
- if (!isDescriptor && keyName in obj) {
2997
+ if (!_isDescriptor && keyName in obj) {
3059
2998
  var maybeMandatoryDescriptor = emberUtils.lookupDescriptor(obj, keyName);
3060
2999
 
3061
3000
  if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) {
@@ -3082,43 +3021,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3082
3021
  }
3083
3022
  }
3084
3023
 
3085
- function makeChainNode(obj) {
3086
- return new ChainNode(null, null, obj);
3087
- }
3088
-
3089
- function watchPath(obj, keyPath, meta$$1) {
3090
- if (typeof obj !== 'object' || obj === null) {
3091
- return;
3092
- }
3093
- var m = meta$$1 === undefined ? meta(obj) : meta$$1;
3094
- var counter = m.peekWatching(keyPath) || 0;
3095
-
3096
- m.writeWatching(keyPath, counter + 1);
3097
- if (counter === 0) {
3098
- // activate watching first time
3099
- m.writableChains(makeChainNode).add(keyPath);
3100
- }
3101
- }
3102
-
3103
- function unwatchPath(obj, keyPath, meta$$1) {
3104
- if (typeof obj !== 'object' || obj === null) {
3105
- return;
3106
- }
3107
- var m = meta$$1 === undefined ? exports.peekMeta(obj) : meta$$1;
3108
-
3109
- if (m === undefined) {
3110
- return;
3111
- }
3112
- var counter = m.peekWatching(keyPath) || 0;
3113
-
3114
- if (counter === 1) {
3115
- m.writeWatching(keyPath, 0);
3116
- m.writableChains(makeChainNode).remove(keyPath);
3117
- } else if (counter > 1) {
3118
- m.writeWatching(keyPath, counter - 1);
3119
- }
3120
- }
3121
-
3122
3024
  var FIRST_KEY = /^([^\.]+)/;
3123
3025
 
3124
3026
  function firstKey(path) {
@@ -3129,8 +3031,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3129
3031
  return typeof obj === 'object' && obj !== null;
3130
3032
  }
3131
3033
 
3132
- function isVolatile(obj) {
3133
- return !(isObject(obj) && obj.isDescriptor && obj._volatile === false);
3034
+ function isVolatile(obj, keyName, meta$$1) {
3035
+ var desc = descriptorFor(obj, keyName, meta$$1);
3036
+ return !(desc !== undefined && desc._volatile === false);
3134
3037
  }
3135
3038
 
3136
3039
  var ChainWatchers = function () {
@@ -3228,6 +3131,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3228
3131
  return new ChainWatchers();
3229
3132
  }
3230
3133
 
3134
+ function makeChainNode(obj) {
3135
+ return new ChainNode(null, null, obj);
3136
+ }
3137
+
3231
3138
  function addChainWatcher(obj, keyName, node) {
3232
3139
  var m = meta(obj);
3233
3140
  m.writableChainWatchers(makeChainWatcher).add(keyName, node);
@@ -3239,7 +3146,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3239
3146
  return;
3240
3147
  }
3241
3148
 
3242
- var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
3149
+ var meta$$1 = _meta === undefined ? peekMeta(obj) : _meta;
3243
3150
 
3244
3151
  if (meta$$1 === undefined || meta$$1.readableChainWatchers() === undefined) {
3245
3152
  return;
@@ -3310,7 +3217,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3310
3217
 
3311
3218
 
3312
3219
  ChainNode.prototype.copy = function copy(obj) {
3313
- var ret = new ChainNode(null, null, obj);
3220
+ var ret = makeChainNode(obj);
3314
3221
  var paths = this._paths;
3315
3222
  if (paths !== undefined) {
3316
3223
  var path = void 0;
@@ -3452,7 +3359,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3452
3359
  return;
3453
3360
  }
3454
3361
 
3455
- var meta$$1 = exports.peekMeta(obj);
3362
+ var meta$$1 = peekMeta(obj);
3456
3363
 
3457
3364
  // check if object meant only to be a prototype
3458
3365
  if (meta$$1 !== undefined && meta$$1.proto === obj) {
@@ -3460,7 +3367,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3460
3367
  }
3461
3368
 
3462
3369
  // Use `get` if the return value is an EachProxy or an uncacheable value.
3463
- if (isVolatile(obj[key])) {
3370
+ if (isVolatile(obj, key, meta$$1)) {
3464
3371
  return get(obj, key);
3465
3372
  // Otherwise attempt to get the cached value of the computed property
3466
3373
  } else {
@@ -3509,7 +3416,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3509
3416
  var META_DESTROYED = 1 << 3;
3510
3417
  var IS_PROXY = 1 << 4;
3511
3418
 
3512
- var META_FIELD = '__ember_meta__';
3513
3419
  var NODE_STACK = [];
3514
3420
 
3515
3421
  var Meta = function () {
@@ -3521,7 +3427,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3521
3427
  }
3522
3428
 
3523
3429
  this._cache = undefined;
3524
- this._weak = undefined;
3430
+
3431
+ if (features.EMBER_METAL_ES5_GETTERS) {
3432
+ this._descriptors = undefined;
3433
+ }
3434
+
3525
3435
  this._watching = undefined;
3526
3436
  this._mixins = undefined;
3527
3437
  this._bindings = undefined;
@@ -3588,7 +3498,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3588
3498
  if (node._watching) {
3589
3499
  nodeObject = node._object;
3590
3500
  if (nodeObject !== undefined) {
3591
- var foreignMeta = exports.peekMeta(nodeObject);
3501
+ var foreignMeta = peekMeta(nodeObject);
3592
3502
  // avoid cleaning up chain watchers when both current and
3593
3503
  // foreign objects are being destroyed
3594
3504
  // if both are being destroyed manual cleanup is not needed
@@ -3724,9 +3634,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3724
3634
  var innerMap = map[subkey];
3725
3635
  if (innerMap !== undefined) {
3726
3636
  for (var innerKey in innerMap) {
3727
- seen = seen || Object.create(null);
3728
- if (seen[innerKey] === undefined) {
3729
- seen[innerKey] = true;
3637
+ seen = seen === undefined ? new Set() : seen;
3638
+ if (!seen.has(innerKey)) {
3639
+ seen.add(innerKey);
3730
3640
  calls = calls || [];
3731
3641
  calls.push(innerKey, innerMap[innerKey]);
3732
3642
  }
@@ -3751,14 +3661,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3751
3661
  return this._cache;
3752
3662
  };
3753
3663
 
3754
- Meta.prototype.writableWeak = function writableWeak() {
3755
- return this._getOrCreateOwnMap('_weak');
3756
- };
3757
-
3758
- Meta.prototype.readableWeak = function readableWeak() {
3759
- return this._weak;
3760
- };
3761
-
3762
3664
  Meta.prototype.writableTags = function writableTags() {
3763
3665
  return this._getOrCreateOwnMap('_tags');
3764
3666
  };
@@ -3843,9 +3745,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3843
3745
  var map = pointer._mixins;
3844
3746
  if (map !== undefined) {
3845
3747
  for (var key in map) {
3846
- seen = seen || Object.create(null);
3847
- if (seen[key] === undefined) {
3848
- seen[key] = true;
3748
+ seen = seen === undefined ? new Set() : seen;
3749
+ if (!seen.has(key)) {
3750
+ seen.add(key);
3849
3751
  fn(key, map[key]);
3850
3752
  }
3851
3753
  }
@@ -3921,19 +3823,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3921
3823
  Meta.prototype[name] = protoMethods[name];
3922
3824
  }
3923
3825
 
3924
- var META_DESC = {
3925
- writable: true,
3926
- configurable: true,
3927
- enumerable: false,
3928
- value: null
3929
- };
3930
-
3931
- var EMBER_META_PROPERTY = {
3932
- name: META_FIELD,
3933
- descriptor: META_DESC
3934
- };
3935
-
3936
- if (ember_features.MANDATORY_SETTER) {
3826
+ if (features.MANDATORY_SETTER) {
3937
3827
  Meta.prototype.readInheritedValue = function (key, subkey) {
3938
3828
  var internalKey = '_' + key;
3939
3829
 
@@ -3965,54 +3855,60 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
3965
3855
  };
3966
3856
  }
3967
3857
 
3968
- var setMeta = void 0;
3969
- exports.peekMeta = void 0;
3858
+ if (features.EMBER_METAL_ES5_GETTERS) {
3859
+ Meta.prototype.writeDescriptors = function (subkey, value) {
3860
+ true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot update descriptors for `' + subkey + '` on `' + emberUtils.toString(this.source) + '` after it has been destroyed.', !this.isMetaDestroyed());
3970
3861
 
3971
- // choose the one appropriate for given platform
3972
- if (emberUtils.HAS_NATIVE_WEAKMAP) {
3973
- var getPrototypeOf = Object.getPrototypeOf;
3974
- var metaStore = new WeakMap();
3862
+ var map = this._getOrCreateOwnMap('_descriptors');
3863
+ map[subkey] = value;
3864
+ };
3975
3865
 
3976
- setMeta = function WeakMap_setMeta(obj, meta) {
3977
- {
3978
- counters.setCalls++;
3979
- }
3980
- metaStore.set(obj, meta);
3866
+ Meta.prototype.peekDescriptors = function (subkey) {
3867
+ var possibleDesc = this._findInherited('_descriptors', subkey);
3868
+ return possibleDesc === UNDEFINED ? undefined : possibleDesc;
3981
3869
  };
3982
3870
 
3983
- exports.peekMeta = function WeakMap_peekParentMeta(obj) {
3984
- var pointer = obj;
3985
- var meta = void 0;
3986
- while (pointer !== undefined && pointer !== null) {
3987
- meta = metaStore.get(pointer);
3988
- // jshint loopfunc:true
3989
- {
3990
- counters.peekCalls++;
3991
- }
3992
- if (meta !== undefined) {
3993
- return meta;
3994
- }
3871
+ Meta.prototype.removeDescriptors = function (subkey) {
3872
+ this.writeDescriptors(subkey, UNDEFINED);
3873
+ };
3874
+ }
3995
3875
 
3996
- pointer = getPrototypeOf(pointer);
3997
- {
3998
- counters.peekPrototypeWalks++;
3999
- }
3876
+ var getPrototypeOf = Object.getPrototypeOf;
3877
+ var metaStore = new WeakMap();
3878
+
3879
+ function setMeta(obj, meta) {
3880
+ true && !(obj !== null) && emberDebug.assert('Cannot call `setMeta` on null', obj !== null);
3881
+ true && !(obj !== undefined) && emberDebug.assert('Cannot call `setMeta` on undefined', obj !== undefined);
3882
+ true && !(typeof obj === 'object' || typeof obj === 'function') && emberDebug.assert('Cannot call `setMeta` on ' + typeof obj, typeof obj === 'object' || typeof obj === 'function');
3883
+
3884
+ {
3885
+ counters.setCalls++;
3886
+ }
3887
+ metaStore.set(obj, meta);
3888
+ }
3889
+
3890
+ function peekMeta(obj) {
3891
+ true && !(obj !== null) && emberDebug.assert('Cannot call `peekMeta` on null', obj !== null);
3892
+ true && !(obj !== undefined) && emberDebug.assert('Cannot call `peekMeta` on undefined', obj !== undefined);
3893
+ true && !(typeof obj === 'object' || typeof obj === 'function') && emberDebug.assert('Cannot call `peekMeta` on ' + typeof obj, typeof obj === 'object' || typeof obj === 'function');
3894
+
3895
+ var pointer = obj;
3896
+ var meta = void 0;
3897
+ while (pointer !== undefined && pointer !== null) {
3898
+ meta = metaStore.get(pointer);
3899
+ // jshint loopfunc:true
3900
+ {
3901
+ counters.peekCalls++;
4000
3902
  }
4001
- };
4002
- } else {
4003
- setMeta = function Fallback_setMeta(obj, meta) {
4004
- if (obj.__defineNonEnumerable) {
4005
- obj.__defineNonEnumerable(EMBER_META_PROPERTY);
4006
- } else {
4007
- Object.defineProperty(obj, META_FIELD, META_DESC);
3903
+ if (meta !== undefined) {
3904
+ return meta;
4008
3905
  }
4009
3906
 
4010
- obj[META_FIELD] = meta;
4011
- };
4012
-
4013
- exports.peekMeta = function Fallback_peekMeta(obj) {
4014
- return obj[META_FIELD];
4015
- };
3907
+ pointer = getPrototypeOf(pointer);
3908
+ {
3909
+ counters.peekPrototypeWalks++;
3910
+ }
3911
+ }
4016
3912
  }
4017
3913
 
4018
3914
  /**
@@ -4026,11 +3922,15 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4026
3922
  @private
4027
3923
  */
4028
3924
  function deleteMeta(obj) {
3925
+ true && !(obj !== null) && emberDebug.assert('Cannot call `deleteMeta` on null', obj !== null);
3926
+ true && !(obj !== undefined) && emberDebug.assert('Cannot call `deleteMeta` on undefined', obj !== undefined);
3927
+ true && !(typeof obj === 'object' || typeof obj === 'function') && emberDebug.assert('Cannot call `deleteMeta` on ' + typeof obj, typeof obj === 'object' || typeof obj === 'function');
3928
+
4029
3929
  {
4030
3930
  counters.deleteCalls++;
4031
3931
  }
4032
3932
 
4033
- var meta = exports.peekMeta(obj);
3933
+ var meta = peekMeta(obj);
4034
3934
  if (meta !== undefined) {
4035
3935
  meta.destroy();
4036
3936
  }
@@ -4055,11 +3955,15 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4055
3955
  @return {Object} the meta hash for an object
4056
3956
  */
4057
3957
  function meta(obj) {
3958
+ true && !(obj !== null) && emberDebug.assert('Cannot call `meta` on null', obj !== null);
3959
+ true && !(obj !== undefined) && emberDebug.assert('Cannot call `meta` on undefined', obj !== undefined);
3960
+ true && !(typeof obj === 'object' || typeof obj === 'function') && emberDebug.assert('Cannot call `meta` on ' + typeof obj, typeof obj === 'object' || typeof obj === 'function');
3961
+
4058
3962
  {
4059
3963
  counters.metaCalls++;
4060
3964
  }
4061
3965
 
4062
- var maybeMeta = exports.peekMeta(obj);
3966
+ var maybeMeta = peekMeta(obj);
4063
3967
  var parent = void 0;
4064
3968
 
4065
3969
  // remove this code, in-favor of explicit parent
@@ -4075,6 +3979,63 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4075
3979
  return newMeta;
4076
3980
  }
4077
3981
 
3982
+ // Using `symbol()` here causes some node test to fail, presumably
3983
+ // because we define the CP with one copy of Ember and boot the app
3984
+ // with a different copy, so the random key we generate do not line
3985
+ // up. Is that testing a legit scenario?
3986
+ var DESCRIPTOR = '__DESCRIPTOR__';
3987
+
3988
+ /**
3989
+ Returns the CP descriptor assocaited with `obj` and `keyName`, if any.
3990
+
3991
+ @method descriptorFor
3992
+ @param {Object} obj the object to check
3993
+ @param {String} keyName the key to check
3994
+ @return {Descriptor}
3995
+ @private
3996
+ */
3997
+ function descriptorFor(obj, keyName, _meta) {
3998
+ true && !(obj !== null) && emberDebug.assert('Cannot call `descriptorFor` on null', obj !== null);
3999
+ true && !(obj !== undefined) && emberDebug.assert('Cannot call `descriptorFor` on undefined', obj !== undefined);
4000
+ true && !(typeof obj === 'object' || typeof obj === 'function') && emberDebug.assert('Cannot call `descriptorFor` on ' + typeof obj, typeof obj === 'object' || typeof obj === 'function');
4001
+
4002
+ if (features.EMBER_METAL_ES5_GETTERS) {
4003
+ var _meta2 = _meta === undefined ? peekMeta(obj) : _meta;
4004
+
4005
+ if (_meta2 !== undefined) {
4006
+ return _meta2.peekDescriptors(keyName);
4007
+ }
4008
+ } else {
4009
+ var possibleDesc = obj[keyName];
4010
+
4011
+ if (features.DESCRIPTOR_TRAP && isDescriptorTrap(possibleDesc)) {
4012
+ return possibleDesc[DESCRIPTOR];
4013
+ } else {
4014
+ return isDescriptor(possibleDesc) ? possibleDesc : undefined;
4015
+ }
4016
+ }
4017
+ }
4018
+
4019
+ function isDescriptorTrap(possibleDesc) {
4020
+ if (features.DESCRIPTOR_TRAP) {
4021
+ return possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc[DESCRIPTOR] !== undefined;
4022
+ } else {
4023
+ throw new Error('Cannot call `isDescriptorTrap` in production');
4024
+ }
4025
+ }
4026
+
4027
+ /**
4028
+ Check whether a value is a CP descriptor.
4029
+
4030
+ @method descriptorFor
4031
+ @param {any} possibleDesc the value to check
4032
+ @return {boolean}
4033
+ @private
4034
+ */
4035
+ function isDescriptor(possibleDesc) {
4036
+ return possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
4037
+ }
4038
+
4078
4039
  var Cache = function () {
4079
4040
  function Cache(limit, func, key, store) {
4080
4041
  emberBabel.classCallCheck(this, Cache);
@@ -4244,14 +4205,40 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4244
4205
  true && !(keyName.lastIndexOf('this.', 0) !== 0) && emberDebug.assert('\'this\' in paths is not supported', keyName.lastIndexOf('this.', 0) !== 0);
4245
4206
  true && !(keyName !== '') && emberDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== '');
4246
4207
 
4247
- var value = obj[keyName];
4248
- var isDescriptor = value !== null && typeof value === 'object' && value.isDescriptor;
4208
+ var type = typeof obj;
4209
+
4210
+ var isObject = type === 'object';
4211
+ var isFunction = type === 'function';
4212
+ var isObjectLike = isObject || isFunction;
4213
+
4214
+ var descriptor = undefined;
4215
+ var value = void 0;
4216
+
4217
+ if (isObjectLike) {
4218
+ if (features.EMBER_METAL_ES5_GETTERS) {
4219
+ descriptor = descriptorFor(obj, keyName);
4220
+ }
4221
+
4222
+ if (!features.EMBER_METAL_ES5_GETTERS || descriptor === undefined) {
4223
+ value = obj[keyName];
4224
+
4225
+ if (features.DESCRIPTOR_TRAP && isDescriptorTrap(value)) {
4226
+ descriptor = value[DESCRIPTOR];
4227
+ } else if (isDescriptor(value)) {
4228
+ descriptor = value;
4229
+ }
4230
+ }
4231
+
4232
+ if (descriptor !== undefined) {
4233
+ return descriptor.get(obj, keyName);
4234
+ }
4235
+ } else {
4236
+ value = obj[keyName];
4237
+ }
4249
4238
 
4250
- if (isDescriptor) {
4251
- return value.get(obj, keyName);
4252
- } else if (isPath(keyName)) {
4239
+ if (isPath(keyName)) {
4253
4240
  return _getPath(obj, keyName);
4254
- } else if (value === undefined && 'object' === typeof obj && !(keyName in obj) && typeof obj.unknownProperty === 'function') {
4241
+ } else if (value === undefined && isObject && !(keyName in obj) && typeof obj.unknownProperty === 'function') {
4255
4242
  return obj.unknownProperty(keyName);
4256
4243
  } else {
4257
4244
  return value;
@@ -4340,10 +4327,23 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4340
4327
  return setPath(obj, keyName, value, tolerant);
4341
4328
  }
4342
4329
 
4330
+ if (features.EMBER_METAL_ES5_GETTERS) {
4331
+ var possibleDesc = descriptorFor(obj, keyName);
4332
+
4333
+ if (possibleDesc !== undefined) {
4334
+ /* computed property */
4335
+ possibleDesc.set(obj, keyName, value);
4336
+ return value;
4337
+ }
4338
+ }
4339
+
4343
4340
  var currentValue = obj[keyName];
4344
- var isDescriptor = currentValue !== null && typeof currentValue === 'object' && currentValue.isDescriptor;
4345
4341
 
4346
- if (isDescriptor) {
4342
+ if (features.DESCRIPTOR_TRAP && isDescriptorTrap(currentValue)) {
4343
+ currentValue = currentValue[DESCRIPTOR];
4344
+ }
4345
+
4346
+ if (isDescriptor(currentValue)) {
4347
4347
  /* computed property */
4348
4348
  currentValue.set(obj, keyName, value);
4349
4349
  } else if (currentValue === undefined && 'object' === typeof obj && !(keyName in obj) && typeof obj.setUnknownProperty === 'function') {
@@ -4351,10 +4351,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4351
4351
  obj.setUnknownProperty(keyName, value);
4352
4352
  } else if (currentValue === value) {/* no change */
4353
4353
  } else {
4354
- var meta$$1 = exports.peekMeta(obj);
4354
+ var meta$$1 = peekMeta(obj);
4355
4355
  propertyWillChange(obj, keyName, meta$$1);
4356
4356
 
4357
- if (ember_features.MANDATORY_SETTER) {
4357
+ if (features.MANDATORY_SETTER) {
4358
4358
  setWithMandatorySetter(meta$$1, obj, keyName, value);
4359
4359
  } else {
4360
4360
  obj[keyName] = value;
@@ -4366,7 +4366,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4366
4366
  return value;
4367
4367
  }
4368
4368
 
4369
- if (ember_features.MANDATORY_SETTER) {
4369
+ if (features.MANDATORY_SETTER) {
4370
4370
  var setWithMandatorySetter = function (meta$$1, obj, keyName, value) {
4371
4371
  if (meta$$1 !== undefined && meta$$1.peekWatching(keyName) > 0) {
4372
4372
  makeEnumerable(obj, keyName);
@@ -4493,47 +4493,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4493
4493
  }
4494
4494
  }
4495
4495
 
4496
- /**
4497
- @module ember
4498
- */
4499
- /**
4500
- Starts watching a property on an object. Whenever the property changes,
4501
- invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the
4502
- primitive used by observers and dependent keys; usually you will never call
4503
- this method directly but instead use higher level methods like
4504
- `Ember.addObserver()`
4505
-
4506
- @private
4507
- @method watch
4508
- @for Ember
4509
- @param obj
4510
- @param {String} _keyPath
4511
- */
4512
- function watch(obj, _keyPath, m) {
4513
- if (isPath(_keyPath)) {
4514
- watchPath(obj, _keyPath, m);
4515
- } else {
4516
- watchKey(obj, _keyPath, m);
4517
- }
4518
- }
4519
-
4520
- function isWatching(obj, key) {
4521
- return watcherCount(obj, key) > 0;
4522
- }
4523
-
4524
- function watcherCount(obj, key) {
4525
- var meta$$1 = exports.peekMeta(obj);
4526
- return meta$$1 !== undefined && meta$$1.peekWatching(key) || 0;
4527
- }
4528
-
4529
- function unwatch(obj, _keyPath, m) {
4530
- if (isPath(_keyPath)) {
4531
- unwatchPath(obj, _keyPath, m);
4532
- } else {
4533
- unwatchKey(obj, _keyPath, m);
4534
- }
4535
- }
4536
-
4537
4496
  // ..........................................................
4538
4497
  // DEPENDENT KEYS
4539
4498
  //
@@ -4871,7 +4830,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4871
4830
  }
4872
4831
 
4873
4832
  // don't create objects just to invalidate
4874
- var meta$$1 = exports.peekMeta(obj);
4833
+ var meta$$1 = peekMeta(obj);
4875
4834
  if (meta$$1 === undefined || meta$$1.source !== obj) {
4876
4835
  return;
4877
4836
  }
@@ -5116,7 +5075,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5116
5075
  @public
5117
5076
  */
5118
5077
  function cacheFor(obj, key) {
5119
- var meta$$1 = exports.peekMeta(obj);
5078
+ var meta$$1 = peekMeta(obj);
5120
5079
  var cache = meta$$1 !== undefined ? meta$$1.source === obj && meta$$1.readableCache() : undefined;
5121
5080
  var ret = cache !== undefined ? cache[key] : undefined;
5122
5081
 
@@ -5218,6 +5177,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5218
5177
  }(Descriptor);
5219
5178
 
5220
5179
  function AliasedProperty_readOnlySet(obj, keyName, value) {
5180
+ // eslint-disable-line no-unused-vars
5221
5181
  throw new emberDebug.Error('Cannot set read-only property \'' + keyName + '\' on object: ' + emberUtils.inspect(obj));
5222
5182
  }
5223
5183
 
@@ -5423,7 +5383,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5423
5383
  }
5424
5384
 
5425
5385
  exports.flaggedInstrument = void 0;
5426
- if (ember_features.EMBER_IMPROVED_INSTRUMENTATION) {
5386
+ if (features.EMBER_IMPROVED_INSTRUMENTATION) {
5427
5387
  exports.flaggedInstrument = instrument;
5428
5388
  } else {
5429
5389
  exports.flaggedInstrument = function (name, payload, callback) {
@@ -5772,7 +5732,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5772
5732
  }
5773
5733
 
5774
5734
  var backburner$1 = new Backburner(['sync', 'actions', 'destroy'], {
5775
- GUID_KEY: emberUtils.GUID_KEY,
5776
5735
  sync: {
5777
5736
  before: beginPropertyChanges,
5778
5737
  after: endPropertyChanges
@@ -5899,7 +5858,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5899
5858
  setup: Ember.run.bind(this, this.setupEditor)
5900
5859
  });
5901
5860
  }),
5902
-
5861
+
5903
5862
  didInsertElement() {
5904
5863
  tinymce.init({
5905
5864
  selector: '#' + this.$().prop('id'),
@@ -6582,7 +6541,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
6582
6541
  return Libraries;
6583
6542
  }();
6584
6543
 
6585
- if (ember_features.EMBER_LIBRARIES_ISREGISTERED) {
6544
+ if (features.EMBER_LIBRARIES_ISREGISTERED) {
6586
6545
  Libraries.prototype.isRegistered = function (name) {
6587
6546
  return !!this._getLibraryByName(name);
6588
6547
  };
@@ -7162,108 +7121,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7162
7121
  return properties;
7163
7122
  }
7164
7123
 
7165
- /**
7166
- @module @ember/object
7167
- */
7168
-
7169
- var AFTER_OBSERVERS = ':change';
7170
- var BEFORE_OBSERVERS = ':before';
7171
-
7172
- function changeEvent(keyName) {
7173
- return keyName + AFTER_OBSERVERS;
7174
- }
7175
-
7176
- function beforeEvent(keyName) {
7177
- return keyName + BEFORE_OBSERVERS;
7178
- }
7179
-
7180
- /**
7181
- @method addObserver
7182
- @static
7183
- @for @ember/object/observers
7184
- @param obj
7185
- @param {String} _path
7186
- @param {Object|Function} target
7187
- @param {Function|String} [method]
7188
- @public
7189
- */
7190
- function addObserver(obj, _path, target, method) {
7191
- addListener(obj, changeEvent(_path), target, method);
7192
- watch(obj, _path);
7193
-
7194
- return this;
7195
- }
7196
-
7197
- function observersFor(obj, path) {
7198
- return listenersFor(obj, changeEvent(path));
7199
- }
7200
-
7201
- /**
7202
- @method removeObserver
7203
- @static
7204
- @for @ember/object/observers
7205
- @param obj
7206
- @param {String} path
7207
- @param {Object|Function} target
7208
- @param {Function|String} [method]
7209
- @public
7210
- */
7211
- function removeObserver(obj, path, target, method) {
7212
- unwatch(obj, path);
7213
- removeListener(obj, changeEvent(path), target, method);
7214
-
7215
- return this;
7216
- }
7217
-
7218
- /**
7219
- @method _addBeforeObserver
7220
- @static
7221
- @for @ember/object/observers
7222
- @param obj
7223
- @param {String} path
7224
- @param {Object|Function} target
7225
- @param {Function|String} [method]
7226
- @deprecated
7227
- @private
7228
- */
7229
- function _addBeforeObserver(obj, path, target, method) {
7230
- addListener(obj, beforeEvent(path), target, method);
7231
- watch(obj, path);
7232
-
7233
- return this;
7234
- }
7235
-
7236
- // Suspend observer during callback.
7237
- //
7238
- // This should only be used by the target of the observer
7239
- // while it is setting the observed path.
7240
- function _suspendObserver(obj, path, target, method, callback) {
7241
- return suspendListener(obj, changeEvent(path), target, method, callback);
7242
- }
7243
-
7244
- function _suspendObservers(obj, paths, target, method, callback) {
7245
- var events = paths.map(changeEvent);
7246
- return suspendListeners(obj, events, target, method, callback);
7247
- }
7248
-
7249
- /**
7250
- @method removeBeforeObserver
7251
- @static
7252
- @for @ember/object/observers
7253
- @param obj
7254
- @param {String} path
7255
- @param {Object|Function} target
7256
- @param {Function|String} [method]
7257
- @deprecated
7258
- @private
7259
- */
7260
- function _removeBeforeObserver(obj, path, target, method) {
7261
- unwatch(obj, path);
7262
- removeListener(obj, beforeEvent(path), target, method);
7263
-
7264
- return this;
7265
- }
7266
-
7267
7124
  /**
7268
7125
  @module ember
7269
7126
  */
@@ -7469,12 +7326,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7469
7326
  /* Called when the from side changes. */
7470
7327
 
7471
7328
  Binding.prototype.fromDidChange = function fromDidChange(target) {
7329
+ // eslint-disable-line no-unused-vars
7472
7330
  this._scheduleSync('fwd');
7473
7331
  };
7474
7332
 
7475
7333
  /* Called when the to side changes. */
7476
7334
 
7477
7335
  Binding.prototype.toDidChange = function toDidChange(target) {
7336
+ // eslint-disable-line no-unused-vars
7478
7337
  this._scheduleSync('back');
7479
7338
  };
7480
7339
 
@@ -7793,10 +7652,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7793
7652
  // If we didn't find the original descriptor in a parent mixin, find
7794
7653
  // it on the original object.
7795
7654
  if (!superProperty) {
7796
- var possibleDesc = base[key];
7797
- var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
7798
-
7799
- superProperty = superDesc;
7655
+ superProperty = descriptorFor(base, key, meta$$1);
7800
7656
  }
7801
7657
 
7802
7658
  if (superProperty === undefined || !(superProperty instanceof ComputedProperty)) {
@@ -7820,24 +7676,26 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7820
7676
  }
7821
7677
 
7822
7678
  function giveMethodSuper(obj, key, method, values, descs) {
7823
- var superMethod = void 0;
7824
-
7825
7679
  // Methods overwrite computed properties, and do not call super to them.
7826
- if (descs[key] === undefined) {
7827
- // Find the original method in a parent mixin
7828
- superMethod = values[key];
7680
+ if (descs[key] !== undefined) {
7681
+ return method;
7829
7682
  }
7830
7683
 
7684
+ // Find the original method in a parent mixin
7685
+ var superMethod = values[key];
7686
+
7831
7687
  // If we didn't find the original value in a parent mixin, find it in
7832
7688
  // the original object
7833
- superMethod = superMethod || obj[key];
7689
+ if (superMethod === undefined && (!features.EMBER_METAL_ES5_GETTERS || descriptorFor(obj, key) === undefined)) {
7690
+ superMethod = obj[key];
7691
+ }
7834
7692
 
7835
7693
  // Only wrap the new method if the original method was a function
7836
- if (superMethod === undefined || 'function' !== typeof superMethod) {
7837
- return method;
7694
+ if (typeof superMethod === 'function') {
7695
+ return emberUtils.wrap(method, superMethod);
7838
7696
  }
7839
7697
 
7840
- return emberUtils.wrap(method, superMethod);
7698
+ return method;
7841
7699
  }
7842
7700
 
7843
7701
  function applyConcatenatedProperties(obj, key, value, values) {
@@ -7904,7 +7762,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7904
7762
 
7905
7763
  function addNormalizedProperty(base, key, value, meta$$1, descs, values, concats, mergings) {
7906
7764
  if (value instanceof Descriptor) {
7907
- if (value === REQUIRED && descs[key]) {
7765
+ if (emberEnvironment.ENV._ENABLE_PROPERTY_REQUIRED_SUPPORT && value === REQUIRED && descs[key]) {
7908
7766
  return CONTINUE;
7909
7767
  }
7910
7768
 
@@ -7952,6 +7810,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7952
7810
  }
7953
7811
 
7954
7812
  if (props) {
7813
+ // remove willMergeMixin after 3.4 as it was used for _actions
7955
7814
  if (base.willMergeMixin) {
7956
7815
  base.willMergeMixin(props);
7957
7816
  }
@@ -8020,7 +7879,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8020
7879
  if (descs[altKey] || values[altKey]) {
8021
7880
  value = values[altKey];
8022
7881
  desc = descs[altKey];
8023
- } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) {
7882
+ } else if ((possibleDesc = descriptorFor(obj, altKey)) !== undefined) {
8024
7883
  desc = possibleDesc;
8025
7884
  value = undefined;
8026
7885
  } else {
@@ -8039,19 +7898,17 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8039
7898
  }
8040
7899
  }
8041
7900
 
8042
- function replaceObserversAndListeners(obj, key, observerOrListener) {
8043
- var prev = obj[key];
8044
-
7901
+ function replaceObserversAndListeners(obj, key, prev, next) {
8045
7902
  if (typeof prev === 'function') {
8046
7903
  updateObserversAndListeners(obj, key, prev.__ember_observesBefore__, _removeBeforeObserver);
8047
7904
  updateObserversAndListeners(obj, key, prev.__ember_observes__, removeObserver);
8048
7905
  updateObserversAndListeners(obj, key, prev.__ember_listens__, removeListener);
8049
7906
  }
8050
7907
 
8051
- if (typeof observerOrListener === 'function') {
8052
- updateObserversAndListeners(obj, key, observerOrListener.__ember_observesBefore__, _addBeforeObserver);
8053
- updateObserversAndListeners(obj, key, observerOrListener.__ember_observes__, addObserver);
8054
- updateObserversAndListeners(obj, key, observerOrListener.__ember_listens__, addListener);
7908
+ if (typeof next === 'function') {
7909
+ updateObserversAndListeners(obj, key, next.__ember_observesBefore__, _addBeforeObserver);
7910
+ updateObserversAndListeners(obj, key, next.__ember_observes__, addObserver);
7911
+ updateObserversAndListeners(obj, key, next.__ember_listens__, addListener);
8055
7912
  }
8056
7913
  }
8057
7914
 
@@ -8084,7 +7941,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8084
7941
  desc = descs[key];
8085
7942
  value = values[key];
8086
7943
 
8087
- if (desc === REQUIRED) {
7944
+ if (emberEnvironment.ENV._ENABLE_PROPERTY_REQUIRED_SUPPORT && desc === REQUIRED) {
8088
7945
  continue;
8089
7946
  }
8090
7947
 
@@ -8098,7 +7955,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8098
7955
  continue;
8099
7956
  }
8100
7957
 
8101
- replaceObserversAndListeners(obj, key, value);
7958
+ if (features.EMBER_METAL_ES5_GETTERS && descriptorFor(obj, key) !== undefined) {
7959
+ replaceObserversAndListeners(obj, key, null, value);
7960
+ } else {
7961
+ replaceObserversAndListeners(obj, key, obj[key], value);
7962
+ }
8102
7963
 
8103
7964
  if (detectBinding(key)) {
8104
7965
  meta$$1.writeBindings(key, value);
@@ -8278,7 +8139,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8278
8139
 
8279
8140
 
8280
8141
  Mixin.mixins = function mixins(obj) {
8281
- var meta$$1 = exports.peekMeta(obj);
8142
+ var meta$$1 = peekMeta(obj);
8282
8143
  var ret = [];
8283
8144
  if (meta$$1 === undefined) {
8284
8145
  return ret;
@@ -8357,7 +8218,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8357
8218
  if (obj instanceof Mixin) {
8358
8219
  return _detect(obj, this, {});
8359
8220
  }
8360
- var meta$$1 = exports.peekMeta(obj);
8221
+ var meta$$1 = peekMeta(obj);
8361
8222
  if (meta$$1 === undefined) {
8362
8223
  return false;
8363
8224
  }
@@ -8533,23 +8394,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8533
8394
  @static
8534
8395
  */
8535
8396
  function observer() {
8536
- var _paths = void 0,
8537
- func = void 0;
8538
-
8539
8397
  for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
8540
8398
  args[_key5] = arguments[_key5];
8541
8399
  }
8542
8400
 
8543
- if (typeof args[args.length - 1] !== 'function') {
8544
- // revert to old, soft-deprecated argument ordering
8545
- true && !false && emberDebug.deprecate('Passing the dependentKeys after the callback function in observer is deprecated. Ensure the callback function is the last argument.', false, { id: 'ember-metal.observer-argument-order', until: '3.0.0' });
8546
-
8547
- func = args.shift();
8548
- _paths = args;
8549
- } else {
8550
- func = args.pop();
8551
- _paths = args;
8552
- }
8401
+ var func = args.pop();
8402
+ var _paths = args;
8553
8403
 
8554
8404
  true && !(typeof func === 'function') && emberDebug.assert('observer called without a function', typeof func === 'function');
8555
8405
  true && !(_paths.length > 0 && _paths.every(function (p) {
@@ -8571,44 +8421,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8571
8421
  return func;
8572
8422
  }
8573
8423
 
8574
- /**
8575
- Specify a method that observes property changes.
8576
-
8577
- ```javascript
8578
- import EmberObject from '@ember/object';
8579
-
8580
- EmberObject.extend({
8581
- valueObserver: Ember.immediateObserver('value', function() {
8582
- // Executes whenever the "value" property changes
8583
- })
8584
- });
8585
- ```
8586
-
8587
- In the future, `observer` may become asynchronous. In this event,
8588
- `immediateObserver` will maintain the synchronous behavior.
8589
-
8590
- Also available as `Function.prototype.observesImmediately` if prototype extensions are
8591
- enabled.
8592
-
8593
- @method _immediateObserver
8594
- @for Ember
8595
- @param {String} propertyNames*
8596
- @param {Function} func
8597
- @deprecated Use `observer` instead.
8598
- @return func
8599
- @private
8600
- */
8601
- function _immediateObserver() {
8602
- true && !false && emberDebug.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `observer` instead.', false, { id: 'ember-metal.immediate-observer', until: '3.0.0' });
8603
-
8604
- for (var i = 0; i < arguments.length; i++) {
8605
- var arg = arguments[i];
8606
- true && !(typeof arg !== 'string' || arg.indexOf('.') === -1) && emberDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1);
8607
- }
8608
-
8609
- return observer.apply(this, arguments);
8610
- }
8611
-
8612
8424
  /**
8613
8425
  When observers fire, they are called with the arguments `obj`, `keyName`.
8614
8426
 
@@ -8630,32 +8442,20 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8630
8442
  args[_key6] = arguments[_key6];
8631
8443
  }
8632
8444
 
8633
- var func = args[args.length - 1];
8634
- var paths = void 0;
8445
+ var func = args.pop();
8446
+ var _paths = args;
8447
+
8448
+ true && !(typeof func === 'function') && emberDebug.assert('_beforeObserver called without a function', typeof func === 'function');
8635
8449
 
8450
+ var paths = [];
8636
8451
  var addWatchedProperty = function (path) {
8637
8452
  paths.push(path);
8638
8453
  };
8639
8454
 
8640
- var _paths = args.slice(0, -1);
8641
-
8642
- if (typeof func !== 'function') {
8643
- // revert to old, soft-deprecated argument ordering
8644
-
8645
- func = args[0];
8646
- _paths = args.slice(1);
8647
- }
8648
-
8649
- paths = [];
8650
-
8651
8455
  for (var i = 0; i < _paths.length; ++i) {
8652
8456
  expandProperties(_paths[i], addWatchedProperty);
8653
8457
  }
8654
8458
 
8655
- if (typeof func !== 'function') {
8656
- throw new emberDebug.EmberError('_beforeObserver called without a function');
8657
- }
8658
-
8659
8459
  func.__ember_observesBefore__ = paths;
8660
8460
  return func;
8661
8461
  }
@@ -8685,10 +8485,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8685
8485
  }
8686
8486
 
8687
8487
  function injectedPropertyGet(keyName) {
8688
- var desc = this[keyName];
8488
+ var desc = descriptorFor(this, keyName);
8689
8489
  var owner = emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat
8690
8490
 
8691
- true && !(desc && desc.isDescriptor && desc.type) && emberDebug.assert('InjectedProperties should be defined with the inject computed property macros.', desc && desc.isDescriptor && desc.type);
8491
+ true && !(desc && desc.type) && emberDebug.assert('InjectedProperties should be defined with the inject computed property macros.', desc && desc.type);
8692
8492
  true && !owner && emberDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner);
8693
8493
 
8694
8494
  return owner.lookup(desc.type + ':' + (desc.name || keyName));
@@ -8737,7 +8537,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8737
8537
 
8738
8538
  function isProxy(value) {
8739
8539
  if (typeof value === 'object' && value !== null) {
8740
- var meta$$1 = exports.peekMeta(value);
8540
+ var meta$$1 = peekMeta(value);
8741
8541
  return meta$$1 === undefined ? false : meta$$1.isProxy();
8742
8542
  }
8743
8543
 
@@ -8773,7 +8573,15 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8773
8573
  Object.defineProperty(obj, key, this.desc);
8774
8574
  };
8775
8575
 
8776
- Descriptor$$1.prototype.teardown = function teardown(obj, key) {};
8576
+ Descriptor$$1.prototype.get = function get(obj, key) {
8577
+ return obj[key];
8578
+ };
8579
+
8580
+ Descriptor$$1.prototype.set = function set(obj, key, value) {
8581
+ return obj[key] = value;
8582
+ };
8583
+
8584
+ Descriptor$$1.prototype.teardown = function teardown() {};
8777
8585
 
8778
8586
  return Descriptor$$1;
8779
8587
  }(Descriptor);
@@ -8794,8 +8602,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8794
8602
  exports.setOnerror = setOnerror;
8795
8603
  exports.setDispatchOverride = setDispatchOverride;
8796
8604
  exports.getDispatchOverride = getDispatchOverride;
8797
- exports.META_DESC = META_DESC;
8605
+ exports.descriptorFor = descriptorFor;
8798
8606
  exports.meta = meta;
8607
+ exports.peekMeta = peekMeta;
8799
8608
  exports.deleteMeta = deleteMeta;
8800
8609
  exports.Cache = Cache;
8801
8610
  exports._getPath = _getPath;
@@ -8803,8 +8612,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8803
8612
  exports.getWithDefault = getWithDefault;
8804
8613
  exports.set = set;
8805
8614
  exports.trySet = trySet;
8806
- exports.WeakMap = WeakMap$1;
8807
- exports.WeakMapPolyfill = WeakMapPolyfill;
8808
8615
  exports.addListener = addListener;
8809
8616
  exports.hasListeners = hasListeners;
8810
8617
  exports.listenersFor = listenersFor;
@@ -8858,7 +8665,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8858
8665
  exports._removeBeforeObserver = _removeBeforeObserver;
8859
8666
  exports.Mixin = Mixin;
8860
8667
  exports.aliasMethod = aliasMethod;
8861
- exports._immediateObserver = _immediateObserver;
8862
8668
  exports._beforeObserver = _beforeObserver;
8863
8669
  exports.mixin = mixin;
8864
8670
  exports.observer = observer;
@@ -11148,16 +10954,11 @@ enifed('rsvp', ['exports', 'ember-babel', 'node-module'], function (exports, _em
11148
10954
  scheduleFlush$1 = useSetTimeout();
11149
10955
  }
11150
10956
 
11151
- var platform = void 0;
11152
-
11153
10957
  /* global self */
11154
10958
  if (typeof self === 'object') {
11155
- platform = self;
11156
10959
 
11157
10960
  /* global global */
11158
- } else if (typeof global === 'object') {
11159
- platform = global;
11160
- } else {
10961
+ } else if (typeof global === 'object') {} else {
11161
10962
  throw new Error('no global: `self` or `global` found');
11162
10963
  }
11163
10964