ember-source 2.16.0.beta.1 → 2.16.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d85b6e19b02f07d2dae48c38161c7ea10ecb2cc
4
- data.tar.gz: 5abe67d6938b0132ef8ea2d1cfc1c7a3e46740d8
3
+ metadata.gz: 475e7db17b8b57155cfa98a604cbab329fd92038
4
+ data.tar.gz: e3c43638f235929b6c391b1d956a4d7ffa22e654
5
5
  SHA512:
6
- metadata.gz: ad9804f06f9c92728ee2387041926e39447c5c00974e565e715f94f15ca304ee427d54bae6afce4e2b891808010db35ac81ead7986542c492729856cd7252da4
7
- data.tar.gz: 7f633d6f52adc0b262969b47b8547d71f0a279e23e8497c2c5f20ba2d08c3bd252abdc19578626a5851f4c8ac64762b7dd9ac1c6c85955aca451f0fb9ec7a995
6
+ metadata.gz: e6854e8807f2604fd5829b40c6c1dd1427531b55a3d0b5c32acaae79e217edd4807498125cac471fb742a9d6ae80333daf2df207e247fa6482ddff28a31e33b0
7
+ data.tar.gz: e599b4860f349c2c7d1287cbfae1c89256d90e819dd682eea08d6da3e114f8e643316a4e6e68a755de32b3dcea2a8ae2857e5b0679a195354f25d8b2c7d8740c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.16.0.beta.1
1
+ 2.16.0.beta.2
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 2.16.0-beta.1
9
+ * @version 2.16.0-beta.2
10
10
  */
11
11
 
12
12
  var enifed, requireModule, Ember;
@@ -112,7 +112,7 @@ var mainContext = this; // Used in ember-environment/lib/global.js
112
112
  }
113
113
  })();
114
114
 
115
- enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features', 'ember-environment'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features) {
115
+ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features) {
116
116
  'use strict';
117
117
 
118
118
  exports.Container = exports.privatize = exports.Registry = undefined;
@@ -494,7 +494,7 @@ enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'em
494
494
  if (typeof this.class._initFactory === 'function') {
495
495
  this.class._initFactory(this);
496
496
  } else {
497
- // in the non-Ember.Object case we need to still setOwner
497
+ // in the non-EmberObject case we need to still setOwner
498
498
  // this is required for supporting glimmer environment and
499
499
  // template instantiation which rely heavily on
500
500
  // `options[OWNER]` being passed into `create`
@@ -1788,7 +1788,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1788
1788
  */
1789
1789
  function hasListeners(obj, eventName) {
1790
1790
  var meta$$1 = exports.peekMeta(obj);
1791
- if (!meta$$1) {
1791
+ if (meta$$1 === undefined) {
1792
1792
  return false;
1793
1793
  }
1794
1794
  var matched = meta$$1.matchingListeners(eventName);
@@ -1851,6 +1851,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
1851
1851
 
1852
1852
  var func = args.pop();
1853
1853
  var events = args;
1854
+
1855
+ true && !(typeof func === 'function') && emberDebug.assert('Ember.on expects function as last argument', typeof func === 'function');
1856
+ true && !(events.length > 0 && events.every(function (p) {
1857
+ return typeof p === 'string' && p.length;
1858
+ })) && emberDebug.assert('Ember.on called without valid event names', events.length > 0 && events.every(function (p) {
1859
+ return typeof p === 'string' && p.length;
1860
+ }));
1861
+
1854
1862
  func.__ember_listens__ = events;
1855
1863
  return func;
1856
1864
  }
@@ -2453,7 +2461,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2453
2461
  function DEFAULT_GETTER_FUNCTION(name) {
2454
2462
  return function GETTER_FUNCTION() {
2455
2463
  var meta$$1 = exports.peekMeta(this);
2456
- if (meta$$1 !== null && meta$$1 !== undefined) {
2464
+ if (meta$$1 !== undefined) {
2457
2465
  return meta$$1.peekValues(name);
2458
2466
  }
2459
2467
  };
@@ -2463,7 +2471,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2463
2471
  function IGETTER_FUNCTION() {
2464
2472
  var meta$$1 = exports.peekMeta(this);
2465
2473
  var val = void 0;
2466
- if (meta$$1 !== null && meta$$1 !== undefined) {
2474
+ if (meta$$1 !== undefined) {
2467
2475
  val = meta$$1.readInheritedValue('values', name);
2468
2476
  }
2469
2477
 
@@ -2525,7 +2533,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2525
2533
  become the explicit value of this property.
2526
2534
  */
2527
2535
  function defineProperty(obj, keyName, desc, data, meta$$1) {
2528
- if (meta$$1 === null || meta$$1 === undefined) {
2536
+ if (meta$$1 === undefined) {
2529
2537
  meta$$1 = meta(obj);
2530
2538
  }
2531
2539
 
@@ -2713,7 +2721,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2713
2721
  var meta$$1 = _meta || exports.peekMeta(obj);
2714
2722
 
2715
2723
  // do nothing of this object has already been destroyed
2716
- if (!meta$$1 || meta$$1.isSourceDestroyed()) {
2724
+ if (meta$$1 === undefined || meta$$1.isSourceDestroyed()) {
2717
2725
  return;
2718
2726
  }
2719
2727
 
@@ -2924,9 +2932,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
2924
2932
  return;
2925
2933
  }
2926
2934
 
2927
- var meta$$1 = _meta || exports.peekMeta(obj);
2935
+ var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
2928
2936
 
2929
- if (!meta$$1 || !meta$$1.readableChainWatchers()) {
2937
+ if (meta$$1 === undefined || meta$$1.readableChainWatchers() === undefined) {
2930
2938
  return;
2931
2939
  }
2932
2940
 
@@ -4387,7 +4395,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4387
4395
  */
4388
4396
  function ComputedProperty(config, opts) {
4389
4397
  this.isDescriptor = true;
4390
- if (typeof config === 'function') {
4398
+ var hasGetterOnly = typeof config === 'function';
4399
+ if (hasGetterOnly) {
4391
4400
  this._getter = config;
4392
4401
  } else {
4393
4402
  true && !(typeof config === 'object' && !Array.isArray(config)) && emberDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config));
@@ -4405,8 +4414,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4405
4414
  this._suspended = undefined;
4406
4415
  this._meta = undefined;
4407
4416
  this._volatile = false;
4417
+
4408
4418
  this._dependentKeys = opts && opts.dependentKeys;
4409
- this._readOnly = false;
4419
+ this._readOnly = opts && hasGetterOnly && opts.readOnly === true;
4410
4420
  }
4411
4421
 
4412
4422
  ComputedProperty.prototype = new Descriptor();
@@ -4524,10 +4534,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4524
4534
  You can pass a hash of these values to a computed property like this:
4525
4535
 
4526
4536
  ```
4527
- person: Ember.computed(function() {
4537
+ import { computed } from '@ember/object';
4538
+ import Person from 'my-app/utils/person';
4539
+
4540
+ person: computed(function() {
4528
4541
  let personId = this.get('personId');
4529
- return App.Person.create({ id: personId });
4530
- }).meta({ type: App.Person })
4542
+ return Person.create({ id: personId });
4543
+ }).meta({ type: Person })
4531
4544
  ```
4532
4545
 
4533
4546
  The hash that you pass to the `meta()` function will be saved on the
@@ -4559,12 +4572,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4559
4572
 
4560
4573
  // don't create objects just to invalidate
4561
4574
  var meta$$1 = exports.peekMeta(obj);
4562
- if (!meta$$1 || meta$$1.source !== obj) {
4575
+ if (meta$$1 === undefined || meta$$1.source !== obj) {
4563
4576
  return;
4564
4577
  }
4565
4578
 
4566
4579
  var cache = meta$$1.readableCache();
4567
- if (cache && cache[keyName] !== undefined) {
4580
+ if (cache !== undefined && cache[keyName] !== undefined) {
4568
4581
  cache[keyName] = undefined;
4569
4582
  removeDependentKeys(this, obj, keyName, meta$$1);
4570
4583
  }
@@ -4586,14 +4599,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4586
4599
  }
4587
4600
 
4588
4601
  var ret = this._getter.call(obj, keyName);
4589
- if (ret === undefined) {
4590
- cache[keyName] = UNDEFINED;
4591
- } else {
4592
- cache[keyName] = ret;
4593
- }
4602
+ cache[keyName] = ret === undefined ? UNDEFINED : ret;
4594
4603
 
4595
4604
  var chainWatchers = meta$$1.readableChainWatchers();
4596
- if (chainWatchers) {
4605
+ if (chainWatchers !== undefined) {
4597
4606
  chainWatchers.revalidate(keyName);
4598
4607
  }
4599
4608
  addDependentKeys(this, obj, keyName, meta$$1);
@@ -4643,15 +4652,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
4643
4652
  };
4644
4653
 
4645
4654
  ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) {
4646
- // cache requires own meta
4647
4655
  var meta$$1 = meta(obj);
4648
- // either there is a writable cache or we need one to update
4649
4656
  var cache = meta$$1.writableCache();
4650
4657
  var hadCachedValue = false;
4651
4658
  var cachedValue = void 0;
4652
- if (cache[keyName] !== undefined) {
4653
- if (cache[keyName] !== UNDEFINED) {
4654
- cachedValue = cache[keyName];
4659
+ var val = cache[keyName];
4660
+ if (val !== undefined) {
4661
+ if (val !== UNDEFINED) {
4662
+ cachedValue = val;
4655
4663
  }
4656
4664
  hadCachedValue = true;
4657
4665
  }
@@ -5265,6 +5273,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5265
5273
  };
5266
5274
 
5267
5275
  var onerror = void 0;
5276
+ var onErrorTarget = {
5277
+ get onerror() {
5278
+ return dispatchOverride || onerror;
5279
+ }
5280
+ };
5281
+
5268
5282
  // Ember.onerror getter
5269
5283
  function getOnerror() {
5270
5284
  return onerror;
@@ -5356,7 +5370,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5356
5370
  }
5357
5371
 
5358
5372
  var meta$$1 = exports.peekMeta(obj);
5359
- if (meta$$1) {
5373
+ if (meta$$1 !== undefined) {
5360
5374
  var map = meta$$1.readableWeak();
5361
5375
  if (map !== undefined) {
5362
5376
  var val = map[this._id];
@@ -5401,7 +5415,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5401
5415
  }
5402
5416
 
5403
5417
  var meta$$1 = exports.peekMeta(obj);
5404
- if (meta$$1) {
5418
+ if (meta$$1 !== undefined) {
5405
5419
  var map = meta$$1.readableWeak();
5406
5420
  if (map !== undefined) {
5407
5421
  return map[this._id] !== undefined;
@@ -5593,15 +5607,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5593
5607
  run.currentRunLoop = next;
5594
5608
  }
5595
5609
 
5596
- var onErrorTarget = {
5597
- get onerror() {
5598
- return dispatchError;
5599
- },
5600
- set onerror(handler) {
5601
- return setOnerror(handler);
5602
- }
5603
- };
5604
-
5605
5610
  var backburner$1 = new Backburner(['sync', 'actions', 'destroy'], {
5606
5611
  GUID_KEY: emberUtils.GUID_KEY,
5607
5612
  sync: {
@@ -5709,16 +5714,26 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5709
5714
  We can use that setup option to do some additional setup for our component.
5710
5715
  The component itself could look something like the following:
5711
5716
 
5712
- ```javascript
5713
- App.RichTextEditorComponent = Ember.Component.extend({
5717
+ ```app/components/rich-text-editor.js
5718
+ import Component from '@ember/component';
5719
+ import { bind } from '@ember/runloop';
5720
+
5721
+ export default Component.extend({
5714
5722
  initializeTinyMCE: Ember.on('didInsertElement', function() {
5715
5723
  tinymce.init({
5716
5724
  selector: '#' + this.$().prop('id'),
5717
5725
  setup: Ember.run.bind(this, this.setupEditor)
5718
5726
  });
5719
5727
  }),
5728
+
5729
+ didInsertElement() {
5730
+ tinymce.init({
5731
+ selector: '#' + this.$().prop('id'),
5732
+ setup: Ember.run.bind(this, this.setupEditor)
5733
+ });
5734
+ }
5720
5735
 
5721
- setupEditor: function(editor) {
5736
+ setupEditor(editor) {
5722
5737
  this.set('editor', editor);
5723
5738
 
5724
5739
  editor.on('change', function() {
@@ -5729,7 +5744,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5729
5744
  ```
5730
5745
 
5731
5746
  In this example, we use Ember.run.bind to bind the setupEditor method to the
5732
- context of the App.RichTextEditorComponent and to have the invocation of that
5747
+ context of the RichTextEditor component and to have the invocation of that
5733
5748
  method be safely handled and executed by the Ember run loop.
5734
5749
 
5735
5750
  @method bind
@@ -5963,9 +5978,23 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5963
5978
  });
5964
5979
  ```
5965
5980
 
5966
- Also note that passing an anonymous function to `run.scheduleOnce` will
5967
- not prevent additional calls with an identical anonymous function from
5968
- scheduling the items multiple times, e.g.:
5981
+ Also note that for `run.scheduleOnce` to prevent additional calls, you need to
5982
+ pass the same function instance. The following case works as expected:
5983
+
5984
+ ```javascript
5985
+ function log() {
5986
+ console.log('Logging only once');
5987
+ }
5988
+
5989
+ function scheduleIt() {
5990
+ run.scheduleOnce('actions', myContext, log);
5991
+ }
5992
+
5993
+ scheduleIt();
5994
+ scheduleIt();
5995
+ ```
5996
+
5997
+ But this other case will schedule the function multiple times:
5969
5998
 
5970
5999
  ```javascript
5971
6000
  function scheduleIt() {
@@ -5978,7 +6007,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
5978
6007
  scheduleIt();
5979
6008
 
5980
6009
  // "Closure" will print twice, even though we're using `run.scheduleOnce`,
5981
- // because the function we pass to it is anonymous and won't match the
6010
+ // because the function we pass to it won't match the
5982
6011
  // previously scheduled operation.
5983
6012
  ```
5984
6013
 
@@ -6026,8 +6055,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
6026
6055
 
6027
6056
  Example:
6028
6057
 
6029
- ```javascript
6030
- export default Ember.Component.extend({
6058
+ ```app/components/my-component.js
6059
+ import Component from '@ember/component';
6060
+
6061
+ export Component.extend({
6031
6062
  didInsertElement() {
6032
6063
  this._super(...arguments);
6033
6064
  run.scheduleOnce('afterRender', this, 'processChildElements');
@@ -7573,16 +7604,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7573
7604
 
7574
7605
  if (baseValue === null || baseValue === undefined) {
7575
7606
  ret = emberUtils.makeArray(value);
7576
- } else {
7577
- if (isArray(baseValue)) {
7578
- if (value === null || value === undefined) {
7579
- ret = baseValue;
7580
- } else {
7581
- ret = a_concat.call(baseValue, value);
7582
- }
7607
+ } else if (isArray(baseValue)) {
7608
+ if (value === null || value === undefined) {
7609
+ ret = baseValue;
7583
7610
  } else {
7584
- ret = a_concat.call(emberUtils.makeArray(baseValue), value);
7611
+ ret = a_concat.call(baseValue, value);
7585
7612
  }
7613
+ } else {
7614
+ ret = a_concat.call(emberUtils.makeArray(baseValue), value);
7586
7615
  }
7587
7616
 
7588
7617
  {
@@ -7653,7 +7682,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7653
7682
  } else {
7654
7683
  if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') {
7655
7684
  value = applyConcatenatedProperties(base, key, value, values);
7656
- } else if (mergings && mergings.indexOf(key) >= 0) {
7685
+ } else if (mergings && mergings.indexOf(key) > -1) {
7657
7686
  value = applyMergedProperties(base, key, value, values);
7658
7687
  } else if (isMethod(value)) {
7659
7688
  value = giveMethodSuper(base, key, value, values, descs);
@@ -7765,9 +7794,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7765
7794
  return { desc: desc, value: value };
7766
7795
  }
7767
7796
 
7768
- function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {
7769
- var paths = observerOrListener[pathsKey];
7770
-
7797
+ function updateObserversAndListeners(obj, key, paths, updateMethod) {
7771
7798
  if (paths) {
7772
7799
  for (var i = 0; i < paths.length; i++) {
7773
7800
  updateMethod(obj, paths[i], null, key);
@@ -7778,16 +7805,16 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7778
7805
  function replaceObserversAndListeners(obj, key, observerOrListener) {
7779
7806
  var prev = obj[key];
7780
7807
 
7781
- if ('function' === typeof prev) {
7782
- updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _removeBeforeObserver);
7783
- updateObserversAndListeners(obj, key, prev, '__ember_observes__', removeObserver);
7784
- updateObserversAndListeners(obj, key, prev, '__ember_listens__', removeListener);
7808
+ if (typeof prev === 'function') {
7809
+ updateObserversAndListeners(obj, key, prev.__ember_observesBefore__, _removeBeforeObserver);
7810
+ updateObserversAndListeners(obj, key, prev.__ember_observes__, removeObserver);
7811
+ updateObserversAndListeners(obj, key, prev.__ember_listens__, removeListener);
7785
7812
  }
7786
7813
 
7787
- if ('function' === typeof observerOrListener) {
7788
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _addBeforeObserver);
7789
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', addObserver);
7790
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', addListener);
7814
+ if (typeof observerOrListener === 'function') {
7815
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_observesBefore__, _addBeforeObserver);
7816
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_observes__, addObserver);
7817
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_listens__, addListener);
7791
7818
  }
7792
7819
  }
7793
7820
 
@@ -7994,7 +8021,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
7994
8021
  Mixin.mixins = function mixins(obj) {
7995
8022
  var meta$$1 = exports.peekMeta(obj);
7996
8023
  var ret = [];
7997
- if (!meta$$1) {
8024
+ if (meta$$1 === undefined) {
7998
8025
  return ret;
7999
8026
  }
8000
8027
 
@@ -8111,7 +8138,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8111
8138
  return _detect(obj, this, {});
8112
8139
  }
8113
8140
  var meta$$1 = exports.peekMeta(obj);
8114
- if (!meta$$1) {
8141
+ if (meta$$1 === undefined) {
8115
8142
  return false;
8116
8143
  }
8117
8144
  return !!meta$$1.peekMixins(emberUtils.guidFor(this));
@@ -8186,15 +8213,21 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8186
8213
  /**
8187
8214
  Makes a method available via an additional name.
8188
8215
 
8189
- ```javascript
8190
- App.Person = Ember.Object.extend({
8191
- name: function() {
8216
+ ```app/utils/person.js
8217
+ import EmberObject, {
8218
+ aliasMethod
8219
+ } from '@ember/object';
8220
+
8221
+ export default EmberObject.extend({
8222
+ name() {
8192
8223
  return 'Tomhuda Katzdale';
8193
8224
  },
8194
- moniker: Ember.aliasMethod('name')
8225
+ moniker: aliasMethod('name')
8195
8226
  });
8227
+ ```
8196
8228
 
8197
- let goodGuy = App.Person.create();
8229
+ ```javascript
8230
+ let goodGuy = Person.create();
8198
8231
 
8199
8232
  goodGuy.name(); // 'Tomhuda Katzdale'
8200
8233
  goodGuy.moniker(); // 'Tomhuda Katzdale'
@@ -8433,7 +8466,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8433
8466
  function isProxy(value) {
8434
8467
  if (typeof value === 'object' && value !== null) {
8435
8468
  var meta$$1 = exports.peekMeta(value);
8436
- return meta$$1 && meta$$1.isProxy();
8469
+ return meta$$1 === undefined ? false : meta$$1.isProxy();
8437
8470
  }
8438
8471
 
8439
8472
  return false;
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 2.16.0-beta.1
9
+ * @version 2.16.0-beta.2
10
10
  */
11
11
 
12
12
  var enifed, requireModule, Ember;
@@ -4640,7 +4640,6 @@ enifed('backburner', ['exports'], function (exports) {
4640
4640
  this.name = name;
4641
4641
  this.options = options;
4642
4642
  this.globalOptions = globalOptions;
4643
- this.globalOptions.onError = getOnError(globalOptions);
4644
4643
  }
4645
4644
 
4646
4645
  Queue.prototype.push = function (target, method, args, stack) {
@@ -4670,14 +4669,13 @@ enifed('backburner', ['exports'], function (exports) {
4670
4669
  var _options = this.options,
4671
4670
  before = _options.before,
4672
4671
  after = _options.after,
4672
+ onError,
4673
4673
  i;
4674
4674
 
4675
4675
  var target = void 0;
4676
4676
  var method = void 0;
4677
4677
  var args = void 0;
4678
4678
  var errorRecordedForStack = void 0;
4679
- var onError = this.globalOptions.onError;
4680
- var invoke = onError ? this.invokeWithOnError : this.invoke;
4681
4679
  this.targetQueues = Object.create(null);
4682
4680
  var queueItems = void 0;
4683
4681
  if (this._queueBeingFlushed.length > 0) {
@@ -4689,33 +4687,39 @@ enifed('backburner', ['exports'], function (exports) {
4689
4687
  if (before) {
4690
4688
  before();
4691
4689
  }
4692
- for (i = this.index; i < queueItems.length; i += 4) {
4693
- this.index += 4;
4694
- target = queueItems[i];
4695
- method = queueItems[i + 1];
4696
- args = queueItems[i + 2];
4697
- errorRecordedForStack = queueItems[i + 3]; // Debugging assistance
4698
- // method could have been nullified / canceled during flush
4699
- if (method !== null) {
4700
- //
4701
- // ** Attention intrepid developer **
4702
- //
4703
- // To find out the stack of this task when it was scheduled onto
4704
- // the run loop, add the following to your app.js:
4705
- //
4706
- // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production.
4707
- //
4708
- // Once that is in place, when you are at a breakpoint and navigate
4709
- // here in the stack explorer, you can look at `errorRecordedForStack.stack`,
4710
- // which will be the captured stack when this job was scheduled.
4711
- //
4712
- // One possible long-term solution is the following Chrome issue:
4713
- // https://bugs.chromium.org/p/chromium/issues/detail?id=332624
4714
- //
4715
- invoke(target, method, args, onError, errorRecordedForStack);
4716
- }
4717
- if (this.index !== this._queueBeingFlushed.length && this.globalOptions.mustYield && this.globalOptions.mustYield()) {
4718
- return 1 /* Pause */;
4690
+ var invoke = void 0;
4691
+ if (queueItems.length > 0) {
4692
+ onError = getOnError(this.globalOptions);
4693
+
4694
+ invoke = onError ? this.invokeWithOnError : this.invoke;
4695
+ for (i = this.index; i < queueItems.length; i += 4) {
4696
+ this.index += 4;
4697
+ target = queueItems[i];
4698
+ method = queueItems[i + 1];
4699
+ args = queueItems[i + 2];
4700
+ errorRecordedForStack = queueItems[i + 3]; // Debugging assistance
4701
+ // method could have been nullified / canceled during flush
4702
+ if (method !== null) {
4703
+ //
4704
+ // ** Attention intrepid developer **
4705
+ //
4706
+ // To find out the stack of this task when it was scheduled onto
4707
+ // the run loop, add the following to your app.js:
4708
+ //
4709
+ // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production.
4710
+ //
4711
+ // Once that is in place, when you are at a breakpoint and navigate
4712
+ // here in the stack explorer, you can look at `errorRecordedForStack.stack`,
4713
+ // which will be the captured stack when this job was scheduled.
4714
+ //
4715
+ // One possible long-term solution is the following Chrome issue:
4716
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=332624
4717
+ //
4718
+ invoke(target, method, args, onError, errorRecordedForStack);
4719
+ }
4720
+ if (this.index !== this._queueBeingFlushed.length && this.globalOptions.mustYield && this.globalOptions.mustYield()) {
4721
+ return 1 /* Pause */;
4722
+ }
4719
4723
  }
4720
4724
  }
4721
4725
  if (after) {
@@ -4926,7 +4930,6 @@ enifed('backburner', ['exports'], function (exports) {
4926
4930
 
4927
4931
  // accepts a function that when invoked will return an iterator
4928
4932
  // iterator will drain until completion
4929
- // accepts a function that when invoked will return an iterator
4930
4933
  var iteratorDrain = function (fn) {
4931
4934
  var iterator = fn();
4932
4935
  var result = iterator.next();
@@ -4936,7 +4939,6 @@ enifed('backburner', ['exports'], function (exports) {
4936
4939
  }
4937
4940
  };
4938
4941
 
4939
- var now = Date.now;
4940
4942
  var noop = function () {};
4941
4943
 
4942
4944
  var Backburner = function () {
@@ -4977,6 +4979,9 @@ enifed('backburner', ['exports'], function (exports) {
4977
4979
  return platform.setTimeout(fn, 0);
4978
4980
  };
4979
4981
  platform.clearNext = _platform.clearNext || platform.clearTimeout;
4982
+ platform.now = _platform.now || function () {
4983
+ return Date.now();
4984
+ };
4980
4985
  this._platform = platform;
4981
4986
  this._boundRunExpiredTimers = function () {
4982
4987
  _this._runExpiredTimers();
@@ -5275,7 +5280,7 @@ enifed('backburner', ['exports'], function (exports) {
5275
5280
  }
5276
5281
  }
5277
5282
  var onError = getOnError(this.options);
5278
- var executeAt = now() + wait;
5283
+ var executeAt = this._platform.now() + wait;
5279
5284
  var fn = void 0;
5280
5285
  if (onError) {
5281
5286
  fn = function () {
@@ -5495,7 +5500,7 @@ enifed('backburner', ['exports'], function (exports) {
5495
5500
  var l = timers.length;
5496
5501
  var i = 0;
5497
5502
  var defaultQueue = this.options.defaultQueue;
5498
- var n = now();
5503
+ var n = this._platform.now();
5499
5504
  for (; i < l; i += 2) {
5500
5505
  executeAt = timers[i];
5501
5506
 
@@ -5529,7 +5534,7 @@ enifed('backburner', ['exports'], function (exports) {
5529
5534
  return;
5530
5535
  }
5531
5536
  var minExpiresAt = this._timers[0];
5532
- var n = now();
5537
+ var n = this._platform.now();
5533
5538
  var wait = Math.max(0, minExpiresAt - n);
5534
5539
  this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait);
5535
5540
  };
@@ -5553,7 +5558,7 @@ enifed('backburner', ['exports'], function (exports) {
5553
5558
 
5554
5559
  exports.default = Backburner;
5555
5560
  });
5556
- enifed('container', ['exports', 'ember-utils', 'ember-debug', 'ember/features', 'ember-environment'], function (exports, _emberUtils, _emberDebug, _features) {
5561
+ enifed('container', ['exports', 'ember-utils', 'ember-debug', 'ember/features'], function (exports, _emberUtils, _emberDebug, _features) {
5557
5562
  'use strict';
5558
5563
 
5559
5564
  exports.Container = exports.privatize = exports.Registry = undefined;
@@ -5945,7 +5950,7 @@ enifed('container', ['exports', 'ember-utils', 'ember-debug', 'ember/features',
5945
5950
  if (typeof this.class._initFactory === 'function') {
5946
5951
  this.class._initFactory(this);
5947
5952
  } else {
5948
- // in the non-Ember.Object case we need to still setOwner
5953
+ // in the non-EmberObject case we need to still setOwner
5949
5954
  // this is required for supporting glimmer environment and
5950
5955
  // template instantiation which rely heavily on
5951
5956
  // `options[OWNER]` being passed into `create`
@@ -8675,7 +8680,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8675
8680
  function DEFAULT_GETTER_FUNCTION(name) {
8676
8681
  return function () {
8677
8682
  var meta$$1 = exports.peekMeta(this);
8678
- if (meta$$1 !== null && meta$$1 !== undefined) {
8683
+ if (meta$$1 !== undefined) {
8679
8684
  return meta$$1.peekValues(name);
8680
8685
  }
8681
8686
  };
@@ -8686,7 +8691,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8686
8691
  var meta$$1 = exports.peekMeta(this),
8687
8692
  proto;
8688
8693
  var val = void 0;
8689
- if (meta$$1 !== null && meta$$1 !== undefined) {
8694
+ if (meta$$1 !== undefined) {
8690
8695
  val = meta$$1.readInheritedValue('values', name);
8691
8696
  }
8692
8697
 
@@ -8749,7 +8754,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8749
8754
  become the explicit value of this property.
8750
8755
  */
8751
8756
  function defineProperty(obj, keyName, desc, data, meta$$1) {
8752
- if (meta$$1 === null || meta$$1 === undefined) {
8757
+ if (meta$$1 === undefined) {
8753
8758
  meta$$1 = meta(obj);
8754
8759
  }
8755
8760
 
@@ -8946,7 +8951,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
8946
8951
  possibleValue;
8947
8952
 
8948
8953
  // do nothing of this object has already been destroyed
8949
- if (!meta$$1 || meta$$1.isSourceDestroyed()) {
8954
+ if (meta$$1 === undefined || meta$$1.isSourceDestroyed()) {
8950
8955
  return;
8951
8956
  }
8952
8957
 
@@ -9166,9 +9171,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
9166
9171
  return;
9167
9172
  }
9168
9173
 
9169
- var meta$$1 = _meta || exports.peekMeta(obj);
9174
+ var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
9170
9175
 
9171
- if (!meta$$1 || !meta$$1.readableChainWatchers()) {
9176
+ if (meta$$1 === undefined || meta$$1.readableChainWatchers() === undefined) {
9172
9177
  return;
9173
9178
  }
9174
9179
 
@@ -10642,7 +10647,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
10642
10647
  */
10643
10648
  function ComputedProperty(config, opts) {
10644
10649
  this.isDescriptor = true;
10645
- if (typeof config === 'function') {
10650
+ var hasGetterOnly = typeof config === 'function';
10651
+ if (hasGetterOnly) {
10646
10652
  this._getter = config;
10647
10653
  } else {
10648
10654
  true && !(typeof config === 'object' && !Array.isArray(config)) && emberDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config));
@@ -10660,8 +10666,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
10660
10666
  this._suspended = undefined;
10661
10667
  this._meta = undefined;
10662
10668
  this._volatile = false;
10669
+
10663
10670
  this._dependentKeys = opts && opts.dependentKeys;
10664
- this._readOnly = false;
10671
+ this._readOnly = opts && hasGetterOnly && opts.readOnly === true;
10665
10672
  }
10666
10673
 
10667
10674
  ComputedProperty.prototype = new Descriptor();
@@ -10780,10 +10787,13 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
10780
10787
  You can pass a hash of these values to a computed property like this:
10781
10788
 
10782
10789
  ```
10783
- person: Ember.computed(function() {
10790
+ import { computed } from '@ember/object';
10791
+ import Person from 'my-app/utils/person';
10792
+
10793
+ person: computed(function() {
10784
10794
  let personId = this.get('personId');
10785
- return App.Person.create({ id: personId });
10786
- }).meta({ type: App.Person })
10795
+ return Person.create({ id: personId });
10796
+ }).meta({ type: Person })
10787
10797
  ```
10788
10798
 
10789
10799
  The hash that you pass to the `meta()` function will be saved on the
@@ -10815,12 +10825,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
10815
10825
 
10816
10826
  // don't create objects just to invalidate
10817
10827
  var meta$$1 = exports.peekMeta(obj);
10818
- if (!meta$$1 || meta$$1.source !== obj) {
10828
+ if (meta$$1 === undefined || meta$$1.source !== obj) {
10819
10829
  return;
10820
10830
  }
10821
10831
 
10822
10832
  var cache = meta$$1.readableCache();
10823
- if (cache && cache[keyName] !== undefined) {
10833
+ if (cache !== undefined && cache[keyName] !== undefined) {
10824
10834
  cache[keyName] = undefined;
10825
10835
  removeDependentKeys(this, obj, keyName, meta$$1);
10826
10836
  }
@@ -10842,14 +10852,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
10842
10852
  }
10843
10853
 
10844
10854
  var ret = this._getter.call(obj, keyName);
10845
- if (ret === undefined) {
10846
- cache[keyName] = UNDEFINED;
10847
- } else {
10848
- cache[keyName] = ret;
10849
- }
10855
+ cache[keyName] = ret === undefined ? UNDEFINED : ret;
10850
10856
 
10851
10857
  var chainWatchers = meta$$1.readableChainWatchers();
10852
- if (chainWatchers) {
10858
+ if (chainWatchers !== undefined) {
10853
10859
  chainWatchers.revalidate(keyName);
10854
10860
  }
10855
10861
  addDependentKeys(this, obj, keyName, meta$$1);
@@ -10899,15 +10905,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
10899
10905
  };
10900
10906
 
10901
10907
  ComputedPropertyPrototype._set = function (obj, keyName, value) {
10902
- // cache requires own meta
10903
10908
  var meta$$1 = meta(obj);
10904
- // either there is a writable cache or we need one to update
10905
10909
  var cache = meta$$1.writableCache();
10906
10910
  var hadCachedValue = false;
10907
10911
  var cachedValue = void 0;
10908
- if (cache[keyName] !== undefined) {
10909
- if (cache[keyName] !== UNDEFINED) {
10910
- cachedValue = cache[keyName];
10912
+ var val = cache[keyName];
10913
+ if (val !== undefined) {
10914
+ if (val !== UNDEFINED) {
10915
+ cachedValue = val;
10911
10916
  }
10912
10917
  hadCachedValue = true;
10913
10918
  }
@@ -11429,22 +11434,20 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
11429
11434
  };
11430
11435
 
11431
11436
  var onerror = void 0;
11437
+ var onErrorTarget = {
11438
+ get onerror() {
11439
+ return dispatchOverride || onerror;
11440
+ }
11441
+ };
11442
+
11432
11443
  // Ember.onerror getter
11433
11444
 
11434
11445
  // Ember.onerror setter
11435
- function setOnerror(handler) {
11436
- onerror = handler;
11437
- }
11446
+
11438
11447
 
11439
11448
  var dispatchOverride = void 0;
11440
11449
  // dispatch error
11441
- function dispatchError(error) {
11442
- if (dispatchOverride) {
11443
- dispatchOverride(error);
11444
- } else {
11445
- defaultDispatch(error);
11446
- }
11447
- }
11450
+
11448
11451
 
11449
11452
  // allows testing adapter to override dispatch
11450
11453
 
@@ -11512,7 +11515,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
11512
11515
  var meta$$1 = exports.peekMeta(obj),
11513
11516
  map,
11514
11517
  val;
11515
- if (meta$$1) {
11518
+ if (meta$$1 !== undefined) {
11516
11519
  map = meta$$1.readableWeak();
11517
11520
 
11518
11521
  if (map !== undefined) {
@@ -11560,7 +11563,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
11560
11563
 
11561
11564
  var meta$$1 = exports.peekMeta(obj),
11562
11565
  map;
11563
- if (meta$$1) {
11566
+ if (meta$$1 !== undefined) {
11564
11567
  map = meta$$1.readableWeak();
11565
11568
 
11566
11569
  if (map !== undefined) {
@@ -11747,15 +11750,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
11747
11750
  */
11748
11751
 
11749
11752
 
11750
- var onErrorTarget = {
11751
- get onerror() {
11752
- return dispatchError;
11753
- },
11754
- set onerror(handler) {
11755
- return setOnerror(handler);
11756
- }
11757
- };
11758
-
11759
11753
  var backburner$1 = new Backburner(['sync', 'actions', 'destroy'], {
11760
11754
  GUID_KEY: emberUtils.GUID_KEY,
11761
11755
  sync: {
@@ -11867,16 +11861,26 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
11867
11861
  We can use that setup option to do some additional setup for our component.
11868
11862
  The component itself could look something like the following:
11869
11863
 
11870
- ```javascript
11871
- App.RichTextEditorComponent = Ember.Component.extend({
11864
+ ```app/components/rich-text-editor.js
11865
+ import Component from '@ember/component';
11866
+ import { bind } from '@ember/runloop';
11867
+
11868
+ export default Component.extend({
11872
11869
  initializeTinyMCE: Ember.on('didInsertElement', function() {
11873
11870
  tinymce.init({
11874
11871
  selector: '#' + this.$().prop('id'),
11875
11872
  setup: Ember.run.bind(this, this.setupEditor)
11876
11873
  });
11877
11874
  }),
11875
+
11876
+ didInsertElement() {
11877
+ tinymce.init({
11878
+ selector: '#' + this.$().prop('id'),
11879
+ setup: Ember.run.bind(this, this.setupEditor)
11880
+ });
11881
+ }
11878
11882
 
11879
- setupEditor: function(editor) {
11883
+ setupEditor(editor) {
11880
11884
  this.set('editor', editor);
11881
11885
 
11882
11886
  editor.on('change', function() {
@@ -11887,7 +11891,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
11887
11891
  ```
11888
11892
 
11889
11893
  In this example, we use Ember.run.bind to bind the setupEditor method to the
11890
- context of the App.RichTextEditorComponent and to have the invocation of that
11894
+ context of the RichTextEditor component and to have the invocation of that
11891
11895
  method be safely handled and executed by the Ember run loop.
11892
11896
 
11893
11897
  @method bind
@@ -12127,9 +12131,23 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
12127
12131
  });
12128
12132
  ```
12129
12133
 
12130
- Also note that passing an anonymous function to `run.scheduleOnce` will
12131
- not prevent additional calls with an identical anonymous function from
12132
- scheduling the items multiple times, e.g.:
12134
+ Also note that for `run.scheduleOnce` to prevent additional calls, you need to
12135
+ pass the same function instance. The following case works as expected:
12136
+
12137
+ ```javascript
12138
+ function log() {
12139
+ console.log('Logging only once');
12140
+ }
12141
+
12142
+ function scheduleIt() {
12143
+ run.scheduleOnce('actions', myContext, log);
12144
+ }
12145
+
12146
+ scheduleIt();
12147
+ scheduleIt();
12148
+ ```
12149
+
12150
+ But this other case will schedule the function multiple times:
12133
12151
 
12134
12152
  ```javascript
12135
12153
  function scheduleIt() {
@@ -12142,7 +12160,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
12142
12160
  scheduleIt();
12143
12161
 
12144
12162
  // "Closure" will print twice, even though we're using `run.scheduleOnce`,
12145
- // because the function we pass to it is anonymous and won't match the
12163
+ // because the function we pass to it won't match the
12146
12164
  // previously scheduled operation.
12147
12165
  ```
12148
12166
 
@@ -12190,8 +12208,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
12190
12208
 
12191
12209
  Example:
12192
12210
 
12193
- ```javascript
12194
- export default Ember.Component.extend({
12211
+ ```app/components/my-component.js
12212
+ import Component from '@ember/component';
12213
+
12214
+ export Component.extend({
12195
12215
  didInsertElement() {
12196
12216
  this._super(...arguments);
12197
12217
  run.scheduleOnce('afterRender', this, 'processChildElements');
@@ -13706,16 +13726,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
13706
13726
 
13707
13727
  if (baseValue === null || baseValue === undefined) {
13708
13728
  ret = emberUtils.makeArray(value);
13709
- } else {
13710
- if (isArray(baseValue)) {
13711
- if (value === null || value === undefined) {
13712
- ret = baseValue;
13713
- } else {
13714
- ret = a_concat.call(baseValue, value);
13715
- }
13729
+ } else if (isArray(baseValue)) {
13730
+ if (value === null || value === undefined) {
13731
+ ret = baseValue;
13716
13732
  } else {
13717
- ret = a_concat.call(emberUtils.makeArray(baseValue), value);
13733
+ ret = a_concat.call(baseValue, value);
13718
13734
  }
13735
+ } else {
13736
+ ret = a_concat.call(emberUtils.makeArray(baseValue), value);
13719
13737
  }
13720
13738
 
13721
13739
  {
@@ -13788,7 +13806,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
13788
13806
  } else {
13789
13807
  if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') {
13790
13808
  value = applyConcatenatedProperties(base, key, value, values);
13791
- } else if (mergings && mergings.indexOf(key) >= 0) {
13809
+ } else if (mergings && mergings.indexOf(key) > -1) {
13792
13810
  value = applyMergedProperties(base, key, value, values);
13793
13811
  } else if (isMethod(value)) {
13794
13812
  value = giveMethodSuper(base, key, value, values, descs);
@@ -13904,9 +13922,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
13904
13922
  return { desc: desc, value: value };
13905
13923
  }
13906
13924
 
13907
- function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {
13908
- var paths = observerOrListener[pathsKey],
13909
- i;
13925
+ function updateObserversAndListeners(obj, key, paths, updateMethod) {
13926
+ var i;
13910
13927
 
13911
13928
  if (paths) {
13912
13929
  for (i = 0; i < paths.length; i++) {
@@ -13918,16 +13935,16 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
13918
13935
  function replaceObserversAndListeners(obj, key, observerOrListener) {
13919
13936
  var prev = obj[key];
13920
13937
 
13921
- if ('function' === typeof prev) {
13922
- updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _removeBeforeObserver);
13923
- updateObserversAndListeners(obj, key, prev, '__ember_observes__', removeObserver);
13924
- updateObserversAndListeners(obj, key, prev, '__ember_listens__', removeListener);
13938
+ if (typeof prev === 'function') {
13939
+ updateObserversAndListeners(obj, key, prev.__ember_observesBefore__, _removeBeforeObserver);
13940
+ updateObserversAndListeners(obj, key, prev.__ember_observes__, removeObserver);
13941
+ updateObserversAndListeners(obj, key, prev.__ember_listens__, removeListener);
13925
13942
  }
13926
13943
 
13927
- if ('function' === typeof observerOrListener) {
13928
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _addBeforeObserver);
13929
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', addObserver);
13930
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', addListener);
13944
+ if (typeof observerOrListener === 'function') {
13945
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_observesBefore__, _addBeforeObserver);
13946
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_observes__, addObserver);
13947
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_listens__, addListener);
13931
13948
  }
13932
13949
  }
13933
13950
 
@@ -14139,7 +14156,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14139
14156
  Mixin.mixins = function (obj) {
14140
14157
  var meta$$1 = exports.peekMeta(obj);
14141
14158
  var ret = [];
14142
- if (!meta$$1) {
14159
+ if (meta$$1 === undefined) {
14143
14160
  return ret;
14144
14161
  }
14145
14162
 
@@ -14248,7 +14265,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14248
14265
  return _detect(obj, this, {});
14249
14266
  }
14250
14267
  var meta$$1 = exports.peekMeta(obj);
14251
- if (!meta$$1) {
14268
+ if (meta$$1 === undefined) {
14252
14269
  return false;
14253
14270
  }
14254
14271
  return !!meta$$1.peekMixins(emberUtils.guidFor(this));
@@ -14326,15 +14343,21 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14326
14343
  /**
14327
14344
  Makes a method available via an additional name.
14328
14345
 
14329
- ```javascript
14330
- App.Person = Ember.Object.extend({
14331
- name: function() {
14346
+ ```app/utils/person.js
14347
+ import EmberObject, {
14348
+ aliasMethod
14349
+ } from '@ember/object';
14350
+
14351
+ export default EmberObject.extend({
14352
+ name() {
14332
14353
  return 'Tomhuda Katzdale';
14333
14354
  },
14334
- moniker: Ember.aliasMethod('name')
14355
+ moniker: aliasMethod('name')
14335
14356
  });
14357
+ ```
14336
14358
 
14337
- let goodGuy = App.Person.create();
14359
+ ```javascript
14360
+ let goodGuy = Person.create();
14338
14361
 
14339
14362
  goodGuy.name(); // 'Tomhuda Katzdale'
14340
14363
  goodGuy.moniker(); // 'Tomhuda Katzdale'
@@ -14646,8 +14669,16 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14646
14669
  exports.getOnerror = function () {
14647
14670
  return onerror;
14648
14671
  };
14649
- exports.setOnerror = setOnerror;
14650
- exports.dispatchError = dispatchError;
14672
+ exports.setOnerror = function (handler) {
14673
+ onerror = handler;
14674
+ };
14675
+ exports.dispatchError = function (error) {
14676
+ if (dispatchOverride) {
14677
+ dispatchOverride(error);
14678
+ } else {
14679
+ defaultDispatch(error);
14680
+ }
14681
+ };
14651
14682
  exports.setDispatchOverride = function (handler) {
14652
14683
  dispatchOverride = handler;
14653
14684
  };
@@ -14674,7 +14705,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14674
14705
  exports.addListener = addListener;
14675
14706
  exports.hasListeners = function (obj, eventName) {
14676
14707
  var meta$$1 = exports.peekMeta(obj);
14677
- if (!meta$$1) {
14708
+ if (meta$$1 === undefined) {
14678
14709
  return false;
14679
14710
  }
14680
14711
  var matched = meta$$1.matchingListeners(eventName);
@@ -14690,8 +14721,16 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14690
14721
  _len,
14691
14722
  args,
14692
14723
  _key;
14724
+ var events = args;
14725
+
14726
+ true && !(typeof func === 'function') && emberDebug.assert('Ember.on expects function as last argument', typeof func === 'function');
14727
+ true && !(events.length > 0 && events.every(function (p) {
14728
+ return typeof p === 'string' && p.length;
14729
+ })) && emberDebug.assert('Ember.on called without valid event names', events.length > 0 && events.every(function (p) {
14730
+ return typeof p === 'string' && p.length;
14731
+ }));
14693
14732
 
14694
- func.__ember_listens__ = args;
14733
+ func.__ember_listens__ = events;
14695
14734
  return func;
14696
14735
  };
14697
14736
  exports.removeListener = removeListener;
@@ -14945,7 +14984,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
14945
14984
  if (typeof value === 'object' && value !== null) {
14946
14985
  meta$$1 = exports.peekMeta(value);
14947
14986
 
14948
- return meta$$1 && meta$$1.isProxy();
14987
+ return meta$$1 === undefined ? false : meta$$1.isProxy();
14949
14988
  }
14950
14989
 
14951
14990
  return false;
@@ -16509,17 +16548,20 @@ enifed('ember-utils', ['exports'], function (exports) {
16509
16548
  `audioType` passed as an attribute:
16510
16549
 
16511
16550
  ```app/components/play-audio.js
16512
- import Ember from 'ember';
16513
-
16551
+ import Component from '@ember/component';
16552
+ import { computed } from '@ember/object';
16553
+ import { getOwner } from '@ember/application';
16554
+
16514
16555
  // Usage:
16515
16556
  //
16516
16557
  // {{play-audio audioType=model.audioType audioFile=model.file}}
16517
16558
  //
16518
- export default Ember.Component.extend({
16519
- audioService: Ember.computed('audioType', function() {
16520
- let owner = Ember.getOwner(this);
16559
+ export default Component.extend({
16560
+ audioService: computed('audioType', function() {
16561
+ let owner = getOwner(this);
16521
16562
  return owner.lookup(`service:${this.get('audioType')}`);
16522
16563
  }),
16564
+
16523
16565
  click() {
16524
16566
  let player = this.get('audioService');
16525
16567
  player.play(this.get('audioFile'));
@@ -17025,7 +17067,7 @@ enifed('ember-utils', ['exports'], function (exports) {
17025
17067
  exports.canInvoke = canInvoke;
17026
17068
  exports.tryInvoke = function (obj, methodName, args) {
17027
17069
  if (canInvoke(obj, methodName)) {
17028
- return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName);
17070
+ return applyStr(obj, methodName, args);
17029
17071
  }
17030
17072
  };
17031
17073
  exports.makeArray = function (obj) {
@@ -17062,7 +17104,7 @@ enifed('ember/features', ['exports', 'ember-environment', 'ember-utils'], functi
17062
17104
  enifed("ember/version", ["exports"], function (exports) {
17063
17105
  "use strict";
17064
17106
 
17065
- exports.default = "2.16.0-beta.1";
17107
+ exports.default = "2.16.0-beta.2";
17066
17108
  });
17067
17109
  enifed("handlebars", ["exports"], function (exports) {
17068
17110
  "use strict";