ember-source 4.0.0-beta.4 → 4.0.0-beta.8
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/CHANGELOG.md +32 -1
- package/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +1 -1
- package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
- package/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +3 -3
- package/blueprints/helper-test/index.js +4 -22
- package/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +1 -13
- package/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +0 -13
- package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -12
- package/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +2 -13
- package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -14
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +87 -421
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +32 -770
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +11 -3
- package/dist/packages/@ember/-internals/utils/index.js +0 -3
- package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -4
- package/dist/packages/@ember/application/lib/application.js +7 -8
- package/dist/packages/@ember/engine/index.js +1 -2
- package/dist/packages/@ember/object/lib/computed/computed_macros.js +0 -373
- package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +0 -351
- package/dist/packages/ember/index.js +7 -13
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +114 -138
- package/lib/index.js +11 -48
- package/package.json +17 -17
- package/dist/packages/jquery/index.js +0 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
|
7
7
|
* @license Licensed under MIT license
|
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
|
9
|
-
* @version 4.0.0-beta.
|
|
9
|
+
* @version 4.0.0-beta.8
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/* eslint-disable no-var */
|
|
@@ -506,9 +506,6 @@ define("@ember/-internals/utils/index", ["exports", "@glimmer/util", "@ember/deb
|
|
|
506
506
|
*/
|
|
507
507
|
|
|
508
508
|
/**
|
|
509
|
-
Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from
|
|
510
|
-
jQuery master. We'll just bootstrap our own uuid now.
|
|
511
|
-
|
|
512
509
|
@private
|
|
513
510
|
@return {Number} the uuid
|
|
514
511
|
*/
|
|
@@ -2539,25 +2536,6 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
2539
2536
|
|
|
2540
2537
|
}
|
|
2541
2538
|
|
|
2542
|
-
var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
2543
|
-
if (!privateMap.has(receiver)) {
|
|
2544
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
|
-
privateMap.set(receiver, value);
|
|
2548
|
-
return value;
|
|
2549
|
-
};
|
|
2550
|
-
|
|
2551
|
-
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
2552
|
-
if (!privateMap.has(receiver)) {
|
|
2553
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
2554
|
-
}
|
|
2555
|
-
|
|
2556
|
-
return privateMap.get(receiver);
|
|
2557
|
-
};
|
|
2558
|
-
|
|
2559
|
-
var _keywords, _type;
|
|
2560
|
-
|
|
2561
2539
|
class KeywordImpl {
|
|
2562
2540
|
constructor(keyword, type, delegate) {
|
|
2563
2541
|
this.keyword = keyword;
|
|
@@ -2646,21 +2624,18 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
2646
2624
|
|
|
2647
2625
|
class Keywords {
|
|
2648
2626
|
constructor(type) {
|
|
2649
|
-
_keywords
|
|
2650
|
-
|
|
2651
|
-
_type.set(this, void 0);
|
|
2652
|
-
|
|
2653
|
-
__classPrivateFieldSet(this, _type, type);
|
|
2627
|
+
this._keywords = [];
|
|
2628
|
+
this._type = type;
|
|
2654
2629
|
}
|
|
2655
2630
|
|
|
2656
2631
|
kw(name, delegate) {
|
|
2657
|
-
|
|
2632
|
+
this._keywords.push(keyword(name, this._type, delegate));
|
|
2658
2633
|
|
|
2659
2634
|
return this;
|
|
2660
2635
|
}
|
|
2661
2636
|
|
|
2662
2637
|
translate(node$$1, state) {
|
|
2663
|
-
for (var _keyword of
|
|
2638
|
+
for (var _keyword of this._keywords) {
|
|
2664
2639
|
var result = _keyword.translate(node$$1, state);
|
|
2665
2640
|
|
|
2666
2641
|
if (result !== null) {
|
|
@@ -2674,9 +2649,7 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
2674
2649
|
var {
|
|
2675
2650
|
name
|
|
2676
2651
|
} = path.ref;
|
|
2677
|
-
|
|
2678
|
-
var usedType = __classPrivateFieldGet(this, _type);
|
|
2679
|
-
|
|
2652
|
+
var usedType = this._type;
|
|
2680
2653
|
var validTypes = _syntax.KEYWORDS_TYPES[name];
|
|
2681
2654
|
|
|
2682
2655
|
if (validTypes.indexOf(usedType) === -1) {
|
|
@@ -2689,7 +2662,6 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
2689
2662
|
|
|
2690
2663
|
}
|
|
2691
2664
|
|
|
2692
|
-
_keywords = new WeakMap(), _type = new WeakMap();
|
|
2693
2665
|
var typesToReadableName = {
|
|
2694
2666
|
Append: 'an append statement',
|
|
2695
2667
|
Block: 'a block statement',
|
|
@@ -4272,66 +4244,37 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
4272
4244
|
}
|
|
4273
4245
|
|
|
4274
4246
|
var VISIT_STMTS = new NormalizationStatements();
|
|
4275
|
-
|
|
4276
|
-
var __classPrivateFieldSet$1 = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
4277
|
-
if (!privateMap.has(receiver)) {
|
|
4278
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
4279
|
-
}
|
|
4280
|
-
|
|
4281
|
-
privateMap.set(receiver, value);
|
|
4282
|
-
return value;
|
|
4283
|
-
};
|
|
4284
|
-
|
|
4285
|
-
var __classPrivateFieldGet$1 = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
4286
|
-
if (!privateMap.has(receiver)) {
|
|
4287
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
4288
|
-
}
|
|
4289
|
-
|
|
4290
|
-
return privateMap.get(receiver);
|
|
4291
|
-
};
|
|
4292
|
-
|
|
4293
|
-
var _currentScope, _cursorCount;
|
|
4294
4247
|
/**
|
|
4295
4248
|
* This is the mutable state for this compiler pass.
|
|
4296
4249
|
*/
|
|
4297
4250
|
|
|
4298
|
-
|
|
4299
4251
|
class NormalizationState {
|
|
4300
4252
|
constructor(block, isStrict) {
|
|
4301
4253
|
this.isStrict = isStrict;
|
|
4302
|
-
|
|
4303
|
-
_currentScope
|
|
4304
|
-
|
|
4305
|
-
_cursorCount.set(this, 0);
|
|
4306
|
-
|
|
4307
|
-
__classPrivateFieldSet$1(this, _currentScope, block);
|
|
4254
|
+
this._cursorCount = 0;
|
|
4255
|
+
this._currentScope = block;
|
|
4308
4256
|
}
|
|
4309
4257
|
|
|
4310
4258
|
generateUniqueCursor() {
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
return "%cursor:" + (__classPrivateFieldSet$1(this, _cursorCount, (_a = +__classPrivateFieldGet$1(this, _cursorCount)) + 1), _a) + "%";
|
|
4259
|
+
return "%cursor:" + this._cursorCount++ + "%";
|
|
4314
4260
|
}
|
|
4315
4261
|
|
|
4316
4262
|
get scope() {
|
|
4317
|
-
return
|
|
4263
|
+
return this._currentScope;
|
|
4318
4264
|
}
|
|
4319
4265
|
|
|
4320
4266
|
visitBlock(block) {
|
|
4321
|
-
var oldBlock =
|
|
4322
|
-
|
|
4323
|
-
__classPrivateFieldSet$1(this, _currentScope, block.scope);
|
|
4267
|
+
var oldBlock = this._currentScope;
|
|
4268
|
+
this._currentScope = block.scope;
|
|
4324
4269
|
|
|
4325
4270
|
try {
|
|
4326
4271
|
return VISIT_STMTS.visitList(block.body, this);
|
|
4327
4272
|
} finally {
|
|
4328
|
-
|
|
4273
|
+
this._currentScope = oldBlock;
|
|
4329
4274
|
}
|
|
4330
4275
|
}
|
|
4331
4276
|
|
|
4332
4277
|
}
|
|
4333
|
-
|
|
4334
|
-
_currentScope = new WeakMap(), _cursorCount = new WeakMap();
|
|
4335
4278
|
/**
|
|
4336
4279
|
* Normalize the AST from @glimmer/syntax into the HIR. The HIR has special
|
|
4337
4280
|
* instructions for keywords like `{{yield}}`, `(has-block)` and
|
|
@@ -4371,6 +4314,7 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
4371
4314
|
* ```
|
|
4372
4315
|
*/
|
|
4373
4316
|
|
|
4317
|
+
|
|
4374
4318
|
function normalize$1(source, root, isStrict) {
|
|
4375
4319
|
// create a new context for the normalization pass
|
|
4376
4320
|
var state = new NormalizationState(root.table, isStrict);
|
|
@@ -5446,18 +5390,16 @@ define("@glimmer/compiler", ["exports", "@glimmer/syntax", "@glimmer/util"], fun
|
|
|
5446
5390
|
isStrictMode: (_b = options.strictMode) !== null && _b !== void 0 ? _b : false
|
|
5447
5391
|
};
|
|
5448
5392
|
|
|
5449
|
-
if (
|
|
5393
|
+
if (usedLocals.length === 0) {
|
|
5450
5394
|
delete templateJSONObject.scope;
|
|
5451
5395
|
} // JSON is javascript
|
|
5452
5396
|
|
|
5453
5397
|
|
|
5454
5398
|
var stringified = JSON.stringify(templateJSONObject);
|
|
5455
5399
|
|
|
5456
|
-
if (
|
|
5400
|
+
if (usedLocals.length > 0) {
|
|
5457
5401
|
var scopeFn = "()=>[" + usedLocals.join(',') + "]";
|
|
5458
5402
|
stringified = stringified.replace("\"" + SCOPE_PLACEHOLDER + "\"", scopeFn);
|
|
5459
|
-
} else {
|
|
5460
|
-
stringified = stringified.replace("\"" + SCOPE_PLACEHOLDER + "\"", 'null');
|
|
5461
5403
|
}
|
|
5462
5404
|
|
|
5463
5405
|
return stringified;
|
|
@@ -7084,27 +7026,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7084
7026
|
}
|
|
7085
7027
|
|
|
7086
7028
|
}
|
|
7087
|
-
|
|
7088
|
-
_exports.SourceSlice = SourceSlice;
|
|
7089
|
-
|
|
7090
|
-
var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
7091
|
-
if (!privateMap.has(receiver)) {
|
|
7092
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
7093
|
-
}
|
|
7094
|
-
|
|
7095
|
-
privateMap.set(receiver, value);
|
|
7096
|
-
return value;
|
|
7097
|
-
};
|
|
7098
|
-
|
|
7099
|
-
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
7100
|
-
if (!privateMap.has(receiver)) {
|
|
7101
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
7102
|
-
}
|
|
7103
|
-
|
|
7104
|
-
return privateMap.get(receiver);
|
|
7105
|
-
};
|
|
7106
|
-
|
|
7107
|
-
var _whens, _map, _whens_1;
|
|
7108
7029
|
/**
|
|
7109
7030
|
* This file implements the DSL used by span and offset in places where they need to exhaustively
|
|
7110
7031
|
* consider all combinations of states (Handlebars offsets, character offsets and invisible/broken
|
|
@@ -7115,18 +7036,17 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7115
7036
|
*/
|
|
7116
7037
|
|
|
7117
7038
|
|
|
7039
|
+
_exports.SourceSlice = SourceSlice;
|
|
7118
7040
|
var MatchAny = 'MATCH_ANY';
|
|
7119
7041
|
var IsInvisible = 'IS_INVISIBLE';
|
|
7120
7042
|
|
|
7121
7043
|
class WhenList {
|
|
7122
7044
|
constructor(whens) {
|
|
7123
|
-
_whens
|
|
7124
|
-
|
|
7125
|
-
__classPrivateFieldSet(this, _whens, whens);
|
|
7045
|
+
this._whens = whens;
|
|
7126
7046
|
}
|
|
7127
7047
|
|
|
7128
7048
|
first(kind) {
|
|
7129
|
-
for (var when of
|
|
7049
|
+
for (var when of this._whens) {
|
|
7130
7050
|
var value = when.match(kind);
|
|
7131
7051
|
|
|
7132
7052
|
if ((0, _util.isPresent)(value)) {
|
|
@@ -7139,15 +7059,13 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7139
7059
|
|
|
7140
7060
|
}
|
|
7141
7061
|
|
|
7142
|
-
_whens = new WeakMap();
|
|
7143
|
-
|
|
7144
7062
|
class When {
|
|
7145
7063
|
constructor() {
|
|
7146
|
-
_map
|
|
7064
|
+
this._map = new Map();
|
|
7147
7065
|
}
|
|
7148
7066
|
|
|
7149
7067
|
get(pattern, or) {
|
|
7150
|
-
var value =
|
|
7068
|
+
var value = this._map.get(pattern);
|
|
7151
7069
|
|
|
7152
7070
|
if (value) {
|
|
7153
7071
|
return value;
|
|
@@ -7155,22 +7073,22 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7155
7073
|
|
|
7156
7074
|
value = or();
|
|
7157
7075
|
|
|
7158
|
-
|
|
7076
|
+
this._map.set(pattern, value);
|
|
7159
7077
|
|
|
7160
7078
|
return value;
|
|
7161
7079
|
}
|
|
7162
7080
|
|
|
7163
7081
|
add(pattern, out) {
|
|
7164
|
-
|
|
7082
|
+
this._map.set(pattern, out);
|
|
7165
7083
|
}
|
|
7166
7084
|
|
|
7167
7085
|
match(kind) {
|
|
7168
7086
|
var pattern = patternFor(kind);
|
|
7169
7087
|
var out = [];
|
|
7170
7088
|
|
|
7171
|
-
var exact =
|
|
7089
|
+
var exact = this._map.get(pattern);
|
|
7172
7090
|
|
|
7173
|
-
var fallback =
|
|
7091
|
+
var fallback = this._map.get(MatchAny);
|
|
7174
7092
|
|
|
7175
7093
|
if (exact) {
|
|
7176
7094
|
out.push(exact);
|
|
@@ -7185,15 +7103,13 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7185
7103
|
|
|
7186
7104
|
}
|
|
7187
7105
|
|
|
7188
|
-
_map = new WeakMap();
|
|
7189
|
-
|
|
7190
7106
|
function match(callback) {
|
|
7191
7107
|
return callback(new Matcher()).check();
|
|
7192
7108
|
}
|
|
7193
7109
|
|
|
7194
7110
|
class Matcher {
|
|
7195
7111
|
constructor() {
|
|
7196
|
-
|
|
7112
|
+
this._whens = new When();
|
|
7197
7113
|
}
|
|
7198
7114
|
/**
|
|
7199
7115
|
* You didn't exhaustively match all possibilities.
|
|
@@ -7205,7 +7121,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7205
7121
|
}
|
|
7206
7122
|
|
|
7207
7123
|
matchFor(left, right) {
|
|
7208
|
-
var nesteds =
|
|
7124
|
+
var nesteds = this._whens.match(left);
|
|
7209
7125
|
|
|
7210
7126
|
var callback = new WhenList(nesteds).first(right);
|
|
7211
7127
|
return callback;
|
|
@@ -7213,15 +7129,13 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7213
7129
|
|
|
7214
7130
|
when(left, right, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7215
7131
|
callback) {
|
|
7216
|
-
|
|
7132
|
+
this._whens.get(left, () => new When()).add(right, callback);
|
|
7217
7133
|
|
|
7218
7134
|
return this;
|
|
7219
7135
|
}
|
|
7220
7136
|
|
|
7221
7137
|
}
|
|
7222
7138
|
|
|
7223
|
-
_whens_1 = new WeakMap();
|
|
7224
|
-
|
|
7225
7139
|
function patternFor(kind) {
|
|
7226
7140
|
switch (kind) {
|
|
7227
7141
|
case "Broken"
|
|
@@ -7238,26 +7152,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7238
7152
|
default:
|
|
7239
7153
|
return kind;
|
|
7240
7154
|
}
|
|
7241
|
-
}
|
|
7242
|
-
|
|
7243
|
-
var __classPrivateFieldGet$1 = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
7244
|
-
if (!privateMap.has(receiver)) {
|
|
7245
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
7246
|
-
}
|
|
7247
|
-
|
|
7248
|
-
return privateMap.get(receiver);
|
|
7249
|
-
};
|
|
7250
|
-
|
|
7251
|
-
var __classPrivateFieldSet$1 = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
7252
|
-
if (!privateMap.has(receiver)) {
|
|
7253
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
7254
|
-
}
|
|
7255
|
-
|
|
7256
|
-
privateMap.set(receiver, value);
|
|
7257
|
-
return value;
|
|
7258
|
-
};
|
|
7259
|
-
|
|
7260
|
-
var _locPos, _charPos; // eslint-disable-next-line import/no-extraneous-dependencies
|
|
7155
|
+
} // eslint-disable-next-line import/no-extraneous-dependencies
|
|
7261
7156
|
|
|
7262
7157
|
/**
|
|
7263
7158
|
* Used to indicate that an attempt to convert a `SourcePosition` to a character offset failed. It
|
|
@@ -7392,7 +7287,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7392
7287
|
;
|
|
7393
7288
|
/** Computed from char offset */
|
|
7394
7289
|
|
|
7395
|
-
_locPos
|
|
7290
|
+
this._locPos = null;
|
|
7396
7291
|
}
|
|
7397
7292
|
/**
|
|
7398
7293
|
* This is already a `CharPosition`.
|
|
@@ -7439,15 +7334,15 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7439
7334
|
|
|
7440
7335
|
|
|
7441
7336
|
toHbsPos() {
|
|
7442
|
-
var locPos =
|
|
7337
|
+
var locPos = this._locPos;
|
|
7443
7338
|
|
|
7444
7339
|
if (locPos === null) {
|
|
7445
7340
|
var hbsPos = this.source.hbsPosFor(this.charPos);
|
|
7446
7341
|
|
|
7447
7342
|
if (hbsPos === null) {
|
|
7448
|
-
|
|
7343
|
+
this._locPos = locPos = BROKEN;
|
|
7449
7344
|
} else {
|
|
7450
|
-
|
|
7345
|
+
this._locPos = locPos = new HbsPosition(this.source, hbsPos, this.charPos);
|
|
7451
7346
|
}
|
|
7452
7347
|
}
|
|
7453
7348
|
|
|
@@ -7456,8 +7351,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7456
7351
|
|
|
7457
7352
|
}
|
|
7458
7353
|
|
|
7459
|
-
_locPos = new WeakMap();
|
|
7460
|
-
|
|
7461
7354
|
class HbsPosition {
|
|
7462
7355
|
constructor(source, hbsPos, charPos = null) {
|
|
7463
7356
|
this.source = source;
|
|
@@ -7465,10 +7358,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7465
7358
|
this.kind = "HbsPosition"
|
|
7466
7359
|
/* HbsPosition */
|
|
7467
7360
|
;
|
|
7468
|
-
|
|
7469
|
-
_charPos.set(this, void 0);
|
|
7470
|
-
|
|
7471
|
-
__classPrivateFieldSet$1(this, _charPos, charPos === null ? null : new CharPosition(source, charPos));
|
|
7361
|
+
this._charPos = charPos === null ? null : new CharPosition(source, charPos);
|
|
7472
7362
|
}
|
|
7473
7363
|
/**
|
|
7474
7364
|
* Lazily compute the character offset from the {@see SourcePosition}. Once an `HbsPosition` has
|
|
@@ -7481,15 +7371,15 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7481
7371
|
|
|
7482
7372
|
|
|
7483
7373
|
toCharPos() {
|
|
7484
|
-
var charPos =
|
|
7374
|
+
var charPos = this._charPos;
|
|
7485
7375
|
|
|
7486
7376
|
if (charPos === null) {
|
|
7487
7377
|
var charPosNumber = this.source.charPosFor(this.hbsPos);
|
|
7488
7378
|
|
|
7489
7379
|
if (charPosNumber === null) {
|
|
7490
|
-
|
|
7380
|
+
this._charPos = charPos = BROKEN;
|
|
7491
7381
|
} else {
|
|
7492
|
-
|
|
7382
|
+
this._charPos = charPos = new CharPosition(this.source, charPosNumber);
|
|
7493
7383
|
}
|
|
7494
7384
|
}
|
|
7495
7385
|
|
|
@@ -7523,8 +7413,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7523
7413
|
|
|
7524
7414
|
}
|
|
7525
7415
|
|
|
7526
|
-
_charPos = new WeakMap();
|
|
7527
|
-
|
|
7528
7416
|
class InvisiblePosition {
|
|
7529
7417
|
constructor(kind, // whatever was provided, possibly broken
|
|
7530
7418
|
pos) {
|
|
@@ -7604,26 +7492,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7604
7492
|
var _a;
|
|
7605
7493
|
|
|
7606
7494
|
return ((_a = left.toCharPos()) === null || _a === void 0 ? void 0 : _a.offset) === right;
|
|
7607
|
-
}).when(MatchAny, MatchAny, () => false));
|
|
7608
|
-
|
|
7609
|
-
var __classPrivateFieldGet$2 = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
7610
|
-
if (!privateMap.has(receiver)) {
|
|
7611
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
7612
|
-
}
|
|
7613
|
-
|
|
7614
|
-
return privateMap.get(receiver);
|
|
7615
|
-
};
|
|
7616
|
-
|
|
7617
|
-
var __classPrivateFieldSet$2 = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
7618
|
-
if (!privateMap.has(receiver)) {
|
|
7619
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
7620
|
-
}
|
|
7621
|
-
|
|
7622
|
-
privateMap.set(receiver, value);
|
|
7623
|
-
return value;
|
|
7624
|
-
};
|
|
7625
|
-
|
|
7626
|
-
var _locPosSpan, _charPosSpan, _providedHbsLoc; // eslint-disable-next-line import/no-extraneous-dependencies
|
|
7495
|
+
}).when(MatchAny, MatchAny, () => false)); // eslint-disable-next-line import/no-extraneous-dependencies
|
|
7627
7496
|
|
|
7628
7497
|
/**
|
|
7629
7498
|
* A `SourceSpan` object represents a span of characters inside of a template source.
|
|
@@ -7660,7 +7529,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7660
7529
|
* The goal is to avoid creating any problems for use-cases like AST Explorer.
|
|
7661
7530
|
*/
|
|
7662
7531
|
|
|
7663
|
-
|
|
7664
7532
|
class SourceSpan {
|
|
7665
7533
|
constructor(data) {
|
|
7666
7534
|
this.data = data;
|
|
@@ -7916,8 +7784,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7916
7784
|
this.kind = "CharPosition"
|
|
7917
7785
|
/* CharPosition */
|
|
7918
7786
|
;
|
|
7919
|
-
|
|
7920
|
-
_locPosSpan.set(this, null);
|
|
7787
|
+
this._locPosSpan = null;
|
|
7921
7788
|
}
|
|
7922
7789
|
|
|
7923
7790
|
wrap() {
|
|
@@ -7943,19 +7810,19 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7943
7810
|
locDidUpdate() {}
|
|
7944
7811
|
|
|
7945
7812
|
toHbsSpan() {
|
|
7946
|
-
var locPosSpan =
|
|
7813
|
+
var locPosSpan = this._locPosSpan;
|
|
7947
7814
|
|
|
7948
7815
|
if (locPosSpan === null) {
|
|
7949
7816
|
var start = this.charPositions.start.toHbsPos();
|
|
7950
7817
|
var end = this.charPositions.end.toHbsPos();
|
|
7951
7818
|
|
|
7952
7819
|
if (start === null || end === null) {
|
|
7953
|
-
locPosSpan =
|
|
7820
|
+
locPosSpan = this._locPosSpan = BROKEN;
|
|
7954
7821
|
} else {
|
|
7955
|
-
locPosSpan =
|
|
7822
|
+
locPosSpan = this._locPosSpan = new HbsSpan(this.source, {
|
|
7956
7823
|
start,
|
|
7957
7824
|
end
|
|
7958
|
-
})
|
|
7825
|
+
});
|
|
7959
7826
|
}
|
|
7960
7827
|
}
|
|
7961
7828
|
|
|
@@ -7985,8 +7852,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7985
7852
|
|
|
7986
7853
|
}
|
|
7987
7854
|
|
|
7988
|
-
_locPosSpan = new WeakMap();
|
|
7989
|
-
|
|
7990
7855
|
class HbsSpan {
|
|
7991
7856
|
constructor(source, hbsPositions, providedHbsLoc = null) {
|
|
7992
7857
|
this.source = source;
|
|
@@ -7994,13 +7859,8 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
7994
7859
|
this.kind = "HbsPosition"
|
|
7995
7860
|
/* HbsPosition */
|
|
7996
7861
|
;
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
_providedHbsLoc.set(this, void 0);
|
|
8002
|
-
|
|
8003
|
-
__classPrivateFieldSet$2(this, _providedHbsLoc, providedHbsLoc);
|
|
7862
|
+
this._charPosSpan = null;
|
|
7863
|
+
this._providedHbsLoc = providedHbsLoc;
|
|
8004
7864
|
}
|
|
8005
7865
|
|
|
8006
7866
|
serialize() {
|
|
@@ -8015,17 +7875,16 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
8015
7875
|
}
|
|
8016
7876
|
|
|
8017
7877
|
updateProvided(pos, edge) {
|
|
8018
|
-
if (
|
|
8019
|
-
|
|
7878
|
+
if (this._providedHbsLoc) {
|
|
7879
|
+
this._providedHbsLoc[edge] = pos;
|
|
8020
7880
|
} // invalidate computed character offsets
|
|
8021
7881
|
|
|
8022
7882
|
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
__classPrivateFieldSet$2(this, _providedHbsLoc, {
|
|
7883
|
+
this._charPosSpan = null;
|
|
7884
|
+
this._providedHbsLoc = {
|
|
8026
7885
|
start: pos,
|
|
8027
7886
|
end: pos
|
|
8028
|
-
}
|
|
7887
|
+
};
|
|
8029
7888
|
}
|
|
8030
7889
|
|
|
8031
7890
|
locDidUpdate({
|
|
@@ -8072,19 +7931,19 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
8072
7931
|
}
|
|
8073
7932
|
|
|
8074
7933
|
toCharPosSpan() {
|
|
8075
|
-
var charPosSpan =
|
|
7934
|
+
var charPosSpan = this._charPosSpan;
|
|
8076
7935
|
|
|
8077
7936
|
if (charPosSpan === null) {
|
|
8078
7937
|
var start = this.hbsPositions.start.toCharPos();
|
|
8079
7938
|
var end = this.hbsPositions.end.toCharPos();
|
|
8080
7939
|
|
|
8081
7940
|
if (start && end) {
|
|
8082
|
-
charPosSpan =
|
|
7941
|
+
charPosSpan = this._charPosSpan = new CharPositionSpan(this.source, {
|
|
8083
7942
|
start,
|
|
8084
7943
|
end
|
|
8085
|
-
})
|
|
7944
|
+
});
|
|
8086
7945
|
} else {
|
|
8087
|
-
charPosSpan =
|
|
7946
|
+
charPosSpan = this._charPosSpan = BROKEN;
|
|
8088
7947
|
return null;
|
|
8089
7948
|
}
|
|
8090
7949
|
}
|
|
@@ -8094,8 +7953,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
8094
7953
|
|
|
8095
7954
|
}
|
|
8096
7955
|
|
|
8097
|
-
_charPosSpan = new WeakMap(), _providedHbsLoc = new WeakMap();
|
|
8098
|
-
|
|
8099
7956
|
class InvisibleSpan {
|
|
8100
7957
|
constructor(kind, // whatever was provided, possibly broken
|
|
8101
7958
|
loc, // if the span represents a synthetic string
|
|
@@ -8322,7 +8179,9 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
8322
8179
|
this.loc = loc;
|
|
8323
8180
|
this.type = 'PathExpression';
|
|
8324
8181
|
this.this = false;
|
|
8325
|
-
this.data = false;
|
|
8182
|
+
this.data = false; // Cache for the head value.
|
|
8183
|
+
|
|
8184
|
+
this._head = undefined;
|
|
8326
8185
|
var parts = tail.slice();
|
|
8327
8186
|
|
|
8328
8187
|
if (head.type === 'ThisHead') {
|
|
@@ -8338,6 +8197,10 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
8338
8197
|
}
|
|
8339
8198
|
|
|
8340
8199
|
get head() {
|
|
8200
|
+
if (this._head) {
|
|
8201
|
+
return this._head;
|
|
8202
|
+
}
|
|
8203
|
+
|
|
8341
8204
|
var firstPart;
|
|
8342
8205
|
|
|
8343
8206
|
if (this.this) {
|
|
@@ -8351,7 +8214,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
8351
8214
|
var firstPartLoc = this.loc.collapse('start').sliceStartChars({
|
|
8352
8215
|
chars: firstPart.length
|
|
8353
8216
|
}).loc;
|
|
8354
|
-
return publicBuilder.head(firstPart, firstPartLoc);
|
|
8217
|
+
return this._head = publicBuilder.head(firstPart, firstPartLoc);
|
|
8355
8218
|
}
|
|
8356
8219
|
|
|
8357
8220
|
get tail() {
|
|
@@ -9110,8 +8973,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
9110
8973
|
return class {
|
|
9111
8974
|
constructor(fields) {
|
|
9112
8975
|
this.type = type;
|
|
9113
|
-
this
|
|
9114
|
-
copy(fields, this);
|
|
8976
|
+
(0, _util.assign)(this, fields);
|
|
9115
8977
|
}
|
|
9116
8978
|
|
|
9117
8979
|
};
|
|
@@ -9123,8 +8985,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
9123
8985
|
fields() {
|
|
9124
8986
|
return class {
|
|
9125
8987
|
constructor(fields) {
|
|
9126
|
-
this
|
|
9127
|
-
copy(fields, this);
|
|
8988
|
+
(0, _util.assign)(this, fields);
|
|
9128
8989
|
}
|
|
9129
8990
|
|
|
9130
8991
|
};
|
|
@@ -9133,16 +8994,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
9133
8994
|
};
|
|
9134
8995
|
}
|
|
9135
8996
|
}
|
|
9136
|
-
|
|
9137
|
-
function keys(object) {
|
|
9138
|
-
return Object.keys(object);
|
|
9139
|
-
}
|
|
9140
|
-
|
|
9141
|
-
function copy(object1, object2) {
|
|
9142
|
-
for (var key of keys(object1)) {
|
|
9143
|
-
object2[key] = object1[key];
|
|
9144
|
-
}
|
|
9145
|
-
}
|
|
9146
8997
|
/**
|
|
9147
8998
|
* Corresponds to syntaxes with positional and named arguments:
|
|
9148
8999
|
*
|
|
@@ -9302,30 +9153,9 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
9302
9153
|
|
|
9303
9154
|
class ElementModifier extends node('ElementModifier').fields() {}
|
|
9304
9155
|
|
|
9305
|
-
var __classPrivateFieldSet$3 = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
9306
|
-
if (!privateMap.has(receiver)) {
|
|
9307
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
9308
|
-
}
|
|
9309
|
-
|
|
9310
|
-
privateMap.set(receiver, value);
|
|
9311
|
-
return value;
|
|
9312
|
-
};
|
|
9313
|
-
|
|
9314
|
-
var __classPrivateFieldGet$3 = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
9315
|
-
if (!privateMap.has(receiver)) {
|
|
9316
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
9317
|
-
}
|
|
9318
|
-
|
|
9319
|
-
return privateMap.get(receiver);
|
|
9320
|
-
};
|
|
9321
|
-
|
|
9322
|
-
var _span;
|
|
9323
|
-
|
|
9324
9156
|
class SpanList {
|
|
9325
9157
|
constructor(span = []) {
|
|
9326
|
-
_span
|
|
9327
|
-
|
|
9328
|
-
__classPrivateFieldSet$3(this, _span, span);
|
|
9158
|
+
this._span = span;
|
|
9329
9159
|
}
|
|
9330
9160
|
|
|
9331
9161
|
static range(span, fallback = SourceSpan.NON_EXISTENT) {
|
|
@@ -9333,17 +9163,15 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
9333
9163
|
}
|
|
9334
9164
|
|
|
9335
9165
|
add(offset) {
|
|
9336
|
-
|
|
9166
|
+
this._span.push(offset);
|
|
9337
9167
|
}
|
|
9338
9168
|
|
|
9339
9169
|
getRangeOffset(fallback) {
|
|
9340
|
-
if (
|
|
9170
|
+
if (this._span.length === 0) {
|
|
9341
9171
|
return fallback;
|
|
9342
9172
|
} else {
|
|
9343
|
-
var first =
|
|
9344
|
-
|
|
9345
|
-
var last = __classPrivateFieldGet$3(this, _span)[__classPrivateFieldGet$3(this, _span).length - 1];
|
|
9346
|
-
|
|
9173
|
+
var first = this._span[0];
|
|
9174
|
+
var last = this._span[this._span.length - 1];
|
|
9347
9175
|
return first.extend(last);
|
|
9348
9176
|
}
|
|
9349
9177
|
}
|
|
@@ -9351,7 +9179,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
9351
9179
|
}
|
|
9352
9180
|
|
|
9353
9181
|
_exports.SpanList = SpanList;
|
|
9354
|
-
_span = new WeakMap();
|
|
9355
9182
|
|
|
9356
9183
|
function loc(span) {
|
|
9357
9184
|
if (Array.isArray(span)) {
|
|
@@ -10343,160 +10170,11 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
10343
10170
|
return new TraversalError('Replacing and removing in key handlers is not yet supported.', node, null, key);
|
|
10344
10171
|
}
|
|
10345
10172
|
|
|
10346
|
-
function getLocalName(node) {
|
|
10347
|
-
switch (node.type) {
|
|
10348
|
-
case 'ElementNode':
|
|
10349
|
-
// unfortunately the ElementNode stores `tag` as a string
|
|
10350
|
-
// if that changes in glimmer-vm this will need to be updated
|
|
10351
|
-
return node.tag.split('.')[0];
|
|
10352
|
-
|
|
10353
|
-
case 'SubExpression':
|
|
10354
|
-
case 'MustacheStatement':
|
|
10355
|
-
case 'BlockStatement':
|
|
10356
|
-
return getLocalName(node.path);
|
|
10357
|
-
|
|
10358
|
-
case 'UndefinedLiteral':
|
|
10359
|
-
case 'NullLiteral':
|
|
10360
|
-
case 'BooleanLiteral':
|
|
10361
|
-
case 'StringLiteral':
|
|
10362
|
-
case 'NumberLiteral':
|
|
10363
|
-
case 'TextNode':
|
|
10364
|
-
case 'Template':
|
|
10365
|
-
case 'Block':
|
|
10366
|
-
case 'CommentStatement':
|
|
10367
|
-
case 'MustacheCommentStatement':
|
|
10368
|
-
case 'PartialStatement':
|
|
10369
|
-
case 'ElementModifierStatement':
|
|
10370
|
-
case 'AttrNode':
|
|
10371
|
-
case 'ConcatStatement':
|
|
10372
|
-
case 'Program':
|
|
10373
|
-
case 'Hash':
|
|
10374
|
-
case 'HashPair':
|
|
10375
|
-
return undefined;
|
|
10376
|
-
|
|
10377
|
-
case 'PathExpression':
|
|
10378
|
-
default:
|
|
10379
|
-
return node.parts.length ? node.parts[0] : undefined;
|
|
10380
|
-
}
|
|
10381
|
-
}
|
|
10382
|
-
|
|
10383
|
-
function getLocals(node) {
|
|
10384
|
-
switch (node.type) {
|
|
10385
|
-
case 'ElementNode':
|
|
10386
|
-
case 'Program':
|
|
10387
|
-
case 'Block':
|
|
10388
|
-
case 'Template':
|
|
10389
|
-
return node.blockParams;
|
|
10390
|
-
|
|
10391
|
-
case 'BlockStatement':
|
|
10392
|
-
return node.program.blockParams;
|
|
10393
|
-
|
|
10394
|
-
default:
|
|
10395
|
-
return undefined;
|
|
10396
|
-
}
|
|
10397
|
-
}
|
|
10398
|
-
|
|
10399
|
-
class TransformScope {
|
|
10400
|
-
constructor(locals) {
|
|
10401
|
-
this.locals = locals;
|
|
10402
|
-
this.hasPartial = false;
|
|
10403
|
-
this.usedLocals = {};
|
|
10404
|
-
|
|
10405
|
-
for (var local of locals) {
|
|
10406
|
-
this.usedLocals[local] = false;
|
|
10407
|
-
}
|
|
10408
|
-
}
|
|
10409
|
-
|
|
10410
|
-
child(node) {
|
|
10411
|
-
var locals = getLocals(node);
|
|
10412
|
-
return locals ? new ChildTransformScope(locals, this) : this;
|
|
10413
|
-
}
|
|
10414
|
-
|
|
10415
|
-
usePartial() {
|
|
10416
|
-
this.hasPartial = true;
|
|
10417
|
-
}
|
|
10418
|
-
|
|
10419
|
-
}
|
|
10420
|
-
|
|
10421
|
-
class RootTransformScope extends TransformScope {
|
|
10422
|
-
constructor(node) {
|
|
10423
|
-
var _a;
|
|
10424
|
-
|
|
10425
|
-
var locals = (_a = getLocals(node)) !== null && _a !== void 0 ? _a : [];
|
|
10426
|
-
super(locals);
|
|
10427
|
-
}
|
|
10428
|
-
|
|
10429
|
-
useLocal(node) {
|
|
10430
|
-
var name = getLocalName(node);
|
|
10431
|
-
|
|
10432
|
-
if (name && name in this.usedLocals) {
|
|
10433
|
-
this.usedLocals[name] = true;
|
|
10434
|
-
}
|
|
10435
|
-
}
|
|
10436
|
-
|
|
10437
|
-
isLocal(name) {
|
|
10438
|
-
return this.locals.indexOf(name) !== -1;
|
|
10439
|
-
}
|
|
10440
|
-
|
|
10441
|
-
currentUnusedLocals() {
|
|
10442
|
-
if (!this.hasPartial && this.locals.length > 0) {
|
|
10443
|
-
return this.locals.filter(local => !this.usedLocals[local]);
|
|
10444
|
-
}
|
|
10445
|
-
|
|
10446
|
-
return false;
|
|
10447
|
-
}
|
|
10448
|
-
|
|
10449
|
-
}
|
|
10450
|
-
|
|
10451
|
-
class ChildTransformScope extends TransformScope {
|
|
10452
|
-
constructor(locals, parent) {
|
|
10453
|
-
super(locals);
|
|
10454
|
-
this.parent = parent;
|
|
10455
|
-
}
|
|
10456
|
-
|
|
10457
|
-
useLocal(node) {
|
|
10458
|
-
var name = getLocalName(node);
|
|
10459
|
-
|
|
10460
|
-
if (name && name in this.usedLocals) {
|
|
10461
|
-
this.usedLocals[name] = true;
|
|
10462
|
-
} else {
|
|
10463
|
-
this.parent.useLocal(node);
|
|
10464
|
-
}
|
|
10465
|
-
}
|
|
10466
|
-
|
|
10467
|
-
isLocal(name) {
|
|
10468
|
-
return this.locals.indexOf(name) !== -1 || this.parent.isLocal(name);
|
|
10469
|
-
}
|
|
10470
|
-
|
|
10471
|
-
currentUnusedLocals() {
|
|
10472
|
-
if (!this.hasPartial && this.locals.length > 0) {
|
|
10473
|
-
// We only care about the last local, because if it is used then it implies
|
|
10474
|
-
// usage of the others (specifically when in a child block, |foo bar|)
|
|
10475
|
-
if (!this.usedLocals[this.locals[this.locals.length - 1]]) {
|
|
10476
|
-
return [this.locals[this.locals.length - 1]];
|
|
10477
|
-
}
|
|
10478
|
-
}
|
|
10479
|
-
|
|
10480
|
-
return false;
|
|
10481
|
-
}
|
|
10482
|
-
|
|
10483
|
-
}
|
|
10484
|
-
|
|
10485
10173
|
class WalkerPath {
|
|
10486
10174
|
constructor(node, parent = null, parentKey = null) {
|
|
10487
10175
|
this.node = node;
|
|
10488
10176
|
this.parent = parent;
|
|
10489
10177
|
this.parentKey = parentKey;
|
|
10490
|
-
this.scope = parent ? parent.scope.child(node) : new RootTransformScope(node); // Consume in scope values
|
|
10491
|
-
|
|
10492
|
-
if (node.type === 'PathExpression') {
|
|
10493
|
-
this.scope.useLocal(node);
|
|
10494
|
-
}
|
|
10495
|
-
|
|
10496
|
-
if (node.type === 'ElementNode') {
|
|
10497
|
-
this.scope.useLocal(node);
|
|
10498
|
-
node.children.forEach(node => this.scope.useLocal(node));
|
|
10499
|
-
}
|
|
10500
10178
|
}
|
|
10501
10179
|
|
|
10502
10180
|
get parentNode() {
|
|
@@ -10616,10 +10294,10 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
10616
10294
|
}
|
|
10617
10295
|
|
|
10618
10296
|
if (result === undefined) {
|
|
10619
|
-
var
|
|
10297
|
+
var keys = visitorKeys[node.type];
|
|
10620
10298
|
|
|
10621
|
-
for (var i = 0; i <
|
|
10622
|
-
var key =
|
|
10299
|
+
for (var i = 0; i < keys.length; i++) {
|
|
10300
|
+
var key = keys[i]; // we know if it has child keys we can widen to a ParentNode
|
|
10623
10301
|
|
|
10624
10302
|
visitKey(visitor, handler, path, key);
|
|
10625
10303
|
}
|
|
@@ -12249,25 +11927,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
12249
11927
|
return program;
|
|
12250
11928
|
}
|
|
12251
11929
|
|
|
12252
|
-
var __classPrivateFieldSet$4 = undefined && undefined.__classPrivateFieldSet || function (receiver, privateMap, value) {
|
|
12253
|
-
if (!privateMap.has(receiver)) {
|
|
12254
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
12255
|
-
}
|
|
12256
|
-
|
|
12257
|
-
privateMap.set(receiver, value);
|
|
12258
|
-
return value;
|
|
12259
|
-
};
|
|
12260
|
-
|
|
12261
|
-
var __classPrivateFieldGet$4 = undefined && undefined.__classPrivateFieldGet || function (receiver, privateMap) {
|
|
12262
|
-
if (!privateMap.has(receiver)) {
|
|
12263
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
12264
|
-
}
|
|
12265
|
-
|
|
12266
|
-
return privateMap.get(receiver);
|
|
12267
|
-
};
|
|
12268
|
-
|
|
12269
|
-
var _hasEval;
|
|
12270
|
-
|
|
12271
11930
|
class SymbolTable {
|
|
12272
11931
|
static top(locals, customizeComponentName) {
|
|
12273
11932
|
return new ProgramSymbolTable(locals, customizeComponentName);
|
|
@@ -12293,8 +11952,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
12293
11952
|
this.named = (0, _util.dict)();
|
|
12294
11953
|
this.blocks = (0, _util.dict)();
|
|
12295
11954
|
this.usedTemplateLocals = [];
|
|
12296
|
-
|
|
12297
|
-
_hasEval.set(this, false);
|
|
11955
|
+
this._hasEval = false;
|
|
12298
11956
|
}
|
|
12299
11957
|
|
|
12300
11958
|
getUsedTemplateLocals() {
|
|
@@ -12302,11 +11960,11 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
12302
11960
|
}
|
|
12303
11961
|
|
|
12304
11962
|
setHasEval() {
|
|
12305
|
-
|
|
11963
|
+
this._hasEval = true;
|
|
12306
11964
|
}
|
|
12307
11965
|
|
|
12308
11966
|
get hasEval() {
|
|
12309
|
-
return
|
|
11967
|
+
return this._hasEval;
|
|
12310
11968
|
}
|
|
12311
11969
|
|
|
12312
11970
|
has(name) {
|
|
@@ -12386,7 +12044,6 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
12386
12044
|
}
|
|
12387
12045
|
|
|
12388
12046
|
_exports.ProgramSymbolTable = ProgramSymbolTable;
|
|
12389
|
-
_hasEval = new WeakMap();
|
|
12390
12047
|
|
|
12391
12048
|
class BlockSymbolTable extends SymbolTable {
|
|
12392
12049
|
constructor(parent, symbols, slots) {
|
|
@@ -12903,7 +12560,7 @@ define("@glimmer/syntax", ["exports", "@glimmer/util", "simple-html-tokenizer",
|
|
|
12903
12560
|
strictMode: false,
|
|
12904
12561
|
locals: []
|
|
12905
12562
|
}, options);
|
|
12906
|
-
var top = SymbolTable.top(normalizeOptions.
|
|
12563
|
+
var top = SymbolTable.top(normalizeOptions.locals, (_a = // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
12907
12564
|
options.customizeComponentName) !== null && _a !== void 0 ? _a : name => name);
|
|
12908
12565
|
var block = new BlockContext(source, normalizeOptions, top);
|
|
12909
12566
|
var normalizer = new StatementNormalizer(block);
|
|
@@ -18883,7 +18540,16 @@ define("ember-template-compiler/lib/system/compile-options", ["exports", "@ember
|
|
|
18883
18540
|
) {
|
|
18884
18541
|
options.strictMode = false;
|
|
18885
18542
|
options.locals = undefined;
|
|
18886
|
-
}
|
|
18543
|
+
}
|
|
18544
|
+
|
|
18545
|
+
if ('locals' in options && !options.locals) {
|
|
18546
|
+
// Glimmer's precompile options declare `locals` like:
|
|
18547
|
+
// locals?: string[]
|
|
18548
|
+
// but many in-use versions of babel-plugin-htmlbars-inline-precompile will
|
|
18549
|
+
// set locals to `null`. This used to work but only because glimmer was
|
|
18550
|
+
// ignoring locals for non-strict templates, and now it supports that case.
|
|
18551
|
+
delete options.locals;
|
|
18552
|
+
} // move `moduleName` into `meta` property
|
|
18887
18553
|
|
|
18888
18554
|
|
|
18889
18555
|
if (options.moduleName) {
|
|
@@ -19056,7 +18722,7 @@ define("ember/version", ["exports"], function (_exports) {
|
|
|
19056
18722
|
value: true
|
|
19057
18723
|
});
|
|
19058
18724
|
_exports.default = void 0;
|
|
19059
|
-
var _default = "4.0.0-beta.
|
|
18725
|
+
var _default = "4.0.0-beta.8";
|
|
19060
18726
|
_exports.default = _default;
|
|
19061
18727
|
});
|
|
19062
18728
|
define("simple-html-tokenizer", ["exports"], function (_exports) {
|