ember-source 2.17.2 → 2.18.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: 88f279808b47b8cb3bf5c3b05c68aa44e52761df5681969d9618e54f30042e6c
4
- data.tar.gz: 91af64861625b8962ec410954aeb575af88d7445659bd9421f01d88238d2a80c
3
+ metadata.gz: 0a1f07f335db8b7372bb82060ed1f93972af30747e3936b4c31fbaf1a968e4e3
4
+ data.tar.gz: 182d672ee9a3b25cc581d83dea780304026b8d962cfb2b84763372312ef18627
5
5
  SHA512:
6
- metadata.gz: 3267332ad1bb675df2be5dd2851d0e9eb4e043ef3b276a7da216d948d23a3b0135dc42fc9b6e32213ae75948e9dca8aa3d772d3e6cf41feb5700c8f28a6bba94
7
- data.tar.gz: 437911cd8ea5bca3754dbb36ac0683824c3de0ffbdfb3cd29715b876f9f40dd1d1bacac5e2d043d66bd464eaef27345a5b317fbf41c8a8a83dead8028d558c26
6
+ metadata.gz: 536178cc4558abdeeea5ddbf3b01e1b635307d023f6eb0bfe3fb010e4e7714c71b948fb7d8c4757b13df184e9595a3acf65ef0b3b63130f0ca58e4a010f76cbf
7
+ data.tar.gz: 0c94bd7e28233c9ba2a900a2f2febcd8dab734ec53dd03b33d48ac67cd1656a411c454cb580bf7706cf14954d22fd7354b17752fa9c79cdba8ce0966cf3b2100
@@ -6,51 +6,14 @@
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.17.2
9
+ * @version 2.18.0-beta.1
10
10
  */
11
11
 
12
+ /*global process */
12
13
  var enifed, requireModule, Ember;
13
14
  var mainContext = this; // Used in ember-environment/lib/global.js
14
15
 
15
16
  (function() {
16
- var isNode = typeof window === 'undefined' &&
17
- typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
18
-
19
- if (!isNode) {
20
- Ember = this.Ember = this.Ember || {};
21
- }
22
-
23
- if (typeof Ember === 'undefined') { Ember = {}; }
24
-
25
- if (typeof Ember.__loader === 'undefined') {
26
- var registry = {};
27
- var seen = {};
28
-
29
- enifed = function(name, deps, callback) {
30
- var value = { };
31
-
32
- if (!callback) {
33
- value.deps = [];
34
- value.callback = deps;
35
- } else {
36
- value.deps = deps;
37
- value.callback = callback;
38
- }
39
-
40
- registry[name] = value;
41
- };
42
-
43
- requireModule = function(name) {
44
- return internalRequire(name, null);
45
- };
46
-
47
- // setup `require` module
48
- requireModule['default'] = requireModule;
49
-
50
- requireModule.has = function registryHas(moduleName) {
51
- return !!registry[moduleName] || !!registry[moduleName + '/index'];
52
- };
53
-
54
17
  function missingModule(name, referrerName) {
55
18
  if (referrerName) {
56
19
  throw new Error('Could not find module ' + name + ' required by: ' + referrerName);
@@ -99,6 +62,44 @@ var mainContext = this; // Used in ember-environment/lib/global.js
99
62
  return exports;
100
63
  }
101
64
 
65
+ var isNode = typeof window === 'undefined' &&
66
+ typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
67
+
68
+ if (!isNode) {
69
+ Ember = this.Ember = this.Ember || {};
70
+ }
71
+
72
+ if (typeof Ember === 'undefined') { Ember = {}; }
73
+
74
+ if (typeof Ember.__loader === 'undefined') {
75
+ var registry = {};
76
+ var seen = {};
77
+
78
+ enifed = function(name, deps, callback) {
79
+ var value = { };
80
+
81
+ if (!callback) {
82
+ value.deps = [];
83
+ value.callback = deps;
84
+ } else {
85
+ value.deps = deps;
86
+ value.callback = callback;
87
+ }
88
+
89
+ registry[name] = value;
90
+ };
91
+
92
+ requireModule = function(name) {
93
+ return internalRequire(name, null);
94
+ };
95
+
96
+ // setup `require` module
97
+ requireModule['default'] = requireModule;
98
+
99
+ requireModule.has = function registryHas(moduleName) {
100
+ return !!registry[moduleName] || !!registry[moduleName + '/index'];
101
+ };
102
+
102
103
  requireModule._eak_seen = registry;
103
104
 
104
105
  Ember.__loader = {
@@ -134,52 +135,112 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
134
135
  @private
135
136
  @class Container
136
137
  */
137
- function Container(registry) {
138
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
139
138
 
140
- this.registry = registry;
141
- this.owner = options.owner || null;
142
- this.cache = (0, _emberUtils.dictionary)(options.cache || null);
143
- this.factoryManagerCache = (0, _emberUtils.dictionary)(options.factoryManagerCache || null);
144
- this[CONTAINER_OVERRIDE] = undefined;
145
- this.isDestroyed = false;
139
+ var Container = function () {
140
+ function Container(registry) {
141
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
142
+ (0, _emberBabel.classCallCheck)(this, Container);
143
+
144
+ this.registry = registry;
145
+ this.owner = options.owner || null;
146
+ this.cache = (0, _emberUtils.dictionary)(options.cache || null);
147
+ this.factoryManagerCache = (0, _emberUtils.dictionary)(options.factoryManagerCache || null);
148
+ this[CONTAINER_OVERRIDE] = undefined;
149
+ this.isDestroyed = false;
146
150
 
147
- if (true) {
148
- this.validationCache = (0, _emberUtils.dictionary)(options.validationCache || null);
151
+ if (true) {
152
+ this.validationCache = (0, _emberUtils.dictionary)(options.validationCache || null);
153
+ }
149
154
  }
150
- }
151
155
 
152
- Container.prototype = {
153
- lookup: function (fullName, options) {
154
- (true && !(this.registry.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(fullName)));
156
+ /**
157
+ @private
158
+ @property registry
159
+ @type Registry
160
+ @since 1.11.0
161
+ */
155
162
 
156
- return lookup(this, this.registry.normalize(fullName), options);
157
- },
158
- destroy: function () {
163
+ /**
164
+ @private
165
+ @property cache
166
+ @type InheritingDict
167
+ */
168
+
169
+ /**
170
+ @private
171
+ @property validationCache
172
+ @type InheritingDict
173
+ */
174
+
175
+ /**
176
+ Given a fullName return a corresponding instance.
177
+ The default behavior is for lookup to return a singleton instance.
178
+ The singleton is scoped to the container, allowing multiple containers
179
+ to all have their own locally scoped singletons.
180
+ ```javascript
181
+ let registry = new Registry();
182
+ let container = registry.container();
183
+ registry.register('api:twitter', Twitter);
184
+ let twitter = container.lookup('api:twitter');
185
+ twitter instanceof Twitter; // => true
186
+ // by default the container will return singletons
187
+ let twitter2 = container.lookup('api:twitter');
188
+ twitter2 instanceof Twitter; // => true
189
+ twitter === twitter2; //=> true
190
+ ```
191
+ If singletons are not wanted, an optional flag can be provided at lookup.
192
+ ```javascript
193
+ let registry = new Registry();
194
+ let container = registry.container();
195
+ registry.register('api:twitter', Twitter);
196
+ let twitter = container.lookup('api:twitter', { singleton: false });
197
+ let twitter2 = container.lookup('api:twitter', { singleton: false });
198
+ twitter === twitter2; //=> false
199
+ ```
200
+ @private
201
+ @method lookup
202
+ @param {String} fullName
203
+ @param {Object} [options]
204
+ @param {String} [options.source] The fullname of the request source (used for local lookup)
205
+ @return {any}
206
+ */
207
+
208
+
209
+ Container.prototype.lookup = function lookup(fullName, options) {
210
+ (true && !(this.registry.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.isValidFullName(fullName)));
211
+
212
+ return _lookup(this, this.registry.normalize(fullName), options);
213
+ };
214
+
215
+ Container.prototype.destroy = function destroy() {
159
216
  destroyDestroyables(this);
160
217
  this.isDestroyed = true;
161
- },
162
- reset: function (fullName) {
218
+ };
219
+
220
+ Container.prototype.reset = function reset(fullName) {
163
221
  if (fullName === undefined) {
164
222
  resetCache(this);
165
223
  } else {
166
224
  resetMember(this, this.registry.normalize(fullName));
167
225
  }
168
- },
169
- ownerInjection: function () {
226
+ };
227
+
228
+ Container.prototype.ownerInjection = function ownerInjection() {
170
229
  var _ref;
171
230
 
172
231
  return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref;
173
- },
174
- _resolverCacheKey: function (name, options) {
232
+ };
233
+
234
+ Container.prototype._resolverCacheKey = function _resolverCacheKey(name, options) {
175
235
  return this.registry.resolverCacheKey(name, options);
176
- },
177
- factoryFor: function (fullName) {
236
+ };
237
+
238
+ Container.prototype.factoryFor = function factoryFor(fullName) {
178
239
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
179
240
 
180
241
  var normalizedName = this.registry.normalize(fullName);
181
242
 
182
- (true && !(this.registry.validateFullName(normalizedName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(normalizedName)));
243
+ (true && !(this.registry.isValidFullName(normalizedName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.isValidFullName(normalizedName)));
183
244
 
184
245
 
185
246
  if (options.source) {
@@ -224,8 +285,10 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
224
285
 
225
286
  this.factoryManagerCache[cacheKey] = manager;
226
287
  return manager;
227
- }
228
- };
288
+ };
289
+
290
+ return Container;
291
+ }();
229
292
 
230
293
  /*
231
294
  * Wrap a factory manager in a proxy which will not permit properties to be
@@ -264,7 +327,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
264
327
  return container.registry.getOption(fullName, 'instantiate') !== false;
265
328
  }
266
329
 
267
- function lookup(container, fullName) {
330
+ function _lookup(container, fullName) {
268
331
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
269
332
 
270
333
  if (options.source) {
@@ -351,28 +414,19 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
351
414
  throw new Error('Could not create factory');
352
415
  }
353
416
 
354
- function buildInjections() /* container, ...injections */{
417
+ function buildInjections(container, injections) {
355
418
  var hash = {};
356
419
  var isDynamic = false;
357
420
 
358
- if (arguments.length > 1) {
359
- var container = arguments[0];
360
- var injections = [];
361
- var injection = void 0;
362
-
363
- for (var i = 1; i < arguments.length; i++) {
364
- if (arguments[i]) {
365
- injections = injections.concat(arguments[i]);
366
- }
367
- }
368
-
421
+ if (injections.length > 0) {
369
422
  if (true) {
370
423
  container.registry.validateInjections(injections);
371
424
  }
372
425
 
373
- for (var _i = 0; _i < injections.length; _i++) {
374
- injection = injections[_i];
375
- hash[injection.property] = lookup(container, injection.fullName);
426
+ var injection = void 0;
427
+ for (var i = 0; i < injections.length; i++) {
428
+ injection = injections[i];
429
+ hash[injection.property] = _lookup(container, injection.fullName);
376
430
  if (!isDynamic) {
377
431
  isDynamic = !isSingleton(container, injection.fullName);
378
432
  }
@@ -384,10 +438,12 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
384
438
 
385
439
  function injectionsFor(container, fullName) {
386
440
  var registry = container.registry;
387
- var splitName = fullName.split(':');
388
- var type = splitName[0];
389
441
 
390
- return buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName));
442
+ var _fullName$split = fullName.split(':'),
443
+ type = _fullName$split[0];
444
+
445
+ var injections = registry.getTypeInjections(type).concat(registry.getInjections(fullName));
446
+ return buildInjections(container, injections);
391
447
  }
392
448
 
393
449
  function destroyDestroyables(container) {
@@ -516,40 +572,39 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
516
572
  @class Registry
517
573
  @since 1.11.0
518
574
  */
519
- function Registry() {
520
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
521
575
 
522
- this.fallback = options.fallback || null;
576
+ var Registry = function () {
577
+ function Registry() {
578
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
579
+ (0, _emberBabel.classCallCheck)(this, Registry);
580
+
581
+ this.fallback = options.fallback || null;
582
+ this.resolver = options.resolver || null;
523
583
 
524
- if (options.resolver) {
525
- this.resolver = options.resolver;
526
584
  if (typeof this.resolver === 'function') {
527
585
  deprecateResolverFunction(this);
528
586
  }
529
- }
530
587
 
531
- this.registrations = (0, _emberUtils.dictionary)(options.registrations || null);
588
+ this.registrations = (0, _emberUtils.dictionary)(options.registrations || null);
532
589
 
533
- this._typeInjections = (0, _emberUtils.dictionary)(null);
534
- this._injections = (0, _emberUtils.dictionary)(null);
590
+ this._typeInjections = (0, _emberUtils.dictionary)(null);
591
+ this._injections = (0, _emberUtils.dictionary)(null);
535
592
 
536
- this._localLookupCache = Object.create(null);
537
- this._normalizeCache = (0, _emberUtils.dictionary)(null);
538
- this._resolveCache = (0, _emberUtils.dictionary)(null);
539
- this._failCache = (0, _emberUtils.dictionary)(null);
593
+ this._localLookupCache = Object.create(null);
594
+ this._normalizeCache = (0, _emberUtils.dictionary)(null);
595
+ this._resolveCache = (0, _emberUtils.dictionary)(null);
596
+ this._failCache = (0, _emberUtils.dictionary)(null);
540
597
 
541
- this._options = (0, _emberUtils.dictionary)(null);
542
- this._typeOptions = (0, _emberUtils.dictionary)(null);
543
- }
598
+ this._options = (0, _emberUtils.dictionary)(null);
599
+ this._typeOptions = (0, _emberUtils.dictionary)(null);
600
+ }
544
601
 
545
- Registry.prototype = {
546
602
  /**
547
603
  A backup registry for resolving registrations when no matches can be found.
548
604
  @private
549
605
  @property fallback
550
606
  @type Registry
551
607
  */
552
- fallback: null,
553
608
 
554
609
  /**
555
610
  An object that has a `resolve` method that resolves a name.
@@ -557,81 +612,79 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
557
612
  @property resolver
558
613
  @type Resolver
559
614
  */
560
- resolver: null,
561
615
 
562
616
  /**
563
617
  @private
564
618
  @property registrations
565
619
  @type InheritingDict
566
620
  */
567
- registrations: null,
568
621
 
569
622
  /**
570
623
  @private
571
624
  @property _typeInjections
572
625
  @type InheritingDict
573
626
  */
574
- _typeInjections: null,
575
627
 
576
628
  /**
577
629
  @private
578
630
  @property _injections
579
631
  @type InheritingDict
580
632
  */
581
- _injections: null,
582
633
 
583
634
  /**
584
635
  @private
585
636
  @property _normalizeCache
586
637
  @type InheritingDict
587
638
  */
588
- _normalizeCache: null,
589
639
 
590
640
  /**
591
641
  @private
592
642
  @property _resolveCache
593
643
  @type InheritingDict
594
644
  */
595
- _resolveCache: null,
596
645
 
597
646
  /**
598
647
  @private
599
648
  @property _options
600
649
  @type InheritingDict
601
650
  */
602
- _options: null,
603
651
 
604
652
  /**
605
653
  @private
606
654
  @property _typeOptions
607
655
  @type InheritingDict
608
656
  */
609
- _typeOptions: null,
610
657
 
611
- container: function (options) {
658
+ /**
659
+ Creates a container based on this registry.
660
+ @private
661
+ @method container
662
+ @param {Object} options
663
+ @return {Container} created container
664
+ */
665
+
666
+
667
+ Registry.prototype.container = function container(options) {
612
668
  return new Container(this, options);
613
- },
614
- register: function (fullName, factory) {
669
+ };
670
+
671
+ Registry.prototype.register = function register(fullName, factory) {
615
672
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
616
- (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));
673
+ (true && !(this.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));
674
+ (true && !(factory !== undefined) && (0, _emberDebug.assert)('Attempting to register an unknown factory: \'' + fullName + '\'', factory !== undefined));
617
675
 
618
676
 
619
- if (factory === undefined) {
620
- throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\'');
621
- }
622
-
623
677
  var normalizedName = this.normalize(fullName);
678
+ (true && !(!this._resolveCache[normalizedName]) && (0, _emberDebug.assert)('Cannot re-register: \'' + fullName + '\', as it has already been resolved.', !this._resolveCache[normalizedName]));
624
679
 
625
- if (this._resolveCache[normalizedName]) {
626
- throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.');
627
- }
628
680
 
629
681
  delete this._failCache[normalizedName];
630
682
  this.registrations[normalizedName] = factory;
631
683
  this._options[normalizedName] = options;
632
- },
633
- unregister: function (fullName) {
634
- (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));
684
+ };
685
+
686
+ Registry.prototype.unregister = function unregister(fullName) {
687
+ (true && !(this.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));
635
688
 
636
689
 
637
690
  var normalizedName = this.normalize(fullName);
@@ -642,83 +695,94 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
642
695
  delete this._resolveCache[normalizedName];
643
696
  delete this._failCache[normalizedName];
644
697
  delete this._options[normalizedName];
645
- },
646
- resolve: function (fullName, options) {
647
- (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));
698
+ };
699
+
700
+ Registry.prototype.resolve = function resolve(fullName, options) {
701
+ (true && !(this.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));
648
702
 
649
- var factory = resolve(this, this.normalize(fullName), options);
650
- if (factory === undefined && this.fallback) {
703
+ var factory = _resolve(this, this.normalize(fullName), options);
704
+ if (factory === undefined && this.fallback !== null) {
651
705
  var _fallback;
652
706
 
653
707
  factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments);
654
708
  }
655
709
  return factory;
656
- },
657
- describe: function (fullName) {
658
- if (this.resolver && this.resolver.lookupDescription) {
710
+ };
711
+
712
+ Registry.prototype.describe = function describe(fullName) {
713
+ if (this.resolver !== null && this.resolver.lookupDescription) {
659
714
  return this.resolver.lookupDescription(fullName);
660
- } else if (this.fallback) {
715
+ } else if (this.fallback !== null) {
661
716
  return this.fallback.describe(fullName);
662
717
  } else {
663
718
  return fullName;
664
719
  }
665
- },
666
- normalizeFullName: function (fullName) {
667
- if (this.resolver && this.resolver.normalize) {
720
+ };
721
+
722
+ Registry.prototype.normalizeFullName = function normalizeFullName(fullName) {
723
+ if (this.resolver !== null && this.resolver.normalize) {
668
724
  return this.resolver.normalize(fullName);
669
- } else if (this.fallback) {
725
+ } else if (this.fallback !== null) {
670
726
  return this.fallback.normalizeFullName(fullName);
671
727
  } else {
672
728
  return fullName;
673
729
  }
674
- },
675
- normalize: function (fullName) {
730
+ };
731
+
732
+ Registry.prototype.normalize = function normalize(fullName) {
676
733
  return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName));
677
- },
678
- makeToString: function (factory, fullName) {
679
- if (this.resolver && this.resolver.makeToString) {
734
+ };
735
+
736
+ Registry.prototype.makeToString = function makeToString(factory, fullName) {
737
+ if (this.resolver !== null && this.resolver.makeToString) {
680
738
  return this.resolver.makeToString(factory, fullName);
681
- } else if (this.fallback) {
739
+ } else if (this.fallback !== null) {
682
740
  return this.fallback.makeToString(factory, fullName);
683
741
  } else {
684
742
  return factory.toString();
685
743
  }
686
- },
687
- has: function (fullName, options) {
744
+ };
745
+
746
+ Registry.prototype.has = function has(fullName, options) {
688
747
  if (!this.isValidFullName(fullName)) {
689
748
  return false;
690
749
  }
691
750
 
692
751
  var source = options && options.source && this.normalize(options.source);
693
752
 
694
- return has(this, this.normalize(fullName), source);
695
- },
696
- optionsForType: function (type, options) {
753
+ return _has(this, this.normalize(fullName), source);
754
+ };
755
+
756
+ Registry.prototype.optionsForType = function optionsForType(type, options) {
697
757
  this._typeOptions[type] = options;
698
- },
699
- getOptionsForType: function (type) {
758
+ };
759
+
760
+ Registry.prototype.getOptionsForType = function getOptionsForType(type) {
700
761
  var optionsForType = this._typeOptions[type];
701
- if (optionsForType === undefined && this.fallback) {
762
+ if (optionsForType === undefined && this.fallback !== null) {
702
763
  optionsForType = this.fallback.getOptionsForType(type);
703
764
  }
704
765
  return optionsForType;
705
- },
706
- options: function (fullName) {
707
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
766
+ };
767
+
768
+ Registry.prototype.options = function options(fullName) {
769
+ var _options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
708
770
 
709
771
  var normalizedName = this.normalize(fullName);
710
- this._options[normalizedName] = options;
711
- },
712
- getOptions: function (fullName) {
772
+ this._options[normalizedName] = _options;
773
+ };
774
+
775
+ Registry.prototype.getOptions = function getOptions(fullName) {
713
776
  var normalizedName = this.normalize(fullName);
714
777
  var options = this._options[normalizedName];
715
778
 
716
- if (options === undefined && this.fallback) {
779
+ if (options === undefined && this.fallback !== null) {
717
780
  options = this.fallback.getOptions(fullName);
718
781
  }
719
782
  return options;
720
- },
721
- getOption: function (fullName, optionName) {
783
+ };
784
+
785
+ Registry.prototype.getOption = function getOption(fullName, optionName) {
722
786
  var options = this._options[fullName];
723
787
 
724
788
  if (options && options[optionName] !== undefined) {
@@ -730,40 +794,44 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
730
794
 
731
795
  if (options && options[optionName] !== undefined) {
732
796
  return options[optionName];
733
- } else if (this.fallback) {
797
+ } else if (this.fallback !== null) {
734
798
  return this.fallback.getOption(fullName, optionName);
735
799
  }
736
- },
737
- typeInjection: function (type, property, fullName) {
738
- (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));
800
+ };
801
+
802
+ Registry.prototype.typeInjection = function typeInjection(type, property, fullName) {
803
+ (true && !(this.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));
739
804
 
740
805
 
741
806
  var fullNameType = fullName.split(':')[0];
742
- if (fullNameType === type) {
743
- throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).');
744
- }
807
+ (true && !(fullNameType !== type) && (0, _emberDebug.assert)('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).', fullNameType !== type));
808
+
745
809
 
746
810
  var injections = this._typeInjections[type] || (this._typeInjections[type] = []);
747
811
 
748
812
  injections.push({ property: property, fullName: fullName });
749
- },
750
- injection: function (fullName, property, injectionName) {
751
- this.validateFullName(injectionName);
813
+ };
814
+
815
+ Registry.prototype.injection = function injection(fullName, property, injectionName) {
816
+ (true && !(this.isValidFullName(injectionName)) && (0, _emberDebug.assert)('Invalid injectionName, expected: \'type:name\' got: ' + injectionName, this.isValidFullName(injectionName)));
817
+
818
+
752
819
  var normalizedInjectionName = this.normalize(injectionName);
753
820
 
754
821
  if (fullName.indexOf(':') === -1) {
755
822
  return this.typeInjection(fullName, property, normalizedInjectionName);
756
823
  }
757
824
 
758
- (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));
825
+ (true && !(this.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));
759
826
 
760
827
  var normalizedName = this.normalize(fullName);
761
828
 
762
829
  var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []);
763
830
 
764
831
  injections.push({ property: property, fullName: normalizedInjectionName });
765
- },
766
- knownForType: function (type) {
832
+ };
833
+
834
+ Registry.prototype.knownForType = function knownForType(type) {
767
835
  var fallbackKnown = void 0,
768
836
  resolverKnown = void 0;
769
837
 
@@ -778,72 +846,70 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
778
846
  }
779
847
  }
780
848
 
781
- if (this.fallback) {
849
+ if (this.fallback !== null) {
782
850
  fallbackKnown = this.fallback.knownForType(type);
783
851
  }
784
852
 
785
- if (this.resolver && this.resolver.knownForType) {
853
+ if (this.resolver !== null && this.resolver.knownForType) {
786
854
  resolverKnown = this.resolver.knownForType(type);
787
855
  }
788
856
 
789
857
  return (0, _emberUtils.assign)({}, fallbackKnown, localKnown, resolverKnown);
790
- },
791
- validateFullName: function (fullName) {
792
- if (!this.isValidFullName(fullName)) {
793
- throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName);
794
- }
858
+ };
795
859
 
796
- return true;
797
- },
798
- isValidFullName: function (fullName) {
860
+ Registry.prototype.isValidFullName = function isValidFullName(fullName) {
799
861
  return VALID_FULL_NAME_REGEXP.test(fullName);
800
- },
801
- getInjections: function (fullName) {
862
+ };
863
+
864
+ Registry.prototype.getInjections = function getInjections(fullName) {
802
865
  var injections = this._injections[fullName] || [];
803
- if (this.fallback) {
866
+ if (this.fallback !== null) {
804
867
  injections = injections.concat(this.fallback.getInjections(fullName));
805
868
  }
806
869
  return injections;
807
- },
808
- getTypeInjections: function (type) {
870
+ };
871
+
872
+ Registry.prototype.getTypeInjections = function getTypeInjections(type) {
809
873
  var injections = this._typeInjections[type] || [];
810
- if (this.fallback) {
874
+ if (this.fallback !== null) {
811
875
  injections = injections.concat(this.fallback.getTypeInjections(type));
812
876
  }
813
877
  return injections;
814
- },
815
- resolverCacheKey: function (name, options) {
878
+ };
879
+
880
+ Registry.prototype.resolverCacheKey = function resolverCacheKey(name, options) {
816
881
  if (!_features.EMBER_MODULE_UNIFICATION) {
817
882
  return name;
818
883
  }
819
884
 
820
885
  return options && options.source ? options.source + ':' + name : name;
821
- },
822
- expandLocalLookup: function (fullName, options) {
823
- if (this.resolver && this.resolver.expandLocalLookup) {
824
- (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));
886
+ };
887
+
888
+ Registry.prototype.expandLocalLookup = function expandLocalLookup(fullName, options) {
889
+ if (this.resolver !== null && this.resolver.expandLocalLookup) {
890
+ (true && !(this.isValidFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));
825
891
  (true && !(options && options.source) && (0, _emberDebug.assert)('options.source must be provided to expandLocalLookup', options && options.source));
826
- (true && !(this.validateFullName(options.source)) && (0, _emberDebug.assert)('options.source must be a proper full name', this.validateFullName(options.source)));
892
+ (true && !(this.isValidFullName(options.source)) && (0, _emberDebug.assert)('options.source must be a proper full name', this.isValidFullName(options.source)));
827
893
 
828
894
 
829
895
  var normalizedFullName = this.normalize(fullName);
830
896
  var normalizedSource = this.normalize(options.source);
831
897
 
832
- return expandLocalLookup(this, normalizedFullName, normalizedSource);
833
- } else if (this.fallback) {
898
+ return _expandLocalLookup(this, normalizedFullName, normalizedSource);
899
+ } else if (this.fallback !== null) {
834
900
  return this.fallback.expandLocalLookup(fullName, options);
835
901
  } else {
836
902
  return null;
837
903
  }
838
- }
839
- };
904
+ };
905
+
906
+ return Registry;
907
+ }();
840
908
 
841
909
  function deprecateResolverFunction(registry) {
842
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' }));
843
911
 
844
- registry.resolver = {
845
- resolve: registry.resolver
846
- };
912
+ registry.resolver = { resolve: registry.resolver };
847
913
  }
848
914
 
849
915
  if (true) {
@@ -852,7 +918,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
852
918
 
853
919
  for (var key in hash) {
854
920
  if (hash.hasOwnProperty(key)) {
855
- (true && !(this.validateFullName(hash[key])) && (0, _emberDebug.assert)('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key])));
921
+ (true && !(this.isValidFullName(hash[key])) && (0, _emberDebug.assert)('Expected a proper full name, given \'' + hash[key] + '\'', this.isValidFullName(hash[key])));
856
922
 
857
923
 
858
924
  injections.push({
@@ -880,7 +946,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
880
946
  };
881
947
  }
882
948
 
883
- function expandLocalLookup(registry, normalizedName, normalizedSource) {
949
+ function _expandLocalLookup(registry, normalizedName, normalizedSource) {
884
950
  var cache = registry._localLookupCache;
885
951
  var normalizedNameCache = cache[normalizedName];
886
952
 
@@ -899,7 +965,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
899
965
  return normalizedNameCache[normalizedSource] = expanded;
900
966
  }
901
967
 
902
- function resolve(registry, normalizedName, options) {
968
+ function _resolve(registry, normalizedName, options) {
903
969
  if (options && options.source) {
904
970
  // when `source` is provided expand normalizedName
905
971
  // and source into the full normalizedName
@@ -948,7 +1014,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
948
1014
  return resolved;
949
1015
  }
950
1016
 
951
- function has(registry, fullName, source) {
1017
+ function _has(registry, fullName, source) {
952
1018
  return registry.resolve(fullName, { source: source }) !== undefined;
953
1019
  }
954
1020
 
@@ -963,9 +1029,9 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
963
1029
  return name;
964
1030
  }
965
1031
 
966
- var _fullName$split = fullName.split(':'),
967
- type = _fullName$split[0],
968
- rawName = _fullName$split[1];
1032
+ var _fullName$split2 = fullName.split(':'),
1033
+ type = _fullName$split2[0],
1034
+ rawName = _fullName$split2[1];
969
1035
 
970
1036
  return privateNames[fullName] = (0, _emberUtils.intern)(type + ':' + rawName + '-' + privateSuffix);
971
1037
  }
@@ -1074,13 +1140,7 @@ enifed('ember-console', ['exports', 'ember-environment'], function (exports, _em
1074
1140
  return;
1075
1141
  }
1076
1142
 
1077
- if (typeof method.bind === 'function') {
1078
- return method.bind(consoleObj);
1079
- }
1080
-
1081
- return function () {
1082
- method.apply(consoleObj, arguments);
1083
- };
1143
+ return method.bind(consoleObj);
1084
1144
  }
1085
1145
 
1086
1146
  function assertPolyfill(test, message) {
@@ -4850,6 +4910,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4850
4910
  }
4851
4911
 
4852
4912
  var ret = this._getter.call(obj, keyName);
4913
+
4853
4914
  cache[keyName] = ret === undefined ? UNDEFINED : ret;
4854
4915
 
4855
4916
  var chainWatchers = meta$$1.readableChainWatchers();
@@ -4905,14 +4966,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4905
4966
  ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) {
4906
4967
  var meta$$1 = meta(obj);
4907
4968
  var cache = meta$$1.writableCache();
4908
- var hadCachedValue = false;
4909
- var cachedValue = void 0;
4969
+
4910
4970
  var val = cache[keyName];
4911
- if (val !== undefined) {
4912
- if (val !== UNDEFINED) {
4913
- cachedValue = val;
4914
- }
4915
- hadCachedValue = true;
4971
+ var hadCachedValue = val !== undefined;
4972
+
4973
+ var cachedValue = void 0;
4974
+ if (hadCachedValue && val !== UNDEFINED) {
4975
+ cachedValue = val;
4916
4976
  }
4917
4977
 
4918
4978
  var ret = this._setter.call(obj, keyName, value, cachedValue);
@@ -4924,17 +4984,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4924
4984
 
4925
4985
  propertyWillChange(obj, keyName, meta$$1);
4926
4986
 
4927
- if (hadCachedValue) {
4928
- cache[keyName] = undefined;
4929
- } else {
4987
+ if (!hadCachedValue) {
4930
4988
  addDependentKeys(this, obj, keyName, meta$$1);
4931
4989
  }
4932
4990
 
4933
- if (ret === undefined) {
4934
- cache[keyName] = UNDEFINED;
4935
- } else {
4936
- cache[keyName] = ret;
4937
- }
4991
+ cache[keyName] = ret === undefined ? UNDEFINED : ret;
4938
4992
 
4939
4993
  propertyDidChange(obj, keyName, meta$$1);
4940
4994
 
@@ -6461,17 +6515,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
6461
6515
  this._coreLibIndex = 0;
6462
6516
  }
6463
6517
 
6464
- Libraries.prototype.isRegistered = function isRegistered(name) {
6465
- return !!this._getLibraryByName(name);
6466
- };
6467
-
6468
- return Libraries;
6469
- }();
6470
-
6471
- Libraries.prototype = {
6472
- constructor: Libraries,
6473
-
6474
- _getLibraryByName: function (name) {
6518
+ Libraries.prototype._getLibraryByName = function _getLibraryByName(name) {
6475
6519
  var libs = this._registry;
6476
6520
  var count = libs.length;
6477
6521
 
@@ -6480,8 +6524,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
6480
6524
  return libs[i];
6481
6525
  }
6482
6526
  }
6483
- },
6484
- register: function (name, version, isCoreLibrary) {
6527
+ };
6528
+
6529
+ Libraries.prototype.register = function register(name, version, isCoreLibrary) {
6485
6530
  var index = this._registry.length;
6486
6531
 
6487
6532
  if (!this._getLibraryByName(name)) {
@@ -6492,11 +6537,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
6492
6537
  } else {
6493
6538
  true && emberDebug.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' });
6494
6539
  }
6495
- },
6496
- registerCoreLibrary: function (name, version) {
6540
+ };
6541
+
6542
+ Libraries.prototype.registerCoreLibrary = function registerCoreLibrary(name, version) {
6497
6543
  this.register(name, version, true);
6498
- },
6499
- deRegister: function (name) {
6544
+ };
6545
+
6546
+ Libraries.prototype.deRegister = function deRegister(name) {
6500
6547
  var lib = this._getLibraryByName(name);
6501
6548
  var index = void 0;
6502
6549
 
@@ -6504,8 +6551,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
6504
6551
  index = this._registry.indexOf(lib);
6505
6552
  this._registry.splice(index, 1);
6506
6553
  }
6507
- }
6508
- };
6554
+ };
6555
+
6556
+ return Libraries;
6557
+ }();
6509
6558
 
6510
6559
  if (ember_features.EMBER_LIBRARIES_ISREGISTERED) {
6511
6560
  Libraries.prototype.isRegistered = function (name) {