ember-source 5.7.0-alpha.2 → 5.7.0-alpha.4

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "5.7.0-alpha.2",
2
+ "version": "5.7.0-alpha.4",
3
3
  "buildType": "tag",
4
- "SHA": "a15d6fabdd7de3f2eb47cca7668e0ce1d3f5d59b",
5
- "assetPath": "/tag/shas/a15d6fabdd7de3f2eb47cca7668e0ce1d3f5d59b.tgz"
4
+ "SHA": "2ed5d491c1baa2bd434a1ecbde71a53019b0410e",
5
+ "assetPath": "/tag/shas/2ed5d491c1baa2bd434a1ecbde71a53019b0410e.tgz"
6
6
  }
@@ -3,19 +3,12 @@ import { Op, MachineOp } from '@glimmer/vm';
3
3
 
4
4
  /* This file is generated by build/debug.js */
5
5
 
6
- function fillNulls(count) {
7
- let arr = new Array(count);
8
- for (let i = 0; i < count; i++) {
9
- arr[i] = null;
10
- }
11
- return arr;
12
- }
13
6
  function opcodeMetadata(op, isMachine) {
14
7
  let value = isMachine ? MACHINE_METADATA[op] : METADATA[op];
15
8
  return value || null;
16
9
  }
17
- const METADATA = fillNulls(Op.Size);
18
- const MACHINE_METADATA = fillNulls(MachineOp.Size);
10
+ const METADATA = new Array(Op.Size).fill(null);
11
+ const MACHINE_METADATA = new Array(Op.Size).fill(null);
19
12
  MACHINE_METADATA[MachineOp.PushFrame] = {
20
13
  name: 'PushFrame',
21
14
  mnemonic: 'pushf',
@@ -1218,11 +1211,8 @@ function buildEnum(name, parsed, offset, max) {
1218
1211
  predicate
1219
1212
  };
1220
1213
  }
1221
- function strip(strings) {
1214
+ function strip(strings, ...args) {
1222
1215
  let out = '';
1223
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1224
- args[_key - 1] = arguments[_key];
1225
- }
1226
1216
  for (let i = 0; i < strings.length; i++) {
1227
1217
  let string = strings[i];
1228
1218
  let dynamic = args[i] !== undefined ? String(args[i]) : '';
@@ -1231,8 +1221,7 @@ function strip(strings) {
1231
1221
 
1232
1222
  // eslint-disable-next-line regexp/no-super-linear-backtracking
1233
1223
  out = /^\s*?\n?([\s\S]*?)\s*$/u.exec(out)[1];
1234
- let min = 9007199254740991; // Number.MAX_SAFE_INTEGER isn't available on IE11
1235
-
1224
+ let min = Number.MAX_SAFE_INTEGER;
1236
1225
  for (let line of out.split('\n')) {
1237
1226
  let leading = /^\s*/u.exec(line)[0].length;
1238
1227
  min = Math.min(min, leading);
@@ -1378,14 +1367,10 @@ class PropertyChecker {
1378
1367
  validate(obj) {
1379
1368
  if (typeof obj !== 'object') return false;
1380
1369
  if (obj === null || obj === undefined) return false;
1381
- return Object.entries(this.checkers).every(_ref => {
1382
- let [k, checker] = _ref;
1383
- return k in obj ? checker.validate(obj[k]) : false;
1384
- });
1370
+ return Object.entries(this.checkers).every(([k, checker]) => k in obj ? checker.validate(obj[k]) : false);
1385
1371
  }
1386
1372
  expected() {
1387
- let pairs = Object.entries(this.checkers).map(_ref2 => {
1388
- let [k, checker] = _ref2;
1373
+ let pairs = Object.entries(this.checkers).map(([k, checker]) => {
1389
1374
  return `${k}: ${checker.expected()}`;
1390
1375
  });
1391
1376
  return `{ ${pairs.join(',')} }`;
@@ -1471,8 +1456,7 @@ function CheckDict(obj) {
1471
1456
  function defaultMessage(value, expected) {
1472
1457
  return `Got ${value}, expected:\n${expected}`;
1473
1458
  }
1474
- function check(value, checker) {
1475
- let message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultMessage;
1459
+ function check(value, checker, message = defaultMessage) {
1476
1460
  if (typeof checker === 'function') {
1477
1461
  checker(value);
1478
1462
  return value;
@@ -1505,8 +1489,7 @@ const CheckObject = new ObjectChecker();
1505
1489
  function CheckOr(left, right) {
1506
1490
  return new OrChecker(left, right);
1507
1491
  }
1508
- function CheckValue(value) {
1509
- let desc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(value);
1492
+ function CheckValue(value, desc = String(value)) {
1510
1493
  return new ExactValueChecker(value, desc);
1511
1494
  }
1512
1495
  const CheckBlockSymbolTable = CheckInterface({
@@ -69,8 +69,7 @@ function associateDestroyableChild(parent, child) {
69
69
  childMeta.parents = push(childMeta.parents, parent);
70
70
  return child;
71
71
  }
72
- function registerDestructor(destroyable, destructor) {
73
- let eager = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
72
+ function registerDestructor(destroyable, destructor, eager = false) {
74
73
  if (DEBUG && isDestroying(destroyable)) {
75
74
  throw new Error('Attempted to register a destructor with an object that is already destroying or destroyed');
76
75
  }
@@ -79,8 +78,7 @@ function registerDestructor(destroyable, destructor) {
79
78
  meta[destructorsKey] = push(meta[destructorsKey], destructor);
80
79
  return destructor;
81
80
  }
82
- function unregisterDestructor(destroyable, destructor) {
83
- let eager = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
81
+ function unregisterDestructor(destroyable, destructor, eager = false) {
84
82
  if (DEBUG && isDestroying(destroyable)) {
85
83
  throw new Error('Attempted to unregister a destructor with an object that is already destroying or destroyed');
86
84
  }
@@ -6,10 +6,7 @@ class InstructionEncoderImpl {
6
6
  this.buffer = buffer;
7
7
  }
8
8
  size = 0;
9
- encode(type, machine) {
10
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
11
- args[_key - 2] = arguments[_key];
12
- }
9
+ encode(type, machine, ...args) {
13
10
  if (type > TYPE_SIZE) {
14
11
  throw new Error(`Opcode type over 8-bits. Got ${type}.`);
15
12
  }
@@ -152,8 +152,7 @@ function hasCapability(capabilities, capability) {
152
152
  return !!(capabilities & capability);
153
153
  }
154
154
 
155
- function helperCapabilities(managerAPI) {
156
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
155
+ function helperCapabilities(managerAPI, options = {}) {
157
156
  if (DEBUG && managerAPI !== '3.23') {
158
157
  throw new Error('Invalid helper manager compatibility specified');
159
158
  }
@@ -252,11 +251,10 @@ class FunctionHelperManager {
252
251
  args
253
252
  };
254
253
  }
255
- getValue(_ref) {
256
- let {
257
- fn,
258
- args
259
- } = _ref;
254
+ getValue({
255
+ fn,
256
+ args
257
+ }) {
260
258
  if (Object.keys(args.named).length > 0) {
261
259
  let argsForFn = [...args.positional, args.named];
262
260
  return fn(...argsForFn);
@@ -391,8 +389,7 @@ const CAPABILITIES = {
391
389
  willDestroy: false,
392
390
  hasSubOwner: false
393
391
  };
394
- function componentCapabilities(managerAPI) {
395
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
392
+ function componentCapabilities(managerAPI, options = {}) {
396
393
  if (DEBUG && managerAPI !== '3.13') {
397
394
  throw new Error('Invalid component manager compatibility specified');
398
395
  }
@@ -485,31 +482,28 @@ class CustomComponentManager {
485
482
  delegate.updateComponent(component, args);
486
483
  }
487
484
  }
488
- didCreate(_ref) {
489
- let {
490
- component,
491
- delegate
492
- } = _ref;
485
+ didCreate({
486
+ component,
487
+ delegate
488
+ }) {
493
489
  if (hasAsyncLifeCycleCallbacks(delegate)) {
494
490
  delegate.didCreateComponent(component);
495
491
  }
496
492
  }
497
- didUpdate(_ref2) {
498
- let {
499
- component,
500
- delegate
501
- } = _ref2;
493
+ didUpdate({
494
+ component,
495
+ delegate
496
+ }) {
502
497
  if (hasAsyncUpdateHook(delegate)) {
503
498
  delegate.didUpdateComponent(component);
504
499
  }
505
500
  }
506
501
  didRenderLayout() {}
507
502
  didUpdateLayout() {}
508
- getSelf(_ref3) {
509
- let {
510
- component,
511
- delegate
512
- } = _ref3;
503
+ getSelf({
504
+ component,
505
+ delegate
506
+ }) {
513
507
  return createConstRef(delegate.getContext(component), 'this');
514
508
  }
515
509
  getDestroyable(bucket) {
@@ -541,8 +535,7 @@ class CustomComponentState {
541
535
  }
542
536
  }
543
537
 
544
- function modifierCapabilities(managerAPI) {
545
- let optionalFeatures = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
538
+ function modifierCapabilities(managerAPI, optionalFeatures = {}) {
546
539
  if (DEBUG && managerAPI !== '3.22') {
547
540
  throw new Error('Invalid modifier manager compatibility specified');
548
541
  }
@@ -616,25 +609,22 @@ class CustomModifierManager {
616
609
  registerDestructor(state, () => delegate.destroyModifier(instance, args));
617
610
  return state;
618
611
  }
619
- getDebugName(_ref) {
620
- let {
621
- debugName
622
- } = _ref;
612
+ getDebugName({
613
+ debugName
614
+ }) {
623
615
  return debugName;
624
616
  }
625
- getTag(_ref2) {
626
- let {
627
- tag
628
- } = _ref2;
617
+ getTag({
618
+ tag
619
+ }) {
629
620
  return tag;
630
621
  }
631
- install(_ref3) {
632
- let {
633
- element,
634
- args,
635
- modifier,
636
- delegate
637
- } = _ref3;
622
+ install({
623
+ element,
624
+ args,
625
+ modifier,
626
+ delegate
627
+ }) {
638
628
  let {
639
629
  capabilities
640
630
  } = delegate;
@@ -644,12 +634,11 @@ class CustomModifierManager {
644
634
  delegate.installModifier(modifier, castToBrowser(element, 'ELEMENT'), args);
645
635
  }
646
636
  }
647
- update(_ref4) {
648
- let {
649
- args,
650
- modifier,
651
- delegate
652
- } = _ref4;
637
+ update({
638
+ args,
639
+ modifier,
640
+ delegate
641
+ }) {
653
642
  let {
654
643
  capabilities
655
644
  } = delegate;
@@ -123,8 +123,7 @@ class SerializeBuilder extends NewElementBuilder {
123
123
  }
124
124
  return super.openElement(tag);
125
125
  }
126
- pushRemoteElement(element, cursorId) {
127
- let insertBefore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
126
+ pushRemoteElement(element, cursorId, insertBefore = null) {
128
127
  let {
129
128
  dom
130
129
  } = this;