ember-source 4.0.0-beta.9 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 4.0.0-beta.9
9
+ * @version 4.0.0
10
10
  */
11
11
  /* eslint-disable no-var */
12
12
 
@@ -6705,6 +6705,11 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6705
6705
  var {
6706
6706
  id
6707
6707
  } = options;
6708
+
6709
+ if (id === 'argument-less-helper-paren-less-invocation') {
6710
+ throw new Error(`A resolved helper cannot be passed as a named argument as the syntax is ` + `ambiguously a pass-by-reference or invocation. Use the ` + `\`{{helper 'foo-helper}}\` helper to pass by reference or explicitly ` + `invoke the helper with parens: \`{{(fooHelper)}}\`.`);
6711
+ }
6712
+
6708
6713
  var override = VM_DEPRECATION_OVERRIDES.filter(o => o.id === id)[0];
6709
6714
  if (!override) throw new Error(`deprecation override for ${id} not found`); // allow deprecations to be disabled in the VM_DEPRECATION_OVERRIDES array below
6710
6715
 
@@ -6731,14 +6736,6 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6731
6736
 
6732
6737
 
6733
6738
  var VM_DEPRECATION_OVERRIDES = [{
6734
- id: 'argument-less-helper-paren-less-invocation',
6735
- url: 'https://deprecations.emberjs.com/v3.x#toc_argument-less-helper-paren-less-invocation',
6736
- until: '4.0.0',
6737
- for: 'ember-source',
6738
- since: {
6739
- enabled: '3.27.0'
6740
- }
6741
- }, {
6742
6739
  id: 'setting-on-hash',
6743
6740
  until: '4.4.0',
6744
6741
  for: 'ember-source',
@@ -10145,44 +10142,30 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
10145
10142
  arrayContentDidChange(array, start, deleteCount, items.length);
10146
10143
  }
10147
10144
 
10148
- function arrayObserversHelper(obj, target, opts, operation, notify) {
10149
- var willChange = opts && opts.willChange || 'arrayWillChange';
10150
- var didChange = opts && opts.didChange || 'arrayDidChange';
10151
- var hasObservers = obj.hasArrayObservers;
10145
+ function arrayObserversHelper(obj, target, opts, operation) {
10146
+ var _a;
10147
+
10148
+ var {
10149
+ willChange,
10150
+ didChange
10151
+ } = opts;
10152
10152
  operation(obj, '@array:before', target, willChange);
10153
10153
  operation(obj, '@array:change', target, didChange);
10154
+ /*
10155
+ * Array proxies have a `_revalidate` method which must be called to set
10156
+ * up their internal array observation systems.
10157
+ */
10154
10158
 
10155
- if (hasObservers === notify) {
10156
- notifyPropertyChange(obj, 'hasArrayObservers');
10157
- }
10158
-
10159
+ (_a = obj._revalidate) === null || _a === void 0 ? void 0 : _a.call(obj);
10159
10160
  return obj;
10160
10161
  }
10161
10162
 
10162
- function addArrayObserver(array, target, opts, suppress = false) {
10163
- (true && !(suppress) && (0, _debug.deprecate)(`Array observers have been deprecated. Added an array observer to ${_utils.getDebugName === null || _utils.getDebugName === void 0 ? void 0 : (0, _utils.getDebugName)(array)}.`, suppress, {
10164
- id: 'array-observers',
10165
- url: 'https://deprecations.emberjs.com/v3.x#toc_array-observers',
10166
- until: '4.0.0',
10167
- for: 'ember-source',
10168
- since: {
10169
- enabled: '3.26.0-beta.1'
10170
- }
10171
- }));
10172
- return arrayObserversHelper(array, target, opts, addListener, false);
10163
+ function addArrayObserver(array, target, opts) {
10164
+ return arrayObserversHelper(array, target, opts, addListener);
10173
10165
  }
10174
10166
 
10175
- function removeArrayObserver(array, target, opts, suppress = false) {
10176
- (true && !(suppress) && (0, _debug.deprecate)(`Array observers have been deprecated. Removed an array observer from ${_utils.getDebugName === null || _utils.getDebugName === void 0 ? void 0 : (0, _utils.getDebugName)(array)}.`, suppress, {
10177
- id: 'array-observers',
10178
- url: 'https://deprecations.emberjs.com/v3.x#toc_array-observers',
10179
- until: '4.0.0',
10180
- for: 'ember-source',
10181
- since: {
10182
- enabled: '3.26.0-beta.1'
10183
- }
10184
- }));
10185
- return arrayObserversHelper(array, target, opts, removeListener, true);
10167
+ function removeArrayObserver(array, target, opts) {
10168
+ return arrayObserversHelper(array, target, opts, removeListener);
10186
10169
  }
10187
10170
 
10188
10171
  var CHAIN_PASS_THROUGH = new _util._WeakSet();
@@ -21266,177 +21249,6 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
21266
21249
  return -1;
21267
21250
  },
21268
21251
 
21269
- // ..........................................................
21270
- // ARRAY OBSERVERS
21271
- //
21272
-
21273
- /**
21274
- Adds an array observer to the receiving array. The array observer object
21275
- normally must implement two methods:
21276
- * `willChange(observedObj, start, removeCount, addCount)` - This method will be
21277
- called just before the array is modified.
21278
- * `didChange(observedObj, start, removeCount, addCount)` - This method will be
21279
- called just after the array is modified.
21280
- Both callbacks will be passed the observed object, starting index of the
21281
- change as well as a count of the items to be removed and added. You can use
21282
- these callbacks to optionally inspect the array during the change, clear
21283
- caches, or do any other bookkeeping necessary.
21284
- In addition to passing a target, you can also include an options hash
21285
- which you can use to override the method names that will be invoked on the
21286
- target.
21287
- @method addArrayObserver
21288
- @param {Object} target The observer object.
21289
- @param {Object} opts Optional hash of configuration options including
21290
- `willChange` and `didChange` option.
21291
- @return {EmberArray} receiver
21292
- @public
21293
- @example
21294
- import Service from '@ember/service';
21295
- export default Service.extend({
21296
- data: Ember.A(),
21297
- init() {
21298
- this._super(...arguments);
21299
- this.data.addArrayObserver(this, {
21300
- willChange: 'dataWillChange',
21301
- didChange: 'dataDidChange'
21302
- });
21303
- },
21304
- dataWillChange(array, start, removeCount, addCount) {
21305
- console.log('array will change', array, start, removeCount, addCount);
21306
- },
21307
- dataDidChange(array, start, removeCount, addCount) {
21308
- console.log('array did change', array, start, removeCount, addCount);
21309
- }
21310
- });
21311
- */
21312
- addArrayObserver(target, opts) {
21313
- return (0, _metal.addArrayObserver)(this, target, opts);
21314
- },
21315
-
21316
- /**
21317
- Removes an array observer from the object if the observer is current
21318
- registered. Calling this method multiple times with the same object will
21319
- have no effect.
21320
- @method removeArrayObserver
21321
- @param {Object} target The object observing the array.
21322
- @param {Object} opts Optional hash of configuration options including
21323
- `willChange` and `didChange` option.
21324
- @return {EmberArray} receiver
21325
- @public
21326
- */
21327
- removeArrayObserver(target, opts) {
21328
- return (0, _metal.removeArrayObserver)(this, target, opts);
21329
- },
21330
-
21331
- /**
21332
- Becomes true whenever the array currently has observers watching changes
21333
- on the array.
21334
- ```javascript
21335
- let arr = [1, 2, 3, 4, 5];
21336
- arr.hasArrayObservers; // false
21337
- arr.addArrayObserver(this, {
21338
- willChange() {
21339
- console.log('willChange');
21340
- }
21341
- });
21342
- arr.hasArrayObservers; // true
21343
- ```
21344
- @property {Boolean} hasArrayObservers
21345
- @public
21346
- */
21347
- hasArrayObservers: (0, _metal.nativeDescDecorator)({
21348
- configurable: true,
21349
- enumerable: false,
21350
-
21351
- get() {
21352
- return (0, _metal.hasListeners)(this, '@array:change') || (0, _metal.hasListeners)(this, '@array:before');
21353
- }
21354
-
21355
- }),
21356
-
21357
- /**
21358
- If you are implementing an object that supports `EmberArray`, call this
21359
- method just before the array content changes to notify any observers and
21360
- invalidate any related properties. Pass the starting index of the change
21361
- as well as a delta of the amounts to change.
21362
- ```app/components/show-post.js
21363
- import Component from '@ember/component';
21364
- import EmberObject from '@ember/object';
21365
- const Post = EmberObject.extend({
21366
- body: '',
21367
- save() {}
21368
- })
21369
- export default Component.extend({
21370
- attemptsToModify: 0,
21371
- successfulModifications: 0,
21372
- posts: null,
21373
- init() {
21374
- this._super(...arguments);
21375
- this.posts = [1, 2, 3].map(i => Post.create({ body: i }));
21376
- this.posts.addArrayObserver(this, {
21377
- willChange() {
21378
- this.incrementProperty('attemptsToModify');
21379
- },
21380
- didChange() {
21381
- this.incrementProperty('successfulModifications');
21382
- }
21383
- });
21384
- },
21385
- actions: {
21386
- editPost(post, newContent) {
21387
- let oldContent = post.body,
21388
- postIndex = this.posts.indexOf(post);
21389
- this.posts.arrayContentWillChange(postIndex, 0, 0); // attemptsToModify = 1
21390
- post.set('body', newContent);
21391
- post.save()
21392
- .then(response => {
21393
- this.posts.arrayContentDidChange(postIndex, 0, 0); // successfulModifications = 1
21394
- })
21395
- .catch(error => {
21396
- post.set('body', oldContent);
21397
- })
21398
- }
21399
- }
21400
- });
21401
- ```
21402
- @method arrayContentWillChange
21403
- @param {Number} startIdx The starting index in the array that will change.
21404
- @param {Number} removeAmt The number of items that will be removed. If you
21405
- pass `null` assumes 0
21406
- @param {Number} addAmt The number of items that will be added. If you
21407
- pass `null` assumes 0.
21408
- @return {EmberArray} receiver
21409
- @public
21410
- */
21411
- arrayContentWillChange(startIdx, removeAmt, addAmt) {
21412
- return (0, _metal.arrayContentWillChange)(this, startIdx, removeAmt, addAmt);
21413
- },
21414
-
21415
- /**
21416
- If you are implementing an object that supports `EmberArray`, call this
21417
- method just after the array content changes to notify any observers and
21418
- invalidate any related properties. Pass the starting index of the change
21419
- as well as a delta of the amounts to change.
21420
- ```javascript
21421
- let arr = [1, 2, 3, 4, 5];
21422
- arr.copyWithin(-2); // [1, 2, 3, 1, 2]
21423
- // arr.lastObject = 5
21424
- arr.arrayContentDidChange(3, 2, 2);
21425
- // arr.lastObject = 2
21426
- ```
21427
- @method arrayContentDidChange
21428
- @param {Number} startIdx The starting index in the array that did change.
21429
- @param {Number} removeAmt The number of items that were removed. If you
21430
- pass `null` assumes 0
21431
- @param {Number} addAmt The number of items that were added. If you
21432
- pass `null` assumes 0.
21433
- @return {EmberArray} receiver
21434
- @public
21435
- */
21436
- arrayContentDidChange(startIdx, removeAmt, addAmt) {
21437
- return (0, _metal.arrayContentDidChange)(this, startIdx, removeAmt, addAmt);
21438
- },
21439
-
21440
21252
  /**
21441
21253
  Iterates through the array, calling the passed function on each
21442
21254
  item. This method corresponds to the `forEach()` method defined in
@@ -22165,7 +21977,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
22165
21977
  __Required.__ You must implement this method to apply this mixin.
22166
21978
  This is one of the primitives you must implement to support `Array`.
22167
21979
  You should replace amt objects started at idx with the objects in the
22168
- passed array. You should also call `this.arrayContentDidChange()`
21980
+ passed array.
22169
21981
  Note that this method is expected to validate the type(s) of objects that it expects.
22170
21982
  @method replace
22171
21983
  @param {Number} idx Starting index in the array to replace. If
@@ -24222,11 +24034,11 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
24222
24034
 
24223
24035
  this._removeArrangedContentArrayObserver();
24224
24036
 
24225
- this.arrayContentWillChange(0, oldLength, newLength);
24037
+ (0, _metal.arrayContentWillChange)(this, 0, oldLength, newLength);
24226
24038
 
24227
24039
  this._invalidate();
24228
24040
 
24229
- this.arrayContentDidChange(0, oldLength, newLength);
24041
+ (0, _metal.arrayContentDidChange)(this, 0, oldLength, newLength, false);
24230
24042
 
24231
24043
  this._addArrangedContentArrayObserver(arrangedContent);
24232
24044
  }
@@ -24235,21 +24047,21 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
24235
24047
  if (arrangedContent && !arrangedContent.isDestroyed) {
24236
24048
  (true && !(arrangedContent !== this) && (0, _debug.assert)("Can't set ArrayProxy's content to itself", arrangedContent !== this));
24237
24049
  (true && !((0, _array.isArray)(arrangedContent) || arrangedContent.isDestroyed) && (0, _debug.assert)(`ArrayProxy expects an Array or ArrayProxy, but you passed ${typeof arrangedContent}`, (0, _array.isArray)(arrangedContent) || arrangedContent.isDestroyed));
24238
- (0, _metal.addArrayObserver)(arrangedContent, this, ARRAY_OBSERVER_MAPPING, true);
24050
+ (0, _metal.addArrayObserver)(arrangedContent, this, ARRAY_OBSERVER_MAPPING);
24239
24051
  this._arrangedContent = arrangedContent;
24240
24052
  }
24241
24053
  }
24242
24054
 
24243
24055
  _removeArrangedContentArrayObserver() {
24244
24056
  if (this._arrangedContent) {
24245
- (0, _metal.removeArrayObserver)(this._arrangedContent, this, ARRAY_OBSERVER_MAPPING, true);
24057
+ (0, _metal.removeArrayObserver)(this._arrangedContent, this, ARRAY_OBSERVER_MAPPING);
24246
24058
  }
24247
24059
  }
24248
24060
 
24249
24061
  _arrangedContentArrayWillChange() {}
24250
24062
 
24251
24063
  _arrangedContentArrayDidChange(proxy, idx, removedCnt, addedCnt) {
24252
- this.arrayContentWillChange(idx, removedCnt, addedCnt);
24064
+ (0, _metal.arrayContentWillChange)(this, idx, removedCnt, addedCnt);
24253
24065
  var dirtyIndex = idx;
24254
24066
 
24255
24067
  if (dirtyIndex < 0) {
@@ -24262,7 +24074,7 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
24262
24074
  }
24263
24075
 
24264
24076
  this._lengthDirty = true;
24265
- this.arrayContentDidChange(idx, removedCnt, addedCnt);
24077
+ (0, _metal.arrayContentDidChange)(this, idx, removedCnt, addedCnt, false);
24266
24078
  }
24267
24079
 
24268
24080
  _invalidate() {
@@ -24311,14 +24123,7 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
24311
24123
  @property arrangedContent
24312
24124
  @public
24313
24125
  */
24314
- arrangedContent: (0, _metal.alias)('content'),
24315
-
24316
- // Array proxies don't need to notify when they change since their `[]` tag is
24317
- // already dependent on the `[]` tag of `arrangedContent`
24318
- arrayContentDidChange(startIdx, removeAmt, addAmt) {
24319
- return (0, _metal.arrayContentDidChange)(this, startIdx, removeAmt, addAmt, false);
24320
- }
24321
-
24126
+ arrangedContent: (0, _metal.alias)('content')
24322
24127
  });
24323
24128
  });
24324
24129
  define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-internals/container", "@ember/-internals/owner", "@ember/-internals/utils", "@ember/-internals/meta", "@ember/-internals/metal", "@ember/-internals/runtime/lib/mixins/action_handler", "@ember/debug", "@glimmer/util", "@glimmer/destroyable", "@glimmer/owner"], function (_exports, _container, _owner, _utils, _meta2, _metal, _action_handler, _debug, _util, _destroyable, _owner2) {
@@ -55282,7 +55087,7 @@ define("ember/version", ["exports"], function (_exports) {
55282
55087
  value: true
55283
55088
  });
55284
55089
  _exports.default = void 0;
55285
- var _default = "4.0.0-beta.9";
55090
+ var _default = "4.0.0";
55286
55091
  _exports.default = _default;
55287
55092
  });
55288
55093
  define("route-recognizer", ["exports"], function (_exports) {