ember-source 6.4.0-alpha.2 → 6.4.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.
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +984 -1608
- package/dist/ember-template-compiler.js.map +1 -0
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.js.map +1 -0
- package/dist/ember.debug.js +3732 -4197
- package/dist/ember.debug.js.map +1 -0
- package/dist/ember.prod.js +3561 -4146
- package/dist/ember.prod.js.map +1 -0
- package/dist/packages/@ember/-internals/container/index.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +2 -2
- package/dist/packages/@ember/-internals/meta/lib/meta.js +2 -2
- package/dist/packages/@ember/-internals/metal/index.js +9 -9
- package/dist/packages/@ember/-internals/owner/index.js +1 -0
- package/dist/packages/@ember/-internals/routing/index.js +4 -4
- package/dist/packages/@ember/-internals/runtime/index.js +1 -1
- package/dist/packages/@ember/-internals/runtime/lib/ext/rsvp.js +2 -2
- package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +4 -4
- package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -2
- package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +2 -2
- package/dist/packages/@ember/-internals/string/index.js +1 -1
- package/dist/packages/@ember/-internals/utils/index.js +4 -4
- package/dist/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +1 -1
- package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/child_views_support.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/class_names_support.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +3 -3
- package/dist/packages/@ember/-internals/views/lib/system/utils.js +1 -1
- package/dist/packages/@ember/-internals/views/lib/views/core_view.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/views/states.js +2 -4
- package/dist/packages/@ember/application/index.js +7 -7
- package/dist/packages/@ember/application/instance.js +5 -5
- package/dist/packages/@ember/application/namespace.js +4 -4
- package/dist/packages/@ember/array/index.js +4 -4
- package/dist/packages/@ember/array/proxy.js +4 -4
- package/dist/packages/@ember/component/helper.js +2 -2
- package/dist/packages/@ember/component/index.js +2 -2
- package/dist/packages/@ember/controller/index.js +3 -3
- package/dist/packages/@ember/debug/container-debug-adapter.js +2 -2
- package/dist/packages/@ember/debug/data-adapter.js +2 -2
- package/dist/packages/@ember/debug/lib/capture-render-tree.js +5 -3
- package/dist/packages/@ember/engine/index.js +8 -8
- package/dist/packages/@ember/engine/instance.js +3 -3
- package/dist/packages/@ember/helper/index.js +2 -2
- package/dist/packages/@ember/modifier/index.js +2 -2
- package/dist/packages/@ember/object/-internals.js +3 -3
- package/dist/packages/@ember/object/compat.js +2 -2
- package/dist/packages/@ember/object/computed.js +3 -3
- package/dist/packages/@ember/object/core.js +6 -6
- package/dist/packages/@ember/object/evented.js +3 -3
- package/dist/packages/@ember/object/events.js +2 -2
- package/dist/packages/@ember/object/index.js +6 -6
- package/dist/packages/@ember/object/internals.js +1 -1
- package/dist/packages/@ember/object/lib/computed/computed_macros.js +6 -6
- package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -3
- package/dist/packages/@ember/object/mixin.js +5 -5
- package/dist/packages/@ember/object/observable.js +4 -4
- package/dist/packages/@ember/object/observers.js +2 -2
- package/dist/packages/@ember/object/promise-proxy-mixin.js +3 -3
- package/dist/packages/@ember/renderer/index.js +2 -2
- package/dist/packages/@ember/routing/index.js +2 -2
- package/dist/packages/@ember/routing/lib/generate_controller.js +2 -2
- package/dist/packages/@ember/routing/lib/routing-service.js +2 -2
- package/dist/packages/@ember/routing/lib/utils.js +4 -4
- package/dist/packages/@ember/routing/route.js +10 -10
- package/dist/packages/@ember/routing/router-service.js +2 -2
- package/dist/packages/@ember/routing/router.js +8 -8
- package/dist/packages/@ember/runloop/index.js +2 -2
- package/dist/packages/@ember/service/index.js +2 -2
- package/dist/packages/@ember/template/index.js +2 -2
- package/dist/packages/@ember/template-compiler/lib/dasherize-component-name.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/plugins/assert-against-attrs.js +2 -2
- package/dist/packages/@ember/template-compiler/lib/plugins/assert-against-named-outlets.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js +2 -2
- package/dist/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js +3 -3
- package/dist/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/plugins/transform-each-track-array.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/plugins/transform-wrap-mount-and-outlet.js +1 -1
- package/dist/packages/@ember/template-compiler/lib/template.js +78 -94
- package/dist/packages/@ember/utils/lib/is_empty.js +2 -2
- package/dist/packages/@glimmer/destroyable/index.js +50 -21
- package/dist/packages/@glimmer/encoder/index.js +1 -2
- package/dist/packages/@glimmer/global-context/index.js +16 -28
- package/dist/packages/@glimmer/manager/index.js +155 -102
- package/dist/packages/@glimmer/node/index.js +8 -5
- package/dist/packages/@glimmer/opcode-compiler/index.js +604 -572
- package/dist/packages/@glimmer/owner/index.js +1 -0
- package/dist/packages/@glimmer/program/index.js +44 -111
- package/dist/packages/@glimmer/reference/index.js +20 -31
- package/dist/packages/@glimmer/runtime/index.js +3440 -3268
- package/dist/packages/@glimmer/tracking/index.js +2 -2
- package/dist/packages/@glimmer/tracking/primitives/cache.js +2 -2
- package/dist/packages/@glimmer/util/index.js +33 -274
- package/dist/packages/@glimmer/validator/index.js +42 -49
- package/dist/packages/@glimmer/vm/index.js +2 -140
- package/dist/packages/@glimmer/wire-format/index.js +1 -2
- package/dist/packages/ember/barrel.js +21 -21
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-testing/lib/ext/rsvp.js +1 -1
- package/dist/packages/ember-testing/lib/helpers/current_path.js +4 -4
- package/dist/packages/ember-testing/lib/helpers/current_route_name.js +4 -4
- package/dist/packages/ember-testing/lib/helpers/current_url.js +2 -2
- package/dist/packages/ember-testing/lib/helpers/pause_test.js +1 -1
- package/dist/packages/ember-testing/lib/helpers/wait.js +1 -1
- package/dist/packages/ember-testing/lib/initializers.js +6 -6
- package/dist/packages/ember-testing/lib/test/promise.js +1 -1
- package/dist/packages/ember-testing/lib/test/run.js +1 -1
- package/dist/packages/ember-testing/lib/test.js +4 -4
- package/dist/packages/router_js/index.js +2 -2
- package/dist/packages/rsvp/index.js +1 -1
- package/dist/packages/shared-chunks/{alias-B6fcydrB.js → alias-EKWHcUzN.js} +2 -2
- package/dist/packages/shared-chunks/{array-QJXVmB_W.js → array-Bwx-l2QI.js} +1 -1
- package/dist/packages/shared-chunks/{cache-Djf2I3Za.js → cache-DNQMcXNz.js} +5 -5
- package/dist/packages/shared-chunks/{index-CQygUgr9.js → index-CMZ-vfn1.js} +64 -69
- package/dist/packages/shared-chunks/{is_proxy-DjvCKvd5.js → is_proxy-D0K6dwtr.js} +1 -1
- package/dist/packages/shared-chunks/{mandatory-setter-BiXq-dpN.js → mandatory-setter-DzWEWEXy.js} +1 -1
- package/dist/packages/shared-chunks/{name-Dx2bGFVv.js → name-StEEeReb.js} +1 -1
- package/dist/packages/shared-chunks/{namespace_search-Ddzb9tZD.js → namespace_search-_taJ9-jZ.js} +2 -2
- package/dist/packages/shared-chunks/{property_set-DS4X3Soy.js → property_set-CZ11v306.js} +3 -3
- package/dist/packages/shared-chunks/{registry-B8WARvkP.js → registry-C1P1Zime.js} +1 -1
- package/dist/packages/shared-chunks/{router-DrLZsJeE.js → router-BViwI_oJ.js} +2 -2
- package/dist/packages/shared-chunks/{rsvp-DaQAFb0W.js → rsvp-ziM3qQyS.js} +25 -26
- package/dist/packages/shared-chunks/{set_properties-CeGJ0G9T.js → set_properties-DdgpJ3dD.js} +2 -2
- package/dist/packages/shared-chunks/{setup-registry-DXuvS1Rj.js → setup-registry-DqcicBVa.js} +2 -2
- package/dist/packages/shared-chunks/{to-string-B1BmwUkt.js → to-string-DQLo5iod.js} +1 -1
- package/dist/packages/shared-chunks/{transform-resolutions-O6uYv8DS.js → transform-resolutions-DckM6u9N.js} +347 -490
- package/dist/packages/shared-chunks/{unrecognized-url-error-zpz-JEoG.js → unrecognized-url-error-Csk7hcJF.js} +7 -6
- package/docs/data.json +510 -28
- package/lib/index.js +7 -2
- package/package.json +34 -33
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/unwrap-template.d.ts +7 -0
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +7 -9
- package/types/stable/@ember/-internals/glimmer/lib/resolver.d.ts +2 -5
- package/types/stable/index.d.ts +1 -0
- package/dist/packages/@glimmer/debug/index.js +0 -168
- package/types/publish.mjs +0 -514
package/dist/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../../debug/index.js';
|
|
2
2
|
import calculateLocationDisplay from '../system/calculate-location-display.js';
|
|
3
|
-
import {
|
|
3
|
+
import { trackLocals, isPath } from './utils.js';
|
|
4
4
|
import { isDevelopingApp } from '@embroider/macros';
|
|
5
5
|
import { assert } from '../../../debug/lib/assert.js';
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ function errorOnInputWithContent(env) {
|
|
|
17
17
|
BlockStatement(node) {
|
|
18
18
|
if (hasLocal('input')) return;
|
|
19
19
|
if (isPath(node.path) && node.path.original === 'input') {
|
|
20
|
-
(isDevelopingApp() &&
|
|
20
|
+
(isDevelopingApp() && true && assert(assertMessage(moduleName, node)));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
package/dist/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js
CHANGED
|
@@ -18,7 +18,7 @@ function assertReservedNamedArguments(env) {
|
|
|
18
18
|
loc
|
|
19
19
|
}) {
|
|
20
20
|
if (name === '@__ARGS__') {
|
|
21
|
-
(isDevelopingApp() &&
|
|
21
|
+
(isDevelopingApp() && true && assert(`${assertMessage(name)} ${calculateLocationDisplay(moduleName, loc)}`));
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
HashPair({
|
|
@@ -26,7 +26,7 @@ function assertReservedNamedArguments(env) {
|
|
|
26
26
|
loc
|
|
27
27
|
}) {
|
|
28
28
|
if (key === '__ARGS__') {
|
|
29
|
-
(isDevelopingApp() &&
|
|
29
|
+
(isDevelopingApp() && true && assert(`${assertMessage(key)} ${calculateLocationDisplay(moduleName, loc)}`));
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
PathExpression({
|
|
@@ -34,7 +34,7 @@ function assertReservedNamedArguments(env) {
|
|
|
34
34
|
loc
|
|
35
35
|
}) {
|
|
36
36
|
if (isReserved(original)) {
|
|
37
|
-
(isDevelopingApp() &&
|
|
37
|
+
(isDevelopingApp() && true && assert(`${assertMessage(original)} ${calculateLocationDisplay(moduleName, loc)}`));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -7,7 +7,7 @@ import transformEachInIntoEach from './transform-each-in-into-each.js';
|
|
|
7
7
|
import transformEachTrackArray from './transform-each-track-array.js';
|
|
8
8
|
import transformInElement from './transform-in-element.js';
|
|
9
9
|
import transformQuotedBindingsIntoJustBindings from './transform-quoted-bindings-into-just-bindings.js';
|
|
10
|
-
import { t as transformResolutions } from '../../../../shared-chunks/transform-resolutions-
|
|
10
|
+
import { t as transformResolutions } from '../../../../shared-chunks/transform-resolutions-DckM6u9N.js';
|
|
11
11
|
import transformWrapMountAndOutlet from './transform-wrap-mount-and-outlet.js';
|
|
12
12
|
|
|
13
13
|
const INTERNAL_PLUGINS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../../../debug/index.js';
|
|
2
|
-
export { t as default } from '../../../../shared-chunks/transform-resolutions-
|
|
2
|
+
export { t as default } from '../../../../shared-chunks/transform-resolutions-DckM6u9N.js';
|
|
3
3
|
import '../system/calculate-location-display.js';
|
|
4
4
|
import './utils.js';
|
|
5
5
|
import '@embroider/macros';
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import templateOnly from '../../component/template-only.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as node, a as api$2, g as generateSyntaxError, b as api$1, m as maybeLoc, K as KEYWORDS_TYPES, i as isKeyword, S as SourceSlice, c as normalize, l as loc } from '../../../shared-chunks/transform-resolutions-O6uYv8DS.js';
|
|
5
|
-
import { CurriedType as CurriedTypes } from '../../../@glimmer/vm/index.js';
|
|
2
|
+
import { SexpOpcodes as opcodes, WellKnownTagNames, WellKnownAttrNames } from '../../../@glimmer/wire-format/index.js';
|
|
3
|
+
import { n as node, a as api$1, g as generateSyntaxError, b as api, m as maybeLoc, i as isKeyword, K as KEYWORDS_TYPES, S as SourceSlice, c as normalize, l as loc } from '../../../shared-chunks/transform-resolutions-DckM6u9N.js';
|
|
6
4
|
import { setComponentTemplate } from '../../../@glimmer/manager/index.js';
|
|
7
5
|
import { templateFactory } from '../../../@glimmer/opcode-compiler/index.js';
|
|
8
6
|
import compileOptions from './compile-options.js';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
/// Builder ///
|
|
9
|
+
const CURRIED_COMPONENT = 0,
|
|
10
|
+
CURRIED_HELPER = 1,
|
|
11
|
+
CURRIED_MODIFIER = 2;
|
|
12
|
+
function isPresentArray(list) {
|
|
13
|
+
return !!list && list.length > 0;
|
|
14
|
+
}
|
|
15
|
+
function mapPresentArray(list, mapper) {
|
|
16
|
+
if (null === list) return null;
|
|
17
|
+
let out = [];
|
|
18
|
+
for (let item of list) out.push(mapper(item));
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
22
21
|
class Template extends node("Template").fields() {}
|
|
23
22
|
class InElement extends node("InElement").fields() {}
|
|
24
23
|
class Not extends node("Not").fields() {}
|
|
@@ -83,7 +82,6 @@ class PresentList {
|
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
class EmptyList {
|
|
86
|
-
list = [];
|
|
87
85
|
map(_callback) {
|
|
88
86
|
return new EmptyList();
|
|
89
87
|
}
|
|
@@ -101,6 +99,9 @@ class EmptyList {
|
|
|
101
99
|
}) {
|
|
102
100
|
return ifEmpty();
|
|
103
101
|
}
|
|
102
|
+
constructor() {
|
|
103
|
+
this.list = [];
|
|
104
|
+
}
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
// export type OptionalList<T> = PresentList<T> | EmptyList<T>;
|
|
@@ -119,10 +120,8 @@ class ResultImpl {
|
|
|
119
120
|
}
|
|
120
121
|
const Result = ResultImpl;
|
|
121
122
|
class OkImpl extends ResultImpl {
|
|
122
|
-
isOk = !0;
|
|
123
|
-
isErr = !1;
|
|
124
123
|
constructor(value) {
|
|
125
|
-
super(), this.value = value;
|
|
124
|
+
super(), this.value = value, this.isOk = true, this.isErr = false;
|
|
126
125
|
}
|
|
127
126
|
expect(_message) {
|
|
128
127
|
return this.value;
|
|
@@ -144,10 +143,8 @@ class OkImpl extends ResultImpl {
|
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
class ErrImpl extends ResultImpl {
|
|
147
|
-
isOk = !1;
|
|
148
|
-
isErr = !0;
|
|
149
146
|
constructor(reason) {
|
|
150
|
-
super(), this.reason = reason;
|
|
147
|
+
super(), this.reason = reason, this.isOk = false, this.isErr = true;
|
|
151
148
|
}
|
|
152
149
|
expect(message) {
|
|
153
150
|
throw new Error(message || "expected an Ok, got Err");
|
|
@@ -193,9 +190,9 @@ class ResultArray {
|
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
192
|
function convertPathToCallIfKeyword(path) {
|
|
196
|
-
return "Path" === path.type && "Free" === path.ref.type && path.ref.name in KEYWORDS_TYPES ? new api
|
|
193
|
+
return "Path" === path.type && "Free" === path.ref.type && path.ref.name in KEYWORDS_TYPES ? new api.CallExpression({
|
|
197
194
|
callee: path,
|
|
198
|
-
args: api
|
|
195
|
+
args: api.Args.empty(path.loc),
|
|
199
196
|
loc: path.loc
|
|
200
197
|
}) : path;
|
|
201
198
|
}
|
|
@@ -232,7 +229,7 @@ const VISIT_EXPRS = new class {
|
|
|
232
229
|
tail: tail
|
|
233
230
|
} = path;
|
|
234
231
|
if (isPresentArray(tail)) {
|
|
235
|
-
let tailLoc = tail[0].loc.extend(
|
|
232
|
+
let tailLoc = tail[0].loc.extend((list = tail, 0 === list.length ? void 0 : list[list.length - 1]).loc);
|
|
236
233
|
return Ok(new PathExpression({
|
|
237
234
|
loc: path.loc,
|
|
238
235
|
head: ref,
|
|
@@ -243,6 +240,7 @@ const VISIT_EXPRS = new class {
|
|
|
243
240
|
}));
|
|
244
241
|
}
|
|
245
242
|
return Ok(ref);
|
|
243
|
+
var list;
|
|
246
244
|
}
|
|
247
245
|
VariableReference(ref) {
|
|
248
246
|
return ref;
|
|
@@ -301,7 +299,6 @@ const VISIT_EXPRS = new class {
|
|
|
301
299
|
}
|
|
302
300
|
}();
|
|
303
301
|
class KeywordImpl {
|
|
304
|
-
types;
|
|
305
302
|
constructor(keyword, type, delegate) {
|
|
306
303
|
this.keyword = keyword, this.delegate = delegate;
|
|
307
304
|
let nodes = new Set();
|
|
@@ -309,7 +306,7 @@ class KeywordImpl {
|
|
|
309
306
|
this.types = nodes;
|
|
310
307
|
}
|
|
311
308
|
match(node) {
|
|
312
|
-
if (!this.types.has(node.type)) return
|
|
309
|
+
if (!this.types.has(node.type)) return false;
|
|
313
310
|
let path = getCalleeExpression(node);
|
|
314
311
|
return null !== path && "Path" === path.type && "Free" === path.ref.type && path.ref.name === this.keyword;
|
|
315
312
|
}
|
|
@@ -330,11 +327,6 @@ const KEYWORD_NODES = {
|
|
|
330
327
|
Append: ["AppendContent"],
|
|
331
328
|
Modifier: ["ElementModifier"]
|
|
332
329
|
};
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* A "generic" keyword is something like `has-block`, which makes sense in the context
|
|
336
|
-
* of sub-expression or append
|
|
337
|
-
*/
|
|
338
330
|
function getCalleeExpression(node) {
|
|
339
331
|
switch (node.type) {
|
|
340
332
|
// This covers the inside of attributes and expressions, as well as the callee
|
|
@@ -352,15 +344,11 @@ function getCalleeExpression(node) {
|
|
|
352
344
|
}
|
|
353
345
|
}
|
|
354
346
|
class Keywords {
|
|
355
|
-
_keywords = [];
|
|
356
|
-
_type;
|
|
357
347
|
constructor(type) {
|
|
358
|
-
this._type = type;
|
|
348
|
+
this._keywords = [], this._type = type;
|
|
359
349
|
}
|
|
360
350
|
kw(name, delegate) {
|
|
361
|
-
return this._keywords.push(
|
|
362
|
-
return new KeywordImpl(keyword, type, delegate);
|
|
363
|
-
}(name, this._type, delegate)), this;
|
|
351
|
+
return this._keywords.push(new KeywordImpl(name, this._type, delegate)), this;
|
|
364
352
|
}
|
|
365
353
|
translate(node, state) {
|
|
366
354
|
for (let keyword of this._keywords) {
|
|
@@ -386,7 +374,7 @@ class Keywords {
|
|
|
386
374
|
case "Modifier":
|
|
387
375
|
return `- As a modifier, as in: <div {{${name}}}></div>`;
|
|
388
376
|
default:
|
|
389
|
-
return
|
|
377
|
+
return;
|
|
390
378
|
}
|
|
391
379
|
}).join("\n\n");
|
|
392
380
|
}
|
|
@@ -503,14 +491,14 @@ function toAppend({
|
|
|
503
491
|
};
|
|
504
492
|
}
|
|
505
493
|
const CurriedTypeToReadableType = {
|
|
506
|
-
[
|
|
507
|
-
[
|
|
508
|
-
[
|
|
494
|
+
[CURRIED_COMPONENT]: "component",
|
|
495
|
+
[CURRIED_HELPER]: "helper",
|
|
496
|
+
[CURRIED_MODIFIER]: "modifier"
|
|
509
497
|
};
|
|
510
498
|
function assertCurryKeyword(curriedType) {
|
|
511
499
|
return (node, state) => {
|
|
512
500
|
let readableType = CurriedTypeToReadableType[curriedType],
|
|
513
|
-
stringsAllowed =
|
|
501
|
+
stringsAllowed = 0 === curriedType,
|
|
514
502
|
{
|
|
515
503
|
args: args
|
|
516
504
|
} = node,
|
|
@@ -520,8 +508,8 @@ function assertCurryKeyword(curriedType) {
|
|
|
520
508
|
if (stringsAllowed && state.isStrict) return Err(generateSyntaxError(`(${readableType}) cannot resolve string values in strict mode templates`, node.loc));
|
|
521
509
|
if (!stringsAllowed) return Err(generateSyntaxError(`(${readableType}) cannot resolve string values, you must pass a ${readableType} definition directly`, node.loc));
|
|
522
510
|
}
|
|
523
|
-
return args = new api
|
|
524
|
-
positional: new api
|
|
511
|
+
return args = new api.Args({
|
|
512
|
+
positional: new api.PositionalArguments({
|
|
525
513
|
exprs: args.positional.exprs.slice(1),
|
|
526
514
|
loc: args.positional.loc
|
|
527
515
|
}),
|
|
@@ -585,7 +573,7 @@ function assertHasBlockKeyword(type) {
|
|
|
585
573
|
if (!positionals || positionals.isEmpty()) return Ok(SourceSlice.synthetic("default"));
|
|
586
574
|
if (1 === positionals.exprs.length) {
|
|
587
575
|
let positional = positionals.exprs[0];
|
|
588
|
-
return api
|
|
576
|
+
return api.isLiteral(positional, "string") ? Ok(positional.toSlice()) : Err(generateSyntaxError(`(${type}) can only receive a string literal as its first argument`, call.loc));
|
|
589
577
|
}
|
|
590
578
|
return Err(generateSyntaxError(`(${type}) only takes a single positional argument`, call.loc));
|
|
591
579
|
};
|
|
@@ -623,7 +611,7 @@ function assertIfUnlessInlineKeyword(type) {
|
|
|
623
611
|
if (!positional || !condition) return Err(generateSyntaxError(`When used inline, (${type}) requires at least two parameters 1. the condition that determines the state of the (${type}), and 2. the value to return if the condition is ${inverted ? "false" : "true"}. Did not receive any parameters`, originalNode.loc));
|
|
624
612
|
let truthy = positional.nth(1),
|
|
625
613
|
falsy = positional.nth(2);
|
|
626
|
-
return null === truthy ? Err(generateSyntaxError(`When used inline, (${type}) requires at least two parameters 1. the condition that determines the state of the (${type}), and 2. the value to return if the condition is ${inverted ? "false" : "true"}. Received only one parameter, the condition`, originalNode.loc)) : positional.size > 3 ? Err(generateSyntaxError(`When used inline, (${type}) can receive a maximum of three positional parameters 1. the condition that determines the state of the (${type}), 2. the value to return if the condition is ${inverted ? "false" : "true"}, and 3. the value to return if the condition is ${inverted ? "true" : "false"}. Received ${positional
|
|
614
|
+
return null === truthy ? Err(generateSyntaxError(`When used inline, (${type}) requires at least two parameters 1. the condition that determines the state of the (${type}), and 2. the value to return if the condition is ${inverted ? "false" : "true"}. Received only one parameter, the condition`, originalNode.loc)) : positional.size > 3 ? Err(generateSyntaxError(`When used inline, (${type}) can receive a maximum of three positional parameters 1. the condition that determines the state of the (${type}), 2. the value to return if the condition is ${inverted ? "false" : "true"}, and 3. the value to return if the condition is ${inverted ? "true" : "false"}. Received ${positional.size} parameters`, originalNode.loc)) : Ok({
|
|
627
615
|
condition: condition,
|
|
628
616
|
truthy: truthy,
|
|
629
617
|
falsy: falsy
|
|
@@ -668,7 +656,7 @@ const logKeyword = {
|
|
|
668
656
|
positional: positional
|
|
669
657
|
}
|
|
670
658
|
} = node;
|
|
671
|
-
return named
|
|
659
|
+
return named.isEmpty() ? Ok(positional) : Err(generateSyntaxError("(log) does not take any named arguments", node.loc));
|
|
672
660
|
},
|
|
673
661
|
translate: function ({
|
|
674
662
|
node: node,
|
|
@@ -686,12 +674,12 @@ const logKeyword = {
|
|
|
686
674
|
args: args
|
|
687
675
|
} = node;
|
|
688
676
|
if (args.named.isEmpty()) return Ok({
|
|
689
|
-
target: api$
|
|
677
|
+
target: api$1.SourceSpan.synthetic("default").toSlice(),
|
|
690
678
|
positional: args.positional
|
|
691
679
|
});
|
|
692
680
|
{
|
|
693
681
|
let target = args.named.get("to");
|
|
694
|
-
return args.named.size > 1 || null === target ? Err(generateSyntaxError("yield only takes a single named argument: 'to'", args.named.loc)) : api
|
|
682
|
+
return args.named.size > 1 || null === target ? Err(generateSyntaxError("yield only takes a single named argument: 'to'", args.named.loc)) : api.isLiteral(target, "string") ? Ok({
|
|
695
683
|
target: target.toSlice(),
|
|
696
684
|
positional: args.positional
|
|
697
685
|
}) : Err(generateSyntaxError("you can only yield to a literal string value", target.loc));
|
|
@@ -724,12 +712,12 @@ const logKeyword = {
|
|
|
724
712
|
state: {
|
|
725
713
|
scope: scope
|
|
726
714
|
}
|
|
727
|
-
}) =>
|
|
715
|
+
}) => Ok(new Debugger({
|
|
728
716
|
loc: node.loc,
|
|
729
717
|
scope: scope
|
|
730
|
-
}))
|
|
718
|
+
}))
|
|
731
719
|
}).kw("component", {
|
|
732
|
-
assert: assertCurryKeyword(
|
|
720
|
+
assert: assertCurryKeyword(0),
|
|
733
721
|
translate({
|
|
734
722
|
node: node,
|
|
735
723
|
state: state
|
|
@@ -747,7 +735,7 @@ const logKeyword = {
|
|
|
747
735
|
}));
|
|
748
736
|
}
|
|
749
737
|
}).kw("helper", {
|
|
750
|
-
assert: assertCurryKeyword(
|
|
738
|
+
assert: assertCurryKeyword(1),
|
|
751
739
|
translate({
|
|
752
740
|
node: node,
|
|
753
741
|
state: state
|
|
@@ -959,7 +947,7 @@ const logKeyword = {
|
|
|
959
947
|
}));
|
|
960
948
|
}
|
|
961
949
|
}).kw("component", {
|
|
962
|
-
assert: assertCurryKeyword(
|
|
950
|
+
assert: assertCurryKeyword(0),
|
|
963
951
|
translate({
|
|
964
952
|
node: node,
|
|
965
953
|
state: state
|
|
@@ -978,7 +966,7 @@ const logKeyword = {
|
|
|
978
966
|
}));
|
|
979
967
|
}
|
|
980
968
|
}),
|
|
981
|
-
CALL_KEYWORDS = keywords("Call").kw("has-block", hasBlockKeyword("has-block")).kw("has-block-params", hasBlockKeyword("has-block-params")).kw("-get-dynamic-var", getDynamicVarKeyword).kw("log", logKeyword).kw("if", ifUnlessInlineKeyword("if")).kw("unless", ifUnlessInlineKeyword("unless")).kw("component", curryKeyword(
|
|
969
|
+
CALL_KEYWORDS = keywords("Call").kw("has-block", hasBlockKeyword("has-block")).kw("has-block-params", hasBlockKeyword("has-block-params")).kw("-get-dynamic-var", getDynamicVarKeyword).kw("log", logKeyword).kw("if", ifUnlessInlineKeyword("if")).kw("unless", ifUnlessInlineKeyword("unless")).kw("component", curryKeyword(0)).kw("helper", curryKeyword(1)).kw("modifier", curryKeyword(2)),
|
|
982
970
|
MODIFIER_KEYWORDS = keywords("Modifier"),
|
|
983
971
|
XLINK = "http://www.w3.org/1999/xlink",
|
|
984
972
|
XML = "http://www.w3.org/XML/1998/namespace",
|
|
@@ -1016,7 +1004,6 @@ function deflateAttrName(attrName) {
|
|
|
1016
1004
|
return DEFLATE_ATTR_TABLE[attrName] ?? attrName;
|
|
1017
1005
|
}
|
|
1018
1006
|
class ClassifiedElement {
|
|
1019
|
-
delegate;
|
|
1020
1007
|
constructor(element, delegate, state) {
|
|
1021
1008
|
this.element = element, this.state = state, this.delegate = delegate;
|
|
1022
1009
|
}
|
|
@@ -1028,7 +1015,7 @@ class ClassifiedElement {
|
|
|
1028
1015
|
rawValue = attr.value,
|
|
1029
1016
|
namespace = (attrName = name.chars, WHITELIST[attrName] || void 0);
|
|
1030
1017
|
var attrName;
|
|
1031
|
-
return api
|
|
1018
|
+
return api.isLiteral(rawValue, "string") ? Ok(new StaticAttr({
|
|
1032
1019
|
loc: attr.loc,
|
|
1033
1020
|
name: name,
|
|
1034
1021
|
value: rawValue.toSlice(),
|
|
@@ -1074,7 +1061,7 @@ class ClassifiedElement {
|
|
|
1074
1061
|
return typeAttr && attrs.add(this.attr(typeAttr)), Result.all(args.toArray(), attrs.toArray()).mapOk(([args, attrs]) => ({
|
|
1075
1062
|
attrs: attrs,
|
|
1076
1063
|
args: new NamedArguments({
|
|
1077
|
-
loc: maybeLoc(args, api$
|
|
1064
|
+
loc: maybeLoc(args, api$1.SourceSpan.NON_EXISTENT),
|
|
1078
1065
|
entries: OptionalList(args)
|
|
1079
1066
|
})
|
|
1080
1067
|
}));
|
|
@@ -1091,7 +1078,7 @@ class ClassifiedElement {
|
|
|
1091
1078
|
return {
|
|
1092
1079
|
args: args,
|
|
1093
1080
|
params: new ElementParameters({
|
|
1094
|
-
loc: maybeLoc(elementParams, api$
|
|
1081
|
+
loc: maybeLoc(elementParams, api$1.SourceSpan.NON_EXISTENT),
|
|
1095
1082
|
body: OptionalList(elementParams)
|
|
1096
1083
|
})
|
|
1097
1084
|
};
|
|
@@ -1099,9 +1086,8 @@ class ClassifiedElement {
|
|
|
1099
1086
|
}
|
|
1100
1087
|
}
|
|
1101
1088
|
class ClassifiedComponent {
|
|
1102
|
-
dynamicFeatures = !0;
|
|
1103
1089
|
constructor(tag, element) {
|
|
1104
|
-
this.tag = tag, this.element = element;
|
|
1090
|
+
this.tag = tag, this.element = element, this.dynamicFeatures = true;
|
|
1105
1091
|
}
|
|
1106
1092
|
arg(attr, {
|
|
1107
1093
|
state: state
|
|
@@ -1135,9 +1121,8 @@ class ClassifiedComponent {
|
|
|
1135
1121
|
}
|
|
1136
1122
|
class ClassifiedSimpleElement {
|
|
1137
1123
|
constructor(tag, element, dynamicFeatures) {
|
|
1138
|
-
this.tag = tag, this.element = element, this.dynamicFeatures = dynamicFeatures;
|
|
1124
|
+
this.tag = tag, this.element = element, this.dynamicFeatures = dynamicFeatures, this.isComponent = false;
|
|
1139
1125
|
}
|
|
1140
|
-
isComponent = !1;
|
|
1141
1126
|
arg(attr) {
|
|
1142
1127
|
return Err(generateSyntaxError(`${attr.name.chars} is not a valid attribute name. @arguments are only allowed on components, but the tag for this element (\`${this.tag.chars}\`) is a regular, non-component HTML element.`, attr.loc));
|
|
1143
1128
|
}
|
|
@@ -1231,7 +1216,7 @@ const VISIT_STMTS = new class {
|
|
|
1231
1216
|
TextNode(text) {
|
|
1232
1217
|
return new AppendTextNode({
|
|
1233
1218
|
loc: text.loc,
|
|
1234
|
-
text: new api
|
|
1219
|
+
text: new api.LiteralExpression({
|
|
1235
1220
|
loc: text.loc,
|
|
1236
1221
|
value: text.chars
|
|
1237
1222
|
})
|
|
@@ -1249,10 +1234,8 @@ const VISIT_STMTS = new class {
|
|
|
1249
1234
|
* This is the mutable state for this compiler pass.
|
|
1250
1235
|
*/
|
|
1251
1236
|
class NormalizationState {
|
|
1252
|
-
_currentScope;
|
|
1253
|
-
_cursorCount = 0;
|
|
1254
1237
|
constructor(block, isStrict) {
|
|
1255
|
-
this.isStrict = isStrict, this._currentScope = block;
|
|
1238
|
+
this.isStrict = isStrict, this._cursorCount = 0, this._currentScope = block;
|
|
1256
1239
|
}
|
|
1257
1240
|
generateUniqueCursor() {
|
|
1258
1241
|
return `%cursor:${this._cursorCount++}%`;
|
|
@@ -1270,9 +1253,8 @@ class NormalizationState {
|
|
|
1270
1253
|
}
|
|
1271
1254
|
}
|
|
1272
1255
|
}
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
}(ResolutionType || {});
|
|
1256
|
+
|
|
1257
|
+
/// ResolutionType ///
|
|
1276
1258
|
class StrictModeValidationPass {
|
|
1277
1259
|
// This is done at the end of all the keyword normalizations
|
|
1278
1260
|
// At this point any free variables that isn't a valid keyword
|
|
@@ -1360,7 +1342,7 @@ class StrictModeValidationPass {
|
|
|
1360
1342
|
case "InterpolateExpression":
|
|
1361
1343
|
return this.InterpolateExpression(expression, span, resolution);
|
|
1362
1344
|
case "CallExpression":
|
|
1363
|
-
return this.CallExpression(expression, span, resolution ??
|
|
1345
|
+
return this.CallExpression(expression, span, resolution ?? "helper");
|
|
1364
1346
|
case "Not":
|
|
1365
1347
|
return this.Expression(expression.value, span, resolution);
|
|
1366
1348
|
case "IfInline":
|
|
@@ -1380,6 +1362,7 @@ class StrictModeValidationPass {
|
|
|
1380
1362
|
// For cases like {{yield foo}}, when there is only a single argument, it
|
|
1381
1363
|
// makes for a slightly better error to report that entire span. However,
|
|
1382
1364
|
// when there are more than one, we need to be specific.
|
|
1365
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme PresentArray
|
|
1383
1366
|
return result = 1 === expressions.length ? this.Expression(expressions[0], span) : this.Expressions(expressions), result;
|
|
1384
1367
|
}
|
|
1385
1368
|
NamedArguments({
|
|
@@ -1390,7 +1373,7 @@ class StrictModeValidationPass {
|
|
|
1390
1373
|
return result;
|
|
1391
1374
|
}
|
|
1392
1375
|
NamedArgument(arg) {
|
|
1393
|
-
return "CallExpression" === arg.value.type ? this.Expression(arg.value, arg,
|
|
1376
|
+
return "CallExpression" === arg.value.type ? this.Expression(arg.value, arg, "helper") : this.Expression(arg.value, arg);
|
|
1394
1377
|
}
|
|
1395
1378
|
ElementParameters({
|
|
1396
1379
|
body: body
|
|
@@ -1411,10 +1394,10 @@ class StrictModeValidationPass {
|
|
|
1411
1394
|
}
|
|
1412
1395
|
}
|
|
1413
1396
|
DynamicAttr(attr) {
|
|
1414
|
-
return "CallExpression" === attr.value.type ? this.Expression(attr.value, attr,
|
|
1397
|
+
return "CallExpression" === attr.value.type ? this.Expression(attr.value, attr, "helper") : this.Expression(attr.value, attr);
|
|
1415
1398
|
}
|
|
1416
1399
|
Modifier(modifier) {
|
|
1417
|
-
return this.Expression(modifier.callee, modifier,
|
|
1400
|
+
return this.Expression(modifier.callee, modifier, "modifier").andThen(() => this.Args(modifier.args));
|
|
1418
1401
|
}
|
|
1419
1402
|
InElement(inElement) {
|
|
1420
1403
|
return this.Expression(inElement.destination).andThen(() => this.Expression(inElement.insertBefore)).andThen(() => this.NamedBlock(inElement.block));
|
|
@@ -1426,16 +1409,16 @@ class StrictModeValidationPass {
|
|
|
1426
1409
|
return this.Expression(statement.html, statement);
|
|
1427
1410
|
}
|
|
1428
1411
|
AppendTextNode(statement) {
|
|
1429
|
-
return "CallExpression" === statement.text.type ? this.Expression(statement.text, statement,
|
|
1412
|
+
return "CallExpression" === statement.text.type ? this.Expression(statement.text, statement, "component or helper") : this.Expression(statement.text, statement);
|
|
1430
1413
|
}
|
|
1431
1414
|
Component(statement) {
|
|
1432
|
-
return this.Expression(statement.tag, statement,
|
|
1415
|
+
return this.Expression(statement.tag, statement, "component").andThen(() => this.ElementParameters(statement.params)).andThen(() => this.NamedArguments(statement.args)).andThen(() => this.NamedBlocks(statement.blocks));
|
|
1433
1416
|
}
|
|
1434
1417
|
SimpleElement(statement) {
|
|
1435
1418
|
return this.ElementParameters(statement.params).andThen(() => this.Statements(statement.body));
|
|
1436
1419
|
}
|
|
1437
1420
|
InvokeBlock(statement) {
|
|
1438
|
-
return this.Expression(statement.head, statement.head,
|
|
1421
|
+
return this.Expression(statement.head, statement.head, "component").andThen(() => this.Args(statement.args)).andThen(() => this.NamedBlocks(statement.blocks));
|
|
1439
1422
|
}
|
|
1440
1423
|
If(statement) {
|
|
1441
1424
|
return this.Expression(statement.condition, statement).andThen(() => this.NamedBlock(statement.block)).andThen(() => statement.inverse ? this.NamedBlock(statement.inverse) : Ok(null));
|
|
@@ -1450,7 +1433,7 @@ class StrictModeValidationPass {
|
|
|
1450
1433
|
return this.NamedArguments(statement.named).andThen(() => this.NamedBlock(statement.block));
|
|
1451
1434
|
}
|
|
1452
1435
|
InvokeComponent(statement) {
|
|
1453
|
-
return this.Expression(statement.definition, statement,
|
|
1436
|
+
return this.Expression(statement.definition, statement, "component").andThen(() => this.Args(statement.args)).andThen(() => statement.blocks ? this.NamedBlocks(statement.blocks) : Ok(null));
|
|
1454
1437
|
}
|
|
1455
1438
|
InterpolateExpression(expression, span, resolution) {
|
|
1456
1439
|
let expressions = expression.parts.toArray();
|
|
@@ -1464,12 +1447,12 @@ class StrictModeValidationPass {
|
|
|
1464
1447
|
}
|
|
1465
1448
|
Curry(expression) {
|
|
1466
1449
|
let resolution;
|
|
1467
|
-
return resolution =
|
|
1450
|
+
return resolution = 0 === expression.curriedType ? "component" : 1 === expression.curriedType ? "helper" : "modifier", this.Expression(expression.definition, expression, resolution).andThen(() => this.Args(expression.args));
|
|
1468
1451
|
}
|
|
1469
1452
|
Log(expression) {
|
|
1470
1453
|
return this.Positional(expression.positional, expression);
|
|
1471
1454
|
}
|
|
1472
|
-
errorFor(name, span, type =
|
|
1455
|
+
errorFor(name, span, type = "value") {
|
|
1473
1456
|
return Err(generateSyntaxError(`Attempted to resolve a ${type} in a strict mode template, but that value was not in scope: ${name}`, loc(span)));
|
|
1474
1457
|
}
|
|
1475
1458
|
}
|
|
@@ -1551,7 +1534,7 @@ const EXPR = new class {
|
|
|
1551
1534
|
tail: tail
|
|
1552
1535
|
}) {
|
|
1553
1536
|
let getOp = EXPR.expr(head);
|
|
1554
|
-
return
|
|
1537
|
+
return getOp[0], opcodes.GetStrictKeyword, [...getOp, EXPR.Tail(tail)];
|
|
1555
1538
|
}
|
|
1556
1539
|
InterpolateExpression({
|
|
1557
1540
|
parts: parts
|
|
@@ -1597,7 +1580,7 @@ const EXPR = new class {
|
|
|
1597
1580
|
let [name, value] = EXPR.NamedArgument(pair);
|
|
1598
1581
|
names.push(name), values.push(value);
|
|
1599
1582
|
}
|
|
1600
|
-
return
|
|
1583
|
+
return [names, values];
|
|
1601
1584
|
}
|
|
1602
1585
|
return null;
|
|
1603
1586
|
}
|
|
@@ -1638,7 +1621,7 @@ const CONTENT = new class {
|
|
|
1638
1621
|
let out = [];
|
|
1639
1622
|
for (let statement of statements) {
|
|
1640
1623
|
let result = CONTENT.content(statement);
|
|
1641
|
-
result
|
|
1624
|
+
result instanceof WireStatements ? out.push(...result.toArray()) : out.push(result);
|
|
1642
1625
|
}
|
|
1643
1626
|
return out;
|
|
1644
1627
|
}
|
|
@@ -1648,7 +1631,7 @@ const CONTENT = new class {
|
|
|
1648
1631
|
visitContent(stmt) {
|
|
1649
1632
|
switch (stmt.type) {
|
|
1650
1633
|
case "Debugger":
|
|
1651
|
-
return [opcodes.Debugger, stmt.scope.getDebugInfo()];
|
|
1634
|
+
return [opcodes.Debugger, ...stmt.scope.getDebugInfo(), {}];
|
|
1652
1635
|
case "AppendComment":
|
|
1653
1636
|
return this.AppendComment(stmt);
|
|
1654
1637
|
case "AppendTextNode":
|
|
@@ -1676,7 +1659,7 @@ const CONTENT = new class {
|
|
|
1676
1659
|
case "InvokeComponent":
|
|
1677
1660
|
return this.InvokeComponent(stmt);
|
|
1678
1661
|
default:
|
|
1679
|
-
return
|
|
1662
|
+
return;
|
|
1680
1663
|
}
|
|
1681
1664
|
}
|
|
1682
1665
|
Yield({
|
|
@@ -1868,9 +1851,9 @@ const defaultId = (() => {
|
|
|
1868
1851
|
* @return {string} a template javascript string
|
|
1869
1852
|
*/
|
|
1870
1853
|
function precompileJSON(string, options = defaultOptions) {
|
|
1871
|
-
const source = new api$
|
|
1854
|
+
const source = new api$1.Source(string ?? "", options.meta?.moduleName),
|
|
1872
1855
|
[ast, locals] = normalize(source, {
|
|
1873
|
-
lexicalScope: () =>
|
|
1856
|
+
lexicalScope: () => false,
|
|
1874
1857
|
...options
|
|
1875
1858
|
}),
|
|
1876
1859
|
block = function (source, root, isStrict) {
|
|
@@ -1882,10 +1865,10 @@ function precompileJSON(string, options = defaultOptions) {
|
|
|
1882
1865
|
body: body.toArray()
|
|
1883
1866
|
}));
|
|
1884
1867
|
return isStrict && (template = template.andThen(template => StrictModeValidationPass.validate(template))), template;
|
|
1885
|
-
}(0, ast, options.strictMode ??
|
|
1868
|
+
}(0, ast, options.strictMode ?? false).mapOk(pass2In => function (template) {
|
|
1886
1869
|
let statements = CONTENT.list(template.body),
|
|
1887
1870
|
scope = template.scope;
|
|
1888
|
-
return [statements, scope.symbols, scope.
|
|
1871
|
+
return [statements, scope.symbols, scope.upvars];
|
|
1889
1872
|
}(pass2In));
|
|
1890
1873
|
if (block.isOk) return [block.value, locals];
|
|
1891
1874
|
throw block.reason;
|
|
@@ -1908,8 +1891,9 @@ function precompileJSON(string, options = defaultOptions) {
|
|
|
1908
1891
|
* @return {string} a template javascript string
|
|
1909
1892
|
*/
|
|
1910
1893
|
function precompile(source, options = defaultOptions) {
|
|
1911
|
-
const [block, usedLocals] = precompileJSON(source, options)
|
|
1912
|
-
|
|
1894
|
+
const [block, usedLocals] = precompileJSON(source, options);
|
|
1895
|
+
"emit" in options && options.emit?.debugSymbols && usedLocals.length > 0 && block.push(usedLocals);
|
|
1896
|
+
const moduleName = options.meta?.moduleName,
|
|
1913
1897
|
idFn = options.id || defaultId,
|
|
1914
1898
|
blockJSON = JSON.stringify(block),
|
|
1915
1899
|
templateJSONObject = {
|
|
@@ -1919,7 +1903,7 @@ function precompile(source, options = defaultOptions) {
|
|
|
1919
1903
|
// lying to the type checker here because we're going to
|
|
1920
1904
|
// replace it just below, after stringification
|
|
1921
1905
|
scope: "796d24e6-2450-4fb0-8cdf-b65638b5ef70",
|
|
1922
|
-
isStrictMode: options.strictMode ??
|
|
1906
|
+
isStrictMode: options.strictMode ?? false
|
|
1923
1907
|
};
|
|
1924
1908
|
0 === usedLocals.length && delete templateJSONObject.scope;
|
|
1925
1909
|
// JSON is javascript
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import '../../object/index.js';
|
|
2
2
|
import '../../-internals/meta/lib/meta.js';
|
|
3
|
-
import '../../../shared-chunks/mandatory-setter-
|
|
3
|
+
import '../../../shared-chunks/mandatory-setter-DzWEWEXy.js';
|
|
4
4
|
import '@embroider/macros';
|
|
5
5
|
import '../../debug/index.js';
|
|
6
6
|
import '../../../@glimmer/destroyable/index.js';
|
|
7
7
|
import '../../../@glimmer/validator/index.js';
|
|
8
8
|
import '../../../@glimmer/manager/index.js';
|
|
9
|
-
import { h as hasUnknownProperty, g as get } from '../../../shared-chunks/cache-
|
|
9
|
+
import { h as hasUnknownProperty, g as get } from '../../../shared-chunks/cache-DNQMcXNz.js';
|
|
10
10
|
import '../../../shared-chunks/env-CwR5CFCu.js';
|
|
11
11
|
|
|
12
12
|
/**
|