ember-source 7.1.0-alpha.2 → 7.1.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.
Files changed (147) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/dev/packages/@ember/-internals/environment/index.js +10 -0
  3. package/dist/dev/packages/@ember/-internals/glimmer/index.js +7 -7
  4. package/dist/dev/packages/@ember/application/index.js +5 -5
  5. package/dist/dev/packages/@ember/application/instance.js +4 -4
  6. package/dist/dev/packages/@ember/component/helper.js +4 -4
  7. package/dist/dev/packages/@ember/component/index.js +4 -4
  8. package/dist/dev/packages/@ember/component/template-only.js +2 -2
  9. package/dist/dev/packages/@ember/debug/index.js +2 -1
  10. package/dist/dev/packages/@ember/engine/index.js +5 -5
  11. package/dist/dev/packages/@ember/helper/index.js +51 -7
  12. package/dist/dev/packages/@ember/modifier/index.js +4 -4
  13. package/dist/dev/packages/@ember/modifier/on.js +2 -2
  14. package/dist/dev/packages/@ember/renderer/index.js +4 -4
  15. package/dist/dev/packages/@ember/routing/index.js +4 -4
  16. package/dist/dev/packages/@ember/routing/route.js +1 -1
  17. package/dist/dev/packages/@ember/template/index.js +4 -4
  18. package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +9 -5
  19. package/dist/dev/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +36 -0
  20. package/dist/dev/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  21. package/dist/dev/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -1
  22. package/dist/dev/packages/@ember/template-compiler/lib/template.js +2 -2
  23. package/dist/dev/packages/@ember/template-factory/index.js +1 -1
  24. package/dist/dev/packages/@glimmer/destroyable/index.js +5 -1
  25. package/dist/dev/packages/@glimmer/manager/index.js +2 -2
  26. package/dist/dev/packages/@glimmer/node/index.js +4 -4
  27. package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -2
  28. package/dist/dev/packages/@glimmer/program/index.js +1 -1
  29. package/dist/dev/packages/@glimmer/runtime/index.js +5 -5
  30. package/dist/dev/packages/ember/version.js +1 -1
  31. package/dist/dev/packages/ember-template-compiler/index.js +3 -3
  32. package/dist/dev/packages/shared-chunks/{api-BqXkkT0p.js → api-BQMslHhq.js} +1 -1
  33. package/dist/dev/packages/shared-chunks/{compiler-BenCxenr.js → compiler-D1leQ3Gl.js} +90 -88
  34. package/dist/dev/packages/shared-chunks/{constants-DKn6zqFX.js → constants-BbdWMvgs.js} +2 -2
  35. package/dist/dev/packages/shared-chunks/{dynamic-Cu9Xpdzc.js → dynamic-CgX8M02_.js} +7 -8
  36. package/dist/dev/packages/shared-chunks/{element-builder-Dw_Ic9cD.js → element-builder-BpJIoi99.js} +2 -2
  37. package/dist/dev/packages/shared-chunks/{index-CtPSmMCE.js → index-BUPd6pkm.js} +15 -17
  38. package/dist/dev/packages/shared-chunks/{index-AD_RxZjB.js → index-RzG0Jvjx.js} +7 -7
  39. package/dist/dev/packages/shared-chunks/{invoke-D0D6CvD5.js → neq-DujMPv1k.js} +27 -3
  40. package/dist/dev/packages/shared-chunks/{program-context-yOi1EExe.js → program-context-sJz0oHOA.js} +1 -1
  41. package/dist/dev/packages/shared-chunks/{rehydrate-builder-CfBtYUkk.js → rehydrate-builder-BRH0p0wA.js} +3 -5
  42. package/dist/dev/packages/shared-chunks/{render-t-LAXUYI.js → render-DCchifOK.js} +4 -4
  43. package/dist/dev/packages/shared-chunks/{serialize-builder-BUG9CxHC.js → serialize-builder-DiO7Ak9_.js} +3 -3
  44. package/dist/dev/packages/shared-chunks/{setup-registry-CxXWLs26.js → setup-registry-DxchCIL2.js} +6 -6
  45. package/dist/dev/packages/shared-chunks/{transform-resolutions-fXGQKGsL.js → transform-resolutions-D-YtZ0_g.js} +2 -2
  46. package/dist/prod/packages/@ember/-internals/environment/index.js +10 -0
  47. package/dist/prod/packages/@ember/-internals/glimmer/index.js +9 -9
  48. package/dist/prod/packages/@ember/-internals/metal/index.js +10 -10
  49. package/dist/prod/packages/@ember/-internals/routing/index.js +2 -2
  50. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +4 -4
  51. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -2
  52. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -3
  53. package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -2
  54. package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +3 -3
  55. package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +3 -3
  56. package/dist/prod/packages/@ember/application/index.js +8 -8
  57. package/dist/prod/packages/@ember/application/instance.js +8 -8
  58. package/dist/prod/packages/@ember/application/namespace.js +3 -3
  59. package/dist/prod/packages/@ember/array/index.js +5 -5
  60. package/dist/prod/packages/@ember/array/proxy.js +5 -5
  61. package/dist/prod/packages/@ember/component/helper.js +6 -6
  62. package/dist/prod/packages/@ember/component/index.js +6 -6
  63. package/dist/prod/packages/@ember/component/template-only.js +4 -4
  64. package/dist/prod/packages/@ember/controller/index.js +4 -4
  65. package/dist/prod/packages/@ember/debug/container-debug-adapter.js +2 -2
  66. package/dist/prod/packages/@ember/debug/data-adapter.js +2 -2
  67. package/dist/prod/packages/@ember/debug/index.js +1 -0
  68. package/dist/prod/packages/@ember/engine/index.js +9 -9
  69. package/dist/prod/packages/@ember/helper/index.js +53 -9
  70. package/dist/prod/packages/@ember/modifier/index.js +6 -6
  71. package/dist/prod/packages/@ember/modifier/on.js +4 -4
  72. package/dist/prod/packages/@ember/object/-internals.js +2 -2
  73. package/dist/prod/packages/@ember/object/compat.js +2 -2
  74. package/dist/prod/packages/@ember/object/computed.js +4 -4
  75. package/dist/prod/packages/@ember/object/core.js +2 -2
  76. package/dist/prod/packages/@ember/object/evented.js +3 -3
  77. package/dist/prod/packages/@ember/object/events.js +2 -2
  78. package/dist/prod/packages/@ember/object/index.js +6 -6
  79. package/dist/prod/packages/@ember/object/internals.js +2 -2
  80. package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +5 -5
  81. package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -3
  82. package/dist/prod/packages/@ember/object/mixin.js +3 -3
  83. package/dist/prod/packages/@ember/object/observable.js +5 -5
  84. package/dist/prod/packages/@ember/object/observers.js +2 -2
  85. package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +4 -4
  86. package/dist/prod/packages/@ember/renderer/index.js +6 -6
  87. package/dist/prod/packages/@ember/routing/index.js +6 -6
  88. package/dist/prod/packages/@ember/routing/lib/generate_controller.js +2 -2
  89. package/dist/prod/packages/@ember/routing/lib/routing-service.js +2 -2
  90. package/dist/prod/packages/@ember/routing/lib/utils.js +2 -2
  91. package/dist/prod/packages/@ember/routing/route.js +6 -6
  92. package/dist/prod/packages/@ember/routing/router-service.js +2 -2
  93. package/dist/prod/packages/@ember/routing/router.js +4 -4
  94. package/dist/prod/packages/@ember/runloop/index.js +2 -2
  95. package/dist/prod/packages/@ember/service/index.js +3 -3
  96. package/dist/prod/packages/@ember/template/index.js +6 -6
  97. package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +11 -7
  98. package/dist/prod/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +36 -0
  99. package/dist/prod/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  100. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -1
  101. package/dist/prod/packages/@ember/template-compiler/lib/template.js +4 -4
  102. package/dist/prod/packages/@ember/template-factory/index.js +3 -3
  103. package/dist/prod/packages/@ember/utils/lib/is_empty.js +2 -2
  104. package/dist/prod/packages/@glimmer/destroyable/index.js +5 -1
  105. package/dist/prod/packages/@glimmer/manager/index.js +4 -4
  106. package/dist/prod/packages/@glimmer/node/index.js +6 -6
  107. package/dist/prod/packages/@glimmer/opcode-compiler/index.js +3 -3
  108. package/dist/prod/packages/@glimmer/program/index.js +1 -1
  109. package/dist/prod/packages/@glimmer/runtime/index.js +6 -6
  110. package/dist/prod/packages/@glimmer/tracking/index.js +3 -3
  111. package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +2 -2
  112. package/dist/prod/packages/ember/version.js +1 -1
  113. package/dist/prod/packages/ember-template-compiler/index.js +4 -4
  114. package/dist/prod/packages/shared-chunks/{alias-BkT-0B1G.js → alias-BLBQkche.js} +3 -3
  115. package/dist/prod/packages/shared-chunks/{api-Co-k4HVs.js → api-B5UrgITK.js} +2 -2
  116. package/dist/prod/packages/shared-chunks/{array-EwekEvId.js → array-kVQfzrQn.js} +2 -2
  117. package/dist/prod/packages/shared-chunks/{capabilities-DGmQ_mz4.js → capabilities-DXA-L0iT.js} +1 -1
  118. package/dist/prod/packages/shared-chunks/{compiler-Rwrmj1ki.js → compiler-Bbki2GT_.js} +53 -92
  119. package/dist/prod/packages/shared-chunks/{constants-CB3pk7dH.js → constants-DThhT5fu.js} +4 -4
  120. package/dist/prod/packages/shared-chunks/{element-builder-DbktcGKV.js → element-builder-CzXb9l1W.js} +2 -4
  121. package/dist/prod/packages/shared-chunks/{fragment-EpVz5Xuc.js → fragment-D7nBU9ae.js} +16 -1
  122. package/dist/prod/packages/shared-chunks/{index-nW__r2nX.js → index-CjaDF9kC.js} +2 -10
  123. package/dist/prod/packages/shared-chunks/{index-BVy-auLZ.js → index-r-Dz_hzt.js} +13 -13
  124. package/dist/prod/packages/shared-chunks/{injected_property-DL3vQoFA.js → injected_property-CTVs5FPh.js} +1 -1
  125. package/dist/prod/packages/shared-chunks/{namespace_search-Aog9nySA.js → namespace_search-Dcdalhj6.js} +1 -1
  126. package/dist/prod/packages/shared-chunks/{invoke-BuwCkcVB.js → neq-BqdovTuC.js} +22 -4
  127. package/dist/prod/packages/shared-chunks/{observers-R1ZklwWy.js → observers-tZ2aOzr4.js} +1 -1
  128. package/dist/prod/packages/shared-chunks/{on-ByzWKBWe.js → on-CersD7PL.js} +4 -11
  129. package/dist/prod/packages/shared-chunks/{program-context-BdUXf-jj.js → program-context-DFiwaPMR.js} +2 -2
  130. package/dist/prod/packages/shared-chunks/{property_set-O080KTKZ.js → property_set-B2sZxeCw.js} +2 -2
  131. package/dist/prod/packages/shared-chunks/{rehydrate-builder-M_dh82nR.js → rehydrate-builder-D3t52iGR.js} +3 -7
  132. package/dist/prod/packages/shared-chunks/{render-DJ-BzvgU.js → render-D78XHdek.js} +4 -6
  133. package/dist/prod/packages/shared-chunks/{serialize-builder-BpVMgrCr.js → serialize-builder-iXiRs1Pg.js} +5 -5
  134. package/dist/prod/packages/shared-chunks/{set_properties-CjsDTRey.js → set_properties-C1T46IiN.js} +3 -3
  135. package/dist/prod/packages/shared-chunks/{setup-registry-KYxkFexK.js → setup-registry-Cs-7NIJU.js} +8 -8
  136. package/dist/prod/packages/shared-chunks/{tracked-ChVNBE2f.js → tracked-Cl5l4v8b.js} +1 -1
  137. package/dist/prod/packages/shared-chunks/{transform-resolutions-C7wq_Q_c.js → transform-resolutions-DR4GLmR2.js} +0 -3
  138. package/docs/data.json +316 -173
  139. package/package.json +3 -1
  140. package/types/stable/@ember/-internals/environment/lib/env.d.ts +11 -0
  141. package/types/stable/@ember/helper/index.d.ts +48 -0
  142. package/types/stable/@glimmer/runtime/index.d.ts +2 -0
  143. package/types/stable/@glimmer/runtime/lib/helpers/eq.d.ts +8 -0
  144. package/types/stable/@glimmer/runtime/lib/helpers/neq.d.ts +8 -0
  145. package/types/stable/@glimmer/syntax/lib/source/source.d.ts +2 -1
  146. package/types/stable/index.d.ts +2 -0
  147. package/dist/prod/packages/shared-chunks/assert-CUCJBR2C.js +0 -19
@@ -244,4 +244,4 @@ function hasDefaultHelperManager(definition) {
244
244
  return typeof definition === 'function';
245
245
  }
246
246
 
247
- export { CustomHelperManager as C, hasDestroyable as a, hasInternalComponentManager as b, helperCapabilities as c, getInternalModifierManager as d, getInternalComponentManager as e, hasInternalHelperManager as f, getInternalHelperManager as g, hasValue as h, setInternalHelperManager as i, setInternalModifierManager as j, hasInternalModifierManager as k, setInternalComponentManager as s };
247
+ export { CustomHelperManager as C, helperCapabilities as a, hasValue as b, hasDestroyable as c, getInternalModifierManager as d, getInternalComponentManager as e, hasInternalHelperManager as f, getInternalHelperManager as g, hasInternalComponentManager as h, setInternalHelperManager as i, setInternalModifierManager as j, hasInternalModifierManager as k, setInternalComponentManager as s };
@@ -1,5 +1,5 @@
1
1
  import './debug-to-string-CFb7h0lY.js';
2
- import { S as SourceOffset, a as SourceSpan, c as cannotReplaceOrRemoveInKeyHandlerYet, d as cannotRemoveNode, e as cannotReplaceNode, f as SYNTHETIC_LOCATION, i as isVoidTag, E as EntityParser, g as EventedTokenizer, n as namedCharRefs, N as NON_EXISTENT_LOCATION, p as parseWithoutProcessing, h as parse, b as build, v as voidMap, j as STRICT_RESOLUTION, T as Template$1, B as Block, k as NamedBlock$1, l as SourceSlice, A as Args$1, P as PositionalArguments, m as NamedArgument$1, o as NamedArguments$1, H as HtmlAttr, q as SplatAttr$1, C as ComponentArg, r as PathExpression$1, K as KeywordExpression, s as ThisReference, t as ArgReference, F as FreeVarReference, L as LocalVarReference, u as CallExpression$1, I as InterpolateExpression$1, w as LiteralExpression, x as AppendContent, y as ElementModifier, z as NamedBlocks$1, D as InvokeBlock$1, G as SimpleElement$1, J as InvokeComponent$1, M as SpanList, O as LooseModeResolution, Q as COMPONENT_NAMESPACE, R as MODIFIER_NAMESPACE, U as HELPER_NAMESPACE, V as HtmlText, W as HtmlComment, X as GlimmerComment, Y as Printer, Z as node, _ as isLiteral$1, $ as maybeLoc, a0 as loc } from './transform-resolutions-fXGQKGsL.js';
2
+ import { S as SourceOffset, a as SourceSpan, c as cannotReplaceOrRemoveInKeyHandlerYet, d as cannotRemoveNode, e as cannotReplaceNode, f as SYNTHETIC_LOCATION, i as isVoidTag, E as EntityParser, g as EventedTokenizer, n as namedCharRefs, N as NON_EXISTENT_LOCATION, p as parseWithoutProcessing, h as parse, b as build, v as voidMap, j as STRICT_RESOLUTION, T as Template$1, B as Block, k as NamedBlock$1, l as SourceSlice, A as Args$1, P as PositionalArguments, m as NamedArgument$1, o as NamedArguments$1, H as HtmlAttr, q as SplatAttr$1, C as ComponentArg, r as PathExpression$1, K as KeywordExpression, s as ThisReference, t as ArgReference, F as FreeVarReference, L as LocalVarReference, u as CallExpression$1, I as InterpolateExpression$1, w as LiteralExpression, x as AppendContent, y as ElementModifier, z as NamedBlocks$1, D as InvokeBlock$1, G as SimpleElement$1, J as InvokeComponent$1, M as SpanList, O as LooseModeResolution, Q as COMPONENT_NAMESPACE, R as MODIFIER_NAMESPACE, U as HELPER_NAMESPACE, V as HtmlText, W as HtmlComment, X as GlimmerComment, Y as Printer, Z as node, _ as isLiteral$1, $ as maybeLoc, a0 as loc } from './transform-resolutions-D-YtZ0_g.js';
3
3
  import { a as assert } from './assert-CUCJBR2C.js';
4
4
  import { s as setLocalDebugType } from './debug-brand-B1TWjOCH.js';
5
5
  import { SexpOpcodes as opcodes, WellKnownTagNames, WellKnownAttrNames } from '../@glimmer/wire-format/index.js';
@@ -52,10 +52,14 @@ class Source {
52
52
  static from(source, options = {}) {
53
53
  return new Source(source, options.meta?.moduleName);
54
54
  }
55
+
56
+ /** Char offset of each `\n` in the source. */
57
+ #newlineOffsets;
55
58
  constructor(source, module = 'an unknown module') {
56
59
  this.source = source;
57
60
  this.module = module;
58
61
  setLocalDebugType('syntax:source', this);
62
+ this.#newlineOffsets = computeNewlineOffsets(source);
59
63
  }
60
64
 
61
65
  /**
@@ -89,58 +93,59 @@ class Source {
89
93
  });
90
94
  }
91
95
  hbsPosFor(offset) {
92
- let seenLines = 0;
93
- let seenChars = 0;
94
- if (offset > this.source.length) {
95
- return null;
96
- }
97
-
98
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
99
- while (true) {
100
- let nextLine = this.source.indexOf('\n', seenChars);
101
- if (offset <= nextLine || nextLine === -1) {
102
- return {
103
- line: seenLines + 1,
104
- column: offset - seenChars
105
- };
106
- } else {
107
- seenLines += 1;
108
- seenChars = nextLine + 1;
109
- }
110
- }
96
+ if (offset < 0 || offset > this.source.length) return null;
97
+ const lineIdx = lowerBound(this.#newlineOffsets, offset);
98
+ return {
99
+ line: lineIdx + 1,
100
+ column: offset - this.#lineStartFor(lineIdx)
101
+ };
111
102
  }
112
- charPosFor(position) {
113
- let {
114
- line,
115
- column
116
- } = position;
117
- let sourceString = this.source;
118
- let sourceLength = sourceString.length;
119
- let seenLines = 0;
120
- let seenChars = 0;
121
- while (seenChars < sourceLength) {
122
- let nextLine = this.source.indexOf('\n', seenChars);
123
- if (nextLine === -1) nextLine = this.source.length;
124
- if (seenLines === line - 1) {
125
- if (seenChars + column > nextLine) return nextLine;
126
-
127
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
128
- {
129
- let roundTrip = this.hbsPosFor(seenChars + column);
130
- assert(roundTrip.line === line);
131
- assert(roundTrip.column === column);
132
- }
133
- return seenChars + column;
134
- } else if (nextLine === -1) {
135
- return 0;
136
- } else {
137
- seenLines += 1;
138
- seenChars = nextLine + 1;
103
+ charPosFor({
104
+ line,
105
+ column
106
+ }) {
107
+ const lineIdx = line - 1;
108
+ // Valid lines are [0, newlineOffsets.length]. Anything else has no offset.
109
+ if (lineIdx < 0 || lineIdx > this.#newlineOffsets.length || column < 0) return null;
110
+ const lineStart = lineIdx === 0 ? 0 : this.#newlineOffsets[lineIdx - 1] + 1;
111
+ const lineEnd = this.#newlineOffsets[lineIdx] ?? this.source.length;
112
+ const target = lineStart + column;
113
+ if (target <= lineEnd) {
114
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
115
+ {
116
+ const roundTrip = this.hbsPosFor(target);
117
+ (!(roundTrip.line === line) && assert(roundTrip.line === line));
118
+ (!(roundTrip.column === column) && assert(roundTrip.column === column));
139
119
  }
120
+ return target;
140
121
  }
141
- return sourceLength;
122
+ return lineEnd;
123
+ }
124
+ #lineStartFor(lineIdx) {
125
+ if (lineIdx === 0) return 0;
126
+ const prevNl = this.#newlineOffsets[lineIdx - 1];
127
+ return prevNl === undefined ? 0 : prevNl + 1;
142
128
  }
143
129
  }
130
+ function computeNewlineOffsets(source) {
131
+ const offsets = [];
132
+ for (let i = source.indexOf('\n'); i !== -1; i = source.indexOf('\n', i + 1)) {
133
+ offsets.push(i);
134
+ }
135
+ return offsets;
136
+ }
137
+
138
+ /** Lower-bound binary search: smallest i with arr[i] >= target, else arr.length. */
139
+ function lowerBound(arr, target) {
140
+ let lo = 0;
141
+ let hi = arr.length;
142
+ while (lo < hi) {
143
+ const mid = lo + hi >>> 1;
144
+ // mid is in [lo, hi) so always a valid index.
145
+ if (arr[mid] < target) lo = mid + 1;else hi = mid;
146
+ }
147
+ return lo;
148
+ }
144
149
 
145
150
  function generateSyntaxError(message, location) {
146
151
  let {
@@ -253,8 +258,6 @@ function getNodeHandler(visitor, nodeType) {
253
258
  // eslint-disable-next-line @typescript-eslint/no-deprecated
254
259
  if (visitor.Program) {
255
260
  if (nodeType === 'Template' && !visitor.Template || nodeType === 'Block' && !visitor.Block) {
256
-
257
- // eslint-disable-next-line @typescript-eslint/no-deprecated
258
261
  return visitor.Program;
259
262
  }
260
263
  }
@@ -504,7 +507,7 @@ function buildBlock(path, params, hash, _defaultBlock, _elseBlock = null, loc, o
504
507
  defaultBlock = _defaultBlock;
505
508
  }
506
509
  if (_elseBlock?.type === 'Template') {
507
- assert(_elseBlock.blockParams.length === 0);
510
+ (!(_elseBlock.blockParams.length === 0) && assert(_elseBlock.blockParams.length === 0));
508
511
  elseBlock = b.blockItself({
509
512
  params: [],
510
513
  body: _elseBlock.body,
@@ -581,11 +584,11 @@ function buildElement(tag, options = {}) {
581
584
  }
582
585
  } else if ('type' in tag) {
583
586
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- supports JS users
584
- assert(tag.type === 'PathExpression', `Invalid tag type ${tag.type}`);
587
+ (!(tag.type === 'PathExpression') && assert(tag.type === 'PathExpression', `Invalid tag type ${tag.type}`));
585
588
  path = tag;
586
589
  } else if ('path' in tag) {
587
590
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- supports JS users
588
- assert(tag.path.type === 'PathExpression', `Invalid tag type ${tag.path.type}`);
591
+ (!(tag.path.type === 'PathExpression') && assert(tag.path.type === 'PathExpression', `Invalid tag type ${tag.path.type}`));
589
592
  path = tag.path;
590
593
  selfClosing = tag.selfClosing;
591
594
  } else {
@@ -690,7 +693,7 @@ function buildPath(path, loc) {
690
693
  if ('type' in path) {
691
694
  return path;
692
695
  } else {
693
- assert(path.head.indexOf('.') === -1);
696
+ (!(path.head.indexOf('.') === -1) && assert(path.head.indexOf('.') === -1));
694
697
  let {
695
698
  head,
696
699
  tail
@@ -876,7 +879,8 @@ function buildLegacyPath({
876
879
  head,
877
880
  tail,
878
881
  get original() {
879
- return [this.head.original, ...this.tail].join('.');
882
+ const head = this.head.original;
883
+ return this.tail.length === 0 ? head : `${head}.${this.tail.join('.')}`;
880
884
  },
881
885
  set original(value) {
882
886
  let [head, ...tail] = asPresentArray(value.split('.'));
@@ -1236,8 +1240,8 @@ class Builders {
1236
1240
  return _name;
1237
1241
  },
1238
1242
  set name(value) {
1239
- assert(value[0] === '@');
1240
- assert(value.indexOf('.') === -1);
1243
+ (!(value[0] === '@') && assert(value[0] === '@'));
1244
+ (!(value.indexOf('.') === -1) && assert(value.indexOf('.') === -1));
1241
1245
  _name = value;
1242
1246
  },
1243
1247
  get original() {
@@ -1264,8 +1268,8 @@ class Builders {
1264
1268
  return _name;
1265
1269
  },
1266
1270
  set name(value) {
1267
- assert(value[0] !== '@');
1268
- assert(value.indexOf('.') === -1);
1271
+ (!(value[0] !== '@') && assert(value[0] !== '@'));
1272
+ (!(value.indexOf('.') === -1) && assert(value.indexOf('.') === -1));
1269
1273
  _name = value;
1270
1274
  },
1271
1275
  get original() {
@@ -1354,27 +1358,27 @@ class Parser {
1354
1358
  }
1355
1359
  get currentTag() {
1356
1360
  let node = this.currentNode;
1357
- assert(node && (node.type === 'StartTag' || node.type === 'EndTag'));
1361
+ (!(node && (node.type === 'StartTag' || node.type === 'EndTag')) && assert(node && (node.type === 'StartTag' || node.type === 'EndTag')));
1358
1362
  return node;
1359
1363
  }
1360
1364
  get currentStartTag() {
1361
1365
  let node = this.currentNode;
1362
- assert(node && node.type === 'StartTag');
1366
+ (!(node && node.type === 'StartTag') && assert(node && node.type === 'StartTag'));
1363
1367
  return node;
1364
1368
  }
1365
1369
  get currentEndTag() {
1366
1370
  let node = this.currentNode;
1367
- assert(node && node.type === 'EndTag');
1371
+ (!(node && node.type === 'EndTag') && assert(node && node.type === 'EndTag'));
1368
1372
  return node;
1369
1373
  }
1370
1374
  get currentComment() {
1371
1375
  let node = this.currentNode;
1372
- assert(node && node.type === 'CommentStatement');
1376
+ (!(node && node.type === 'CommentStatement') && assert(node && node.type === 'CommentStatement'));
1373
1377
  return node;
1374
1378
  }
1375
1379
  get currentData() {
1376
1380
  let node = this.currentNode;
1377
- assert(node && node.type === 'TextNode');
1381
+ (!(node && node.type === 'TextNode') && assert(node && node.type === 'TextNode'));
1378
1382
  return node;
1379
1383
  }
1380
1384
  acceptNode(node) {
@@ -1431,7 +1435,7 @@ class HandlebarsNodeVisitors extends Parser {
1431
1435
  // the error.
1432
1436
  pendingError = null;
1433
1437
  parse(program, blockParams) {
1434
- assert(program.loc);
1438
+ (!(program.loc) && assert(program.loc));
1435
1439
  let node = b.template({
1436
1440
  body: [],
1437
1441
  blockParams,
@@ -1447,7 +1451,7 @@ class HandlebarsNodeVisitors extends Parser {
1447
1451
  return template;
1448
1452
  }
1449
1453
  Program(program, blockParams) {
1450
- assert(program.loc);
1454
+ (!(program.loc) && assert(program.loc));
1451
1455
  let node = b.blockItself({
1452
1456
  body: [],
1453
1457
  params: blockParams,
@@ -1475,14 +1479,14 @@ class HandlebarsNodeVisitors extends Parser {
1475
1479
  if (poppedNode?.type === 'ElementNode') {
1476
1480
  throw generateSyntaxError(`Unclosed element \`${poppedNode.tag}\``, poppedNode.loc);
1477
1481
  } else {
1478
- assert(false, `[BUG] mismatched parser elementStack node: ${node.type}`);
1482
+ (assert(false, `[BUG] mismatched parser elementStack node: ${node.type}`));
1479
1483
  }
1480
1484
  }
1481
1485
  return node;
1482
1486
  }
1483
1487
  BlockStatement(block) {
1484
1488
  if (this.tokenizer.state === 'comment') {
1485
- assert(block.loc);
1489
+ (!(block.loc) && assert(block.loc));
1486
1490
  this.appendToCommentData(this.sourceForNode(block));
1487
1491
  return;
1488
1492
  }
@@ -2071,7 +2075,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2071
2075
  }
2072
2076
  } else {
2073
2077
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- exhaustive
2074
- assert(tag.type === 'EndTag', `Invalid tag type ${tag.type}`);
2078
+ (!(tag.type === 'EndTag') && assert(tag.type === 'EndTag', `Invalid tag type ${tag.type}`));
2075
2079
  this.finishEndTag(false);
2076
2080
  }
2077
2081
  }
@@ -2126,7 +2130,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2126
2130
  if (isVoid) {
2127
2131
  element.closeTag = null;
2128
2132
  } else if (element.selfClosing) {
2129
- assert(element.closeTag === null);
2133
+ (!(element.closeTag === null) && assert(element.closeTag === null));
2130
2134
  } else {
2131
2135
  element.closeTag = closeTagStart.until(this.offset());
2132
2136
  }
@@ -2153,9 +2157,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2153
2157
  if (tag.type === 'StartTag') {
2154
2158
  let offset = this.offset();
2155
2159
  if (tag.nameStart === null) {
2156
- assert(tag.nameEnd === null);
2157
-
2158
- // Note that the tokenizer already consumed the token here
2160
+ (!(tag.nameEnd === null) && assert(tag.nameEnd === null)); // Note that the tokenizer already consumed the token here
2159
2161
  tag.nameStart = offset.move(-1);
2160
2162
  }
2161
2163
  tag.nameEnd = offset;
@@ -2258,7 +2260,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2258
2260
  // Based on the ID validation regex in Handlebars.
2259
2261
 
2260
2262
  const ID_INVERSE_PATTERN = /[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;
2261
- assert(this.tokenizer.state === ATTRIBUTE_NAME);
2263
+ (!(this.tokenizer.state === ATTRIBUTE_NAME) && assert(this.tokenizer.state === ATTRIBUTE_NAME));
2262
2264
  const element = this.currentStartTag;
2263
2265
  const as = this.currentAttr;
2264
2266
  let state = {
@@ -2266,7 +2268,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2266
2268
  };
2267
2269
  const handlers = {
2268
2270
  PossibleAs: next => {
2269
- assert(state.state === 'PossibleAs');
2271
+ (!(state.state === 'PossibleAs') && assert(state.state === 'PossibleAs'));
2270
2272
  if (isSpace(next)) {
2271
2273
  // " as ..."
2272
2274
  state = {
@@ -2287,7 +2289,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2287
2289
  }
2288
2290
  },
2289
2291
  BeforeStartPipe: next => {
2290
- assert(state.state === 'BeforeStartPipe');
2292
+ (!(state.state === 'BeforeStartPipe') && assert(state.state === 'BeforeStartPipe'));
2291
2293
  if (isSpace(next)) {
2292
2294
  this.tokenizer.consume();
2293
2295
  } else if (next === '|') {
@@ -2305,7 +2307,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2305
2307
  }
2306
2308
  },
2307
2309
  BeforeBlockParamName: next => {
2308
- assert(state.state === 'BeforeBlockParamName');
2310
+ (!(state.state === 'BeforeBlockParamName') && assert(state.state === 'BeforeBlockParamName'));
2309
2311
  if (isSpace(next)) {
2310
2312
  this.tokenizer.consume();
2311
2313
  } else if (next === '') {
@@ -2345,7 +2347,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2345
2347
  }
2346
2348
  },
2347
2349
  BlockParamName: next => {
2348
- assert(state.state === 'BlockParamName');
2350
+ (!(state.state === 'BlockParamName') && assert(state.state === 'BlockParamName'));
2349
2351
  if (next === '') {
2350
2352
  // The HTML tokenizer ran out of characters, so we are either
2351
2353
  // encountering mustache or <EOF>, HBS side will attach the error
@@ -2385,7 +2387,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2385
2387
  }
2386
2388
  },
2387
2389
  AfterEndPipe: next => {
2388
- assert(state.state === 'AfterEndPipe');
2390
+ (!(state.state === 'AfterEndPipe') && assert(state.state === 'AfterEndPipe'));
2389
2391
  if (isSpace(next)) {
2390
2392
  this.tokenizer.consume();
2391
2393
  } else if (next === '') {
@@ -2419,7 +2421,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2419
2421
  }
2420
2422
  },
2421
2423
  Error: next => {
2422
- assert(state.state === 'Error');
2424
+ (!(state.state === 'Error') && assert(state.state === 'Error'));
2423
2425
  if (next === '' || next === '/' || next === '>' || isSpace(next)) {
2424
2426
  throw generateSyntaxError(state.message, state.start.until(this.offset()));
2425
2427
  } else {
@@ -2435,7 +2437,7 @@ class TokenizerEventHandlers extends HandlebarsNodeVisitors {
2435
2437
  next = this.tokenizer.peek();
2436
2438
  handlers[state.state](next);
2437
2439
  } while (state.state !== 'Done' && next !== '');
2438
- assert(state.state === 'Done');
2440
+ (!(state.state === 'Done') && assert(state.state === 'Done'));
2439
2441
  }
2440
2442
  reportSyntaxError(message) {
2441
2443
  throw generateSyntaxError(message, this.offset().collapsed());
@@ -2837,7 +2839,7 @@ class Builder {
2837
2839
  }
2838
2840
  at(name, symbol, loc) {
2839
2841
  // the `@` should be included so we have a complete source range
2840
- assert(name[0] === '@');
2842
+ (!(name[0] === '@') && assert(name[0] === '@'));
2841
2843
  return new ArgReference({
2842
2844
  loc,
2843
2845
  name: new SourceSlice({
@@ -2853,7 +2855,7 @@ class Builder {
2853
2855
  symbol,
2854
2856
  loc
2855
2857
  }) {
2856
- assert(name[0] !== '@');
2858
+ (!(name[0] !== '@') && assert(name[0] !== '@'));
2857
2859
  return new FreeVarReference({
2858
2860
  name,
2859
2861
  resolution: context,
@@ -2862,7 +2864,7 @@ class Builder {
2862
2864
  });
2863
2865
  }
2864
2866
  localVar(name, symbol, isTemplateLocal, loc) {
2865
- assert(name[0] !== '@');
2867
+ (!(name[0] !== '@') && assert(name[0] !== '@'));
2866
2868
  return new LocalVarReference({
2867
2869
  loc,
2868
2870
  name,
@@ -3271,7 +3273,7 @@ class ExpressionNormalizer {
3271
3273
  let paramLoc = SpanList.range(paramList, callee.loc.collapse('end'));
3272
3274
  let namedLoc = this.block.loc(hash.loc);
3273
3275
  let argsLoc = SpanList.range([paramLoc, namedLoc]);
3274
- let positional = this.block.builder.positional(params.map(p => this.normalize(p, STRICT_RESOLUTION)), paramLoc);
3276
+ let positional = this.block.builder.positional(paramList, paramLoc);
3275
3277
  let named = this.block.builder.named(hash.pairs.map(p => this.namedArgument(p)), this.block.loc(hash.loc));
3276
3278
  switch (callee.type) {
3277
3279
  case 'Literal':
@@ -3656,7 +3658,7 @@ class ElementNormalizer {
3656
3658
  }
3657
3659
  }
3658
3660
  attr(m) {
3659
- assert(m.name[0] !== '@');
3661
+ (!(m.name[0] !== '@') && assert(m.name[0] !== '@'));
3660
3662
  if (m.name === '...attributes') {
3661
3663
  return this.ctx.builder.splatAttr(this.ctx.table.allocateBlock('attrs'), this.ctx.loc(m.loc));
3662
3664
  }
@@ -3704,7 +3706,7 @@ class ElementNormalizer {
3704
3706
  }
3705
3707
  }
3706
3708
  arg(arg) {
3707
- assert(arg.name[0] === '@');
3709
+ (!(arg.name[0] === '@') && assert(arg.name[0] === '@'));
3708
3710
  this.checkArgCall(arg);
3709
3711
  let offsets = this.ctx.loc(arg.loc);
3710
3712
  let nameSlice = offsets.sliceStartChars({
@@ -5860,7 +5862,7 @@ class ExpressionEncoder {
5860
5862
  tail
5861
5863
  }) {
5862
5864
  let getOp = EXPR.expr(head);
5863
- assert(getOp[0] !== opcodes.GetStrictKeyword);
5865
+ (!(getOp[0] !== opcodes.GetStrictKeyword) && assert(getOp[0] !== opcodes.GetStrictKeyword));
5864
5866
  return [...getOp, EXPR.Tail(tail)];
5865
5867
  }
5866
5868
  InterpolateExpression({
@@ -1,7 +1,7 @@
1
1
  import { c as constants } from './fragment-Cc5k9Oy4.js';
2
2
  import './debug-to-string-CFb7h0lY.js';
3
3
  import { e as expect } from './collections-D_nY_0UJ.js';
4
- import { g as getInternalHelperManager, d as getInternalModifierManager, e as getInternalComponentManager } from './api-BqXkkT0p.js';
4
+ import { g as getInternalHelperManager, d as getInternalModifierManager, e as getInternalComponentManager } from './api-BQMslHhq.js';
5
5
  import '../@glimmer/destroyable/index.js';
6
6
  import '../@glimmer/global-context/index.js';
7
7
  import { e as enumerate } from './array-utils-CZQxrdD3.js';
@@ -10,7 +10,7 @@ import './reference-C3TKDRnP.js';
10
10
  import { c as capabilityFlagsFrom, m as managerHasCapability } from './capabilities-O_xc7Yqk.js';
11
11
  import { g as getComponentTemplate } from './template-kM-7TTcc.js';
12
12
  import { I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
13
- import { t as templateFactory } from './index-CtPSmMCE.js';
13
+ import { t as templateFactory } from './index-BUPd6pkm.js';
14
14
  import { SexpOpcodes as opcodes } from '../@glimmer/wire-format/index.js';
15
15
 
16
16
  function unwrapHandle(handle) {
@@ -7,14 +7,14 @@ import { CONSTANT_TAG, INITIAL, validateTag, consumeTag, valueForTag, beginTrack
7
7
  import { c as createComputeRef, v as valueForRef, a as createConstRef, d as createPrimitiveRef, i as isConstRef, U as UNDEFINED_REFERENCE, N as NULL_REFERENCE, T as TRUE_REFERENCE, F as FALSE_REFERENCE, R as REFERENCE, e as createDebugAliasRef, b as childRefFor, f as isInvokableRef, u as updateRef } from './reference-C3TKDRnP.js';
8
8
  import { e as $v0, f as $t1, g as $t0, a as $pc, b as $ra, c as $fp, d as $sp, h as $s1, $ as $s0 } from './registers-ylirb0dq.js';
9
9
  import { registerDestructor, destroy, associateDestroyableChild, _hasDestroyableChildren } from '../@glimmer/destroyable/index.js';
10
- import { d as getInternalModifierManager, g as getInternalHelperManager, b as hasInternalComponentManager, f as hasInternalHelperManager, s as setInternalComponentManager, i as setInternalHelperManager, j as setInternalModifierManager } from './api-BqXkkT0p.js';
10
+ import { d as getInternalModifierManager, g as getInternalHelperManager, h as hasInternalComponentManager, f as hasInternalHelperManager, s as setInternalComponentManager, i as setInternalHelperManager, j as setInternalModifierManager } from './api-BQMslHhq.js';
11
11
  import { m as managerHasCapability } from './capabilities-O_xc7Yqk.js';
12
12
  import { ContentType } from '../@glimmer/vm/index.js';
13
13
  import { createIteratorRef } from '../@glimmer/reference/index.js';
14
14
  import { s as setLocalDebugType } from './debug-brand-B1TWjOCH.js';
15
15
  import { b as EMPTY_STRING_ARRAY, e as enumerate, c as emptyArray } from './array-utils-CZQxrdD3.js';
16
16
  import { a as assert } from './assert-CUCJBR2C.js';
17
- import { a as unwrapTemplate } from './constants-DKn6zqFX.js';
17
+ import { a as unwrapTemplate } from './constants-BbdWMvgs.js';
18
18
  import { I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
19
19
  import { a as castToBrowser } from './simple-cast-DCvJLSin.js';
20
20
 
@@ -99,10 +99,10 @@ class AppendOpcodes {
99
99
  evaluate(vm, opcode, type) {
100
100
  let operation = unwrap(this.evaluateOpcode[type]);
101
101
  if (operation.syscall) {
102
- assert(!opcode.isMachine, `BUG: Mismatch between operation.syscall (${operation.syscall}) and opcode.isMachine (${opcode.isMachine}) for ${opcode.type}`);
102
+ (!(!opcode.isMachine) && assert(!opcode.isMachine, `BUG: Mismatch between operation.syscall (${operation.syscall}) and opcode.isMachine (${opcode.isMachine}) for ${opcode.type}`));
103
103
  operation.evaluate(vm, opcode);
104
104
  } else {
105
- assert(opcode.isMachine, `BUG: Mismatch between operation.syscall (${operation.syscall}) and opcode.isMachine (${opcode.isMachine}) for ${opcode.type}`);
105
+ (!(opcode.isMachine) && assert(opcode.isMachine, `BUG: Mismatch between operation.syscall (${operation.syscall}) and opcode.isMachine (${opcode.isMachine}) for ${opcode.type}`));
106
106
  operation.evaluate(vm.lowlevel, opcode);
107
107
  }
108
108
  }
@@ -598,7 +598,6 @@ APPEND_OPCODES.add(VM_INVOKE_YIELD_OP, vm => {
598
598
  let table = check(stack.pop());
599
599
  let args = check(stack.pop());
600
600
  if (table === null || handle === null) {
601
- // To balance the pop{Frame,Scope}
602
601
  vm.lowlevel.pushFrame();
603
602
  vm.pushScope(scope ?? vm.scope());
604
603
  return;
@@ -1195,7 +1194,7 @@ APPEND_OPCODES.add(VM_PREPARE_ARGS_OP, (vm, {
1195
1194
  definition
1196
1195
  } = instance;
1197
1196
  if (isCurriedType(definition, CURRIED_COMPONENT)) {
1198
- assert(!definition.manager);
1197
+ (!(!definition.manager) && assert(!definition.manager));
1199
1198
  let constants = vm.constants;
1200
1199
  let {
1201
1200
  definition: resolvedDefinition,
@@ -1506,7 +1505,7 @@ APPEND_OPCODES.add(VM_GET_COMPONENT_SELF_OP, (vm, {
1506
1505
  }
1507
1506
  let compilable = definition.compilable;
1508
1507
  if (compilable === null) {
1509
- assert(managerHasCapability(manager, instance.capabilities, InternalComponentCapabilities.dynamicLayout));
1508
+ (!(managerHasCapability(manager, instance.capabilities, InternalComponentCapabilities.dynamicLayout)) && assert(managerHasCapability(manager, instance.capabilities, InternalComponentCapabilities.dynamicLayout)));
1510
1509
  let resolver = vm.context.resolver;
1511
1510
  compilable = resolver === null ? null : manager.getDynamicLayout(state, resolver);
1512
1511
  }
@@ -1577,7 +1576,7 @@ APPEND_OPCODES.add(VM_GET_COMPONENT_LAYOUT_OP, (vm, {
1577
1576
  let {
1578
1577
  capabilities
1579
1578
  } = instance;
1580
- assert(managerHasCapability(manager, capabilities, InternalComponentCapabilities.dynamicLayout));
1579
+ (!(managerHasCapability(manager, capabilities, InternalComponentCapabilities.dynamicLayout)) && assert(managerHasCapability(manager, capabilities, InternalComponentCapabilities.dynamicLayout)));
1581
1580
  let resolver = vm.context.resolver;
1582
1581
  compilable = resolver === null ? null : manager.getDynamicLayout(instance.state, resolver);
1583
1582
  if (compilable === null) {
@@ -1,4 +1,4 @@
1
- import { G as DOMOperations, b as CursorImpl, C as ConcreteBounds, n as dynamicAttribute, j as clear } from './dynamic-Cu9Xpdzc.js';
1
+ import { G as DOMOperations, b as CursorImpl, C as ConcreteBounds, n as dynamicAttribute, j as clear } from './dynamic-CgX8M02_.js';
2
2
  import { a as assert } from './assert-CUCJBR2C.js';
3
3
  import { s as setLocalDebugType } from './debug-brand-B1TWjOCH.js';
4
4
  import './debug-to-string-CFb7h0lY.js';
@@ -394,7 +394,7 @@ class AppendingBlockList {
394
394
  }
395
395
  didAppendBounds(_bounds) {}
396
396
  finalize(_stack) {
397
- assert(this.boundList.length > 0);
397
+ (!(this.boundList.length > 0) && assert(this.boundList.length > 0));
398
398
  }
399
399
  }
400
400
  function clientBuilder(env, cursor) {
@@ -48,10 +48,10 @@ function assertResolverInvariants(meta) {
48
48
  * <Foo @arg={{true}} />
49
49
  */
50
50
  function resolveComponent(resolver, constants, meta, [, expr, then]) {
51
- assert(isGetFreeComponent(expr));
51
+ (!(isGetFreeComponent(expr)) && assert(isGetFreeComponent(expr)));
52
52
  let type = expr[0];
53
53
  if (expr[0] === opcodes.GetStrictKeyword) {
54
- assert(!meta.isStrictMode);
54
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
55
55
  throw new Error(`Attempted to resolve a component in a strict mode template, but that value was not in scope: ${
56
56
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
57
57
  meta.symbols.upvars[expr[1]] ?? '{unknown variable}'}`);
@@ -76,7 +76,7 @@ function resolveComponent(resolver, constants, meta, [, expr, then]) {
76
76
  let name = unwrap(upvars[expr[1]]);
77
77
  let definition = resolver?.lookupComponent?.(name, owner) ?? null;
78
78
  if ((typeof definition !== 'object' || definition === null)) {
79
- assert(!meta.isStrictMode);
79
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
80
80
  throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a component, but nothing was found.`);
81
81
  }
82
82
 
@@ -90,7 +90,7 @@ function resolveComponent(resolver, constants, meta, [, expr, then]) {
90
90
  * (helper arg)
91
91
  */
92
92
  function resolveHelper(resolver, constants, meta, [, expr, then]) {
93
- assert(isGetFreeHelper(expr));
93
+ (!(isGetFreeHelper(expr)) && assert(isGetFreeHelper(expr)));
94
94
  let type = expr[0];
95
95
  if (type === opcodes.GetLexicalSymbol) {
96
96
  let {
@@ -110,7 +110,7 @@ function resolveHelper(resolver, constants, meta, [, expr, then]) {
110
110
  let name = unwrap(upvars[expr[1]]);
111
111
  let helper = resolver?.lookupHelper?.(name, owner) ?? null;
112
112
  if (helper === null) {
113
- assert(!meta.isStrictMode);
113
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
114
114
  throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a helper, but nothing was found.`);
115
115
  }
116
116
 
@@ -125,7 +125,7 @@ function resolveHelper(resolver, constants, meta, [, expr, then]) {
125
125
  * <Foo {{modifier}}/>
126
126
  */
127
127
  function resolveModifier(resolver, constants, meta, [, expr, then]) {
128
- assert(isGetFreeModifier(expr));
128
+ (!(isGetFreeModifier(expr)) && assert(isGetFreeModifier(expr)));
129
129
  let type = expr[0];
130
130
  if (type === opcodes.GetLexicalSymbol) {
131
131
  let {
@@ -145,7 +145,7 @@ function resolveModifier(resolver, constants, meta, [, expr, then]) {
145
145
  let name = unwrap(upvars[expr[1]]);
146
146
  let modifier = resolver?.lookupBuiltInModifier?.(name) ?? null;
147
147
  if (modifier === null) {
148
- assert(!meta.isStrictMode);
148
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
149
149
  throw new Error(`Attempted to resolve a modifier in a strict mode template, but it was not in scope: ${name}`);
150
150
  }
151
151
 
@@ -161,7 +161,7 @@ function resolveModifier(resolver, constants, meta, [, expr, then]) {
161
161
  let name = unwrap(upvars[expr[1]]);
162
162
  let modifier = resolver?.lookupModifier?.(name, owner) ?? null;
163
163
  if (modifier === null) {
164
- assert(!meta.isStrictMode);
164
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
165
165
  throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a modifier, but nothing was found.`);
166
166
  }
167
167
 
@@ -177,7 +177,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
177
177
  ifComponent,
178
178
  ifHelper
179
179
  }]) {
180
- assert(isGetFreeComponentOrHelper(expr));
180
+ (!(isGetFreeComponentOrHelper(expr)) && assert(isGetFreeComponentOrHelper(expr)));
181
181
  let type = expr[0];
182
182
  if (type === opcodes.GetLexicalSymbol) {
183
183
  let {
@@ -195,7 +195,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
195
195
  }
196
196
  let helper = constants.helper(definition, null, true);
197
197
  if (helper === null) {
198
- assert(!meta.isStrictMode);
198
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
199
199
  throw new Error(
200
200
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
201
201
  `Attempted to use a value as either a component or helper, but it did not have a component manager or helper manager associated with it. The value was: ${debugToString(definition)}`);
@@ -217,7 +217,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
217
217
  } else {
218
218
  let helper = resolver?.lookupHelper?.(name, owner) ?? null;
219
219
  if (helper === null) {
220
- assert(!meta.isStrictMode);
220
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode));
221
221
  throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a component or helper, but nothing was found.`);
222
222
  }
223
223
 
@@ -235,7 +235,7 @@ function resolveOptionalComponentOrHelper(resolver, constants, meta, [, expr, {
235
235
  ifHelper,
236
236
  ifValue
237
237
  }]) {
238
- assert(isGetFreeComponentOrHelper(expr));
238
+ (!(isGetFreeComponentOrHelper(expr)) && assert(isGetFreeComponentOrHelper(expr)));
239
239
  let type = expr[0];
240
240
  if (type === opcodes.GetLexicalSymbol) {
241
241
  let {
@@ -292,9 +292,7 @@ function lookupBuiltInHelper(expr, resolver, meta, constants, type) {
292
292
  let name = unwrap(upvars[expr[1]]);
293
293
  let helper = resolver?.lookupBuiltInHelper?.(name) ?? null;
294
294
  if (helper === null) {
295
- assert(!meta.isStrictMode);
296
-
297
- // Keyword helper did not exist, which means that we're attempting to use a
295
+ (!(!meta.isStrictMode) && assert(!meta.isStrictMode)); // Keyword helper did not exist, which means that we're attempting to use a
298
296
  // value of some kind that is not in scope
299
297
  throw new Error(`Attempted to resolve a ${type} in a strict mode template, but that value was not in scope: ${
300
298
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
@@ -406,7 +404,7 @@ class Labels {
406
404
  } of targets) {
407
405
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
408
406
  let address = labels[target] - at;
409
- assert(heap.getbyaddr(at) === -1);
407
+ (!(heap.getbyaddr(at) === -1) && assert(heap.getbyaddr(at) === -1));
410
408
  heap.setbyaddr(at, address);
411
409
  }
412
410
  }
@@ -570,7 +568,7 @@ class Compilers {
570
568
  let name = sexp[0];
571
569
  let index = unwrap(this.names[name]);
572
570
  let func = this.funcs[index];
573
- assert(func, `expected an implementation for ${sexp[0]}`);
571
+ (!(func) && assert(func, `expected an implementation for ${sexp[0]}`));
574
572
  func(op, sexp);
575
573
  }
576
574
  }