@lwc/template-compiler 8.12.2 → 8.12.3
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/dist/codegen/codegen.d.ts +1 -0
- package/dist/codegen/expression.d.ts +1 -0
- package/dist/codegen/formatters/module.d.ts +1 -0
- package/dist/codegen/helpers.d.ts +1 -0
- package/dist/codegen/index.d.ts +1 -0
- package/dist/codegen/optimize.d.ts +1 -0
- package/dist/codegen/static-element-serializer.d.ts +1 -0
- package/dist/codegen/static-element.d.ts +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/index.cjs.js +20 -20
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -20
- package/dist/parser/attribute.d.ts +1 -0
- package/dist/parser/constants.d.ts +1 -0
- package/dist/parser/expression-complex/html.d.ts +1 -0
- package/dist/parser/expression-complex/index.d.ts +1 -0
- package/dist/parser/expression-complex/types.d.ts +1 -0
- package/dist/parser/expression-complex/validate.d.ts +1 -0
- package/dist/parser/expression.d.ts +1 -0
- package/dist/parser/html.d.ts +1 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/parse5Errors.d.ts +1 -0
- package/dist/parser/parser.d.ts +1 -0
- package/dist/parser/utils/html-element-attributes.d.ts +1 -0
- package/dist/parser/utils/html-elements.d.ts +1 -0
- package/dist/parser/utils/javascript.d.ts +1 -0
- package/dist/parser/utils/svg-elements.d.ts +1 -0
- package/dist/scopeTokens.d.ts +1 -0
- package/dist/shared/ast.d.ts +1 -0
- package/dist/shared/constants.d.ts +1 -0
- package/dist/shared/estree.d.ts +1 -0
- package/dist/shared/naming.d.ts +1 -0
- package/dist/shared/renderer-hooks.d.ts +1 -0
- package/dist/shared/types.d.ts +1 -0
- package/dist/shared/utils.d.ts +1 -0
- package/dist/state.d.ts +1 -0
- package/package.json +5 -4
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -24,3 +24,4 @@ import type CodeGen from './codegen';
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function bindComplexExpression(expression: ComplexExpression, codeGen: CodeGen): t.Expression;
|
|
26
26
|
export declare function bindAttributeExpression(attr: Attribute | Property, element: BaseElement, codeGen: CodeGen, addLegacySanitizationHook: boolean): import("estree").Identifier | import("estree").MemberExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").ArrowFunctionExpression | import("estree").UnaryExpression | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").BigIntLiteral | import("estree").AssignmentExpression | import("estree").AwaitExpression | import("estree").BinaryExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").ChainExpression | import("estree").ClassExpression | import("estree").ConditionalExpression | import("estree").FunctionExpression | import("estree").ImportExpression | import("estree").LogicalExpression | import("estree").MetaProperty | import("estree").SequenceExpression | import("estree").TaggedTemplateExpression | import("estree").TemplateLiteral | import("estree").ThisExpression | import("estree").UpdateExpression | import("estree").YieldExpression;
|
|
27
|
+
//# sourceMappingURL=expression.d.ts.map
|
package/dist/codegen/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare function transformStaticChildren(elm: StaticElement, preserveComm
|
|
|
5
5
|
export declare const isContiguousText: (staticChild: StaticChildNode | Text[]) => staticChild is Text[];
|
|
6
6
|
export declare const isTextExpression: (node: ChildNode) => boolean;
|
|
7
7
|
export declare const hasDynamicText: (nodes: Text[]) => boolean;
|
|
8
|
+
//# sourceMappingURL=static-element.d.ts.map
|
package/dist/config.d.ts
CHANGED
|
@@ -73,3 +73,4 @@ type OptionalConfigOptions = Partial<Pick<Config, OptionalConfigNames>>;
|
|
|
73
73
|
export type NormalizedConfig = RequiredConfigOptions & OptionalConfigOptions;
|
|
74
74
|
export declare function normalizeConfig(config: Config): NormalizedConfig;
|
|
75
75
|
export {};
|
|
76
|
+
//# sourceMappingURL=config.d.ts.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025 Salesforce, Inc.
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -672,7 +672,7 @@ const decodeMap = new Map([
|
|
|
672
672
|
*/
|
|
673
673
|
const fromCodePoint =
|
|
674
674
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
675
|
-
(_a = String.fromCodePoint) !== null && _a !==
|
|
675
|
+
(_a = String.fromCodePoint) !== null && _a !== undefined ? _a : function (codePoint) {
|
|
676
676
|
let output = "";
|
|
677
677
|
if (codePoint > 0xffff) {
|
|
678
678
|
codePoint -= 0x10000;
|
|
@@ -692,7 +692,7 @@ function replaceCodePoint(codePoint) {
|
|
|
692
692
|
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
|
693
693
|
return 0xfffd;
|
|
694
694
|
}
|
|
695
|
-
return (_a = decodeMap.get(codePoint)) !== null && _a !==
|
|
695
|
+
return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
|
|
696
696
|
}
|
|
697
697
|
|
|
698
698
|
var CharCodes;
|
|
@@ -936,7 +936,7 @@ class EntityDecoder {
|
|
|
936
936
|
var _a;
|
|
937
937
|
// Ensure we consumed at least one digit.
|
|
938
938
|
if (this.consumed <= expectedLength) {
|
|
939
|
-
(_a = this.errors) === null || _a ===
|
|
939
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
940
940
|
return 0;
|
|
941
941
|
}
|
|
942
942
|
// Figure out if this is a legit end of the entity
|
|
@@ -1011,7 +1011,7 @@ class EntityDecoder {
|
|
|
1011
1011
|
const { result, decodeTree } = this;
|
|
1012
1012
|
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
1013
1013
|
this.emitNamedEntityData(result, valueLength, this.consumed);
|
|
1014
|
-
(_a = this.errors) === null || _a ===
|
|
1014
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
|
|
1015
1015
|
return this.consumed;
|
|
1016
1016
|
}
|
|
1017
1017
|
/**
|
|
@@ -1060,7 +1060,7 @@ class EntityDecoder {
|
|
|
1060
1060
|
return this.emitNumericEntity(0, 3);
|
|
1061
1061
|
}
|
|
1062
1062
|
case EntityDecoderState.NumericStart: {
|
|
1063
|
-
(_a = this.errors) === null || _a ===
|
|
1063
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
1064
1064
|
return 0;
|
|
1065
1065
|
}
|
|
1066
1066
|
case EntityDecoderState.EntityStart: {
|
|
@@ -1565,7 +1565,7 @@ const TAG_NAME_TO_ID = new Map([
|
|
|
1565
1565
|
]);
|
|
1566
1566
|
function getTagID(tagName) {
|
|
1567
1567
|
var _a;
|
|
1568
|
-
return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !==
|
|
1568
|
+
return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== undefined ? _a : TAG_ID.UNKNOWN;
|
|
1569
1569
|
}
|
|
1570
1570
|
const $ = TAG_ID;
|
|
1571
1571
|
const SPECIAL_ELEMENTS = {
|
|
@@ -1851,7 +1851,7 @@ class Tokenizer {
|
|
|
1851
1851
|
//Errors
|
|
1852
1852
|
_err(code, cpOffset = 0) {
|
|
1853
1853
|
var _a, _b;
|
|
1854
|
-
(_b = (_a = this.handler).onParseError) === null || _b ===
|
|
1854
|
+
(_b = (_a = this.handler).onParseError) === null || _b === undefined ? undefined : _b.call(_a, this.preprocessor.getError(code, cpOffset));
|
|
1855
1855
|
}
|
|
1856
1856
|
// NOTE: `offset` may never run across line boundaries.
|
|
1857
1857
|
getCurrentLocation(offset) {
|
|
@@ -1894,7 +1894,7 @@ class Tokenizer {
|
|
|
1894
1894
|
return;
|
|
1895
1895
|
this._runParsingLoop();
|
|
1896
1896
|
if (!this.paused) {
|
|
1897
|
-
writeCallback === null || writeCallback ===
|
|
1897
|
+
writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
|
|
1898
1898
|
}
|
|
1899
1899
|
}
|
|
1900
1900
|
write(chunk, isLastChunk, writeCallback) {
|
|
@@ -1902,7 +1902,7 @@ class Tokenizer {
|
|
|
1902
1902
|
this.preprocessor.write(chunk, isLastChunk);
|
|
1903
1903
|
this._runParsingLoop();
|
|
1904
1904
|
if (!this.paused) {
|
|
1905
|
-
writeCallback === null || writeCallback ===
|
|
1905
|
+
writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
1908
|
insertHtmlAtCurrentPos(chunk) {
|
|
@@ -2001,7 +2001,7 @@ class Tokenizer {
|
|
|
2001
2001
|
if (getTokenAttr(token, this.currentAttr.name) === null) {
|
|
2002
2002
|
token.attrs.push(this.currentAttr);
|
|
2003
2003
|
if (token.location && this.currentLocation) {
|
|
2004
|
-
const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !==
|
|
2004
|
+
const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== undefined ? _a : (_b.attrs = Object.create(null)));
|
|
2005
2005
|
attrLocations[this.currentAttr.name] = this.currentLocation;
|
|
2006
2006
|
// Set end location
|
|
2007
2007
|
this._leaveAttrValue();
|
|
@@ -5414,11 +5414,11 @@ class Parser {
|
|
|
5414
5414
|
if (this.onParseError) {
|
|
5415
5415
|
this.options.sourceCodeLocationInfo = true;
|
|
5416
5416
|
}
|
|
5417
|
-
this.document = document !== null && document !==
|
|
5417
|
+
this.document = document !== null && document !== undefined ? document : this.treeAdapter.createDocument();
|
|
5418
5418
|
this.tokenizer = new Tokenizer(this.options, this);
|
|
5419
5419
|
this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
|
|
5420
5420
|
this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
|
|
5421
|
-
this._setContextModes(fragmentContext !== null && fragmentContext !==
|
|
5421
|
+
this._setContextModes(fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : this.document, this.fragmentContextID);
|
|
5422
5422
|
this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
|
|
5423
5423
|
}
|
|
5424
5424
|
// API
|
|
@@ -5434,7 +5434,7 @@ class Parser {
|
|
|
5434
5434
|
};
|
|
5435
5435
|
//NOTE: use a <template> element as the fragment context if no context element was provided,
|
|
5436
5436
|
//so we will parse in a "forgiving" manner
|
|
5437
|
-
fragmentContext !== null && fragmentContext !==
|
|
5437
|
+
fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
|
|
5438
5438
|
//NOTE: create a fake element which will be used as the `document` for fragment parsing.
|
|
5439
5439
|
//This is important for jsdom, where a new `document` cannot be created. This led to
|
|
5440
5440
|
//fragment parsing messing with the main `document`.
|
|
@@ -5461,7 +5461,7 @@ class Parser {
|
|
|
5461
5461
|
var _a;
|
|
5462
5462
|
if (!this.onParseError)
|
|
5463
5463
|
return;
|
|
5464
|
-
const loc = (_a = token.location) !== null && _a !==
|
|
5464
|
+
const loc = (_a = token.location) !== null && _a !== undefined ? _a : BASE_LOC;
|
|
5465
5465
|
const err = {
|
|
5466
5466
|
code,
|
|
5467
5467
|
startLine: loc.startLine,
|
|
@@ -5477,7 +5477,7 @@ class Parser {
|
|
|
5477
5477
|
/** @internal */
|
|
5478
5478
|
onItemPush(node, tid, isTop) {
|
|
5479
5479
|
var _a, _b;
|
|
5480
|
-
(_b = (_a = this.treeAdapter).onItemPush) === null || _b ===
|
|
5480
|
+
(_b = (_a = this.treeAdapter).onItemPush) === null || _b === undefined ? undefined : _b.call(_a, node);
|
|
5481
5481
|
if (isTop && this.openElements.stackTop > 0)
|
|
5482
5482
|
this._setContextModes(node, tid);
|
|
5483
5483
|
}
|
|
@@ -5487,7 +5487,7 @@ class Parser {
|
|
|
5487
5487
|
if (this.options.sourceCodeLocationInfo) {
|
|
5488
5488
|
this._setEndLocation(node, this.currentToken);
|
|
5489
5489
|
}
|
|
5490
|
-
(_b = (_a = this.treeAdapter).onItemPop) === null || _b ===
|
|
5490
|
+
(_b = (_a = this.treeAdapter).onItemPop) === null || _b === undefined ? undefined : _b.call(_a, node, this.openElements.current);
|
|
5491
5491
|
if (isTop) {
|
|
5492
5492
|
let current;
|
|
5493
5493
|
let currentTagId;
|
|
@@ -7649,7 +7649,7 @@ function eofInBody(p, token) {
|
|
|
7649
7649
|
function endTagInText(p, token) {
|
|
7650
7650
|
var _a;
|
|
7651
7651
|
if (token.tagID === TAG_ID.SCRIPT) {
|
|
7652
|
-
(_a = p.scriptHandler) === null || _a ===
|
|
7652
|
+
(_a = p.scriptHandler) === null || _a === undefined ? undefined : _a.call(p, p.openElements.current);
|
|
7653
7653
|
}
|
|
7654
7654
|
p.openElements.pop();
|
|
7655
7655
|
p.insertionMode = p.originalInsertionMode;
|
|
@@ -8377,7 +8377,7 @@ function endTagAfterBody(p, token) {
|
|
|
8377
8377
|
p._setEndLocation(p.openElements.items[0], token);
|
|
8378
8378
|
// Update the body element, if it doesn't have an end tag
|
|
8379
8379
|
const bodyElement = p.openElements.items[1];
|
|
8380
|
-
if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a ===
|
|
8380
|
+
if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === undefined ? undefined : _a.endTag)) {
|
|
8381
8381
|
p._setEndLocation(bodyElement, token);
|
|
8382
8382
|
}
|
|
8383
8383
|
}
|
|
@@ -14714,5 +14714,5 @@ exports.generateScopeTokens = generateScopeTokens;
|
|
|
14714
14714
|
exports.kebabcaseToCamelcase = kebabcaseToCamelcase;
|
|
14715
14715
|
exports.parse = parse;
|
|
14716
14716
|
exports.toPropertyName = toPropertyName;
|
|
14717
|
-
/** version: 8.12.
|
|
14717
|
+
/** version: 8.12.3 */
|
|
14718
14718
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025 Salesforce, Inc.
|
|
3
3
|
*/
|
|
4
4
|
import { invariant, TemplateErrors, generateCompilerError, CompilerError, normalizeToDiagnostic, generateCompilerDiagnostic, ParserDiagnostics, DiagnosticLevel, CompilerMetrics } from '@lwc/errors';
|
|
5
5
|
import path from 'path';
|
|
@@ -648,7 +648,7 @@ const decodeMap = new Map([
|
|
|
648
648
|
*/
|
|
649
649
|
const fromCodePoint =
|
|
650
650
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
651
|
-
(_a = String.fromCodePoint) !== null && _a !==
|
|
651
|
+
(_a = String.fromCodePoint) !== null && _a !== undefined ? _a : function (codePoint) {
|
|
652
652
|
let output = "";
|
|
653
653
|
if (codePoint > 0xffff) {
|
|
654
654
|
codePoint -= 0x10000;
|
|
@@ -668,7 +668,7 @@ function replaceCodePoint(codePoint) {
|
|
|
668
668
|
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
|
669
669
|
return 0xfffd;
|
|
670
670
|
}
|
|
671
|
-
return (_a = decodeMap.get(codePoint)) !== null && _a !==
|
|
671
|
+
return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
|
|
672
672
|
}
|
|
673
673
|
|
|
674
674
|
var CharCodes;
|
|
@@ -912,7 +912,7 @@ class EntityDecoder {
|
|
|
912
912
|
var _a;
|
|
913
913
|
// Ensure we consumed at least one digit.
|
|
914
914
|
if (this.consumed <= expectedLength) {
|
|
915
|
-
(_a = this.errors) === null || _a ===
|
|
915
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
916
916
|
return 0;
|
|
917
917
|
}
|
|
918
918
|
// Figure out if this is a legit end of the entity
|
|
@@ -987,7 +987,7 @@ class EntityDecoder {
|
|
|
987
987
|
const { result, decodeTree } = this;
|
|
988
988
|
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
989
989
|
this.emitNamedEntityData(result, valueLength, this.consumed);
|
|
990
|
-
(_a = this.errors) === null || _a ===
|
|
990
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
|
|
991
991
|
return this.consumed;
|
|
992
992
|
}
|
|
993
993
|
/**
|
|
@@ -1036,7 +1036,7 @@ class EntityDecoder {
|
|
|
1036
1036
|
return this.emitNumericEntity(0, 3);
|
|
1037
1037
|
}
|
|
1038
1038
|
case EntityDecoderState.NumericStart: {
|
|
1039
|
-
(_a = this.errors) === null || _a ===
|
|
1039
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
1040
1040
|
return 0;
|
|
1041
1041
|
}
|
|
1042
1042
|
case EntityDecoderState.EntityStart: {
|
|
@@ -1541,7 +1541,7 @@ const TAG_NAME_TO_ID = new Map([
|
|
|
1541
1541
|
]);
|
|
1542
1542
|
function getTagID(tagName) {
|
|
1543
1543
|
var _a;
|
|
1544
|
-
return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !==
|
|
1544
|
+
return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== undefined ? _a : TAG_ID.UNKNOWN;
|
|
1545
1545
|
}
|
|
1546
1546
|
const $ = TAG_ID;
|
|
1547
1547
|
const SPECIAL_ELEMENTS = {
|
|
@@ -1827,7 +1827,7 @@ class Tokenizer {
|
|
|
1827
1827
|
//Errors
|
|
1828
1828
|
_err(code, cpOffset = 0) {
|
|
1829
1829
|
var _a, _b;
|
|
1830
|
-
(_b = (_a = this.handler).onParseError) === null || _b ===
|
|
1830
|
+
(_b = (_a = this.handler).onParseError) === null || _b === undefined ? undefined : _b.call(_a, this.preprocessor.getError(code, cpOffset));
|
|
1831
1831
|
}
|
|
1832
1832
|
// NOTE: `offset` may never run across line boundaries.
|
|
1833
1833
|
getCurrentLocation(offset) {
|
|
@@ -1870,7 +1870,7 @@ class Tokenizer {
|
|
|
1870
1870
|
return;
|
|
1871
1871
|
this._runParsingLoop();
|
|
1872
1872
|
if (!this.paused) {
|
|
1873
|
-
writeCallback === null || writeCallback ===
|
|
1873
|
+
writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
|
|
1874
1874
|
}
|
|
1875
1875
|
}
|
|
1876
1876
|
write(chunk, isLastChunk, writeCallback) {
|
|
@@ -1878,7 +1878,7 @@ class Tokenizer {
|
|
|
1878
1878
|
this.preprocessor.write(chunk, isLastChunk);
|
|
1879
1879
|
this._runParsingLoop();
|
|
1880
1880
|
if (!this.paused) {
|
|
1881
|
-
writeCallback === null || writeCallback ===
|
|
1881
|
+
writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
|
|
1882
1882
|
}
|
|
1883
1883
|
}
|
|
1884
1884
|
insertHtmlAtCurrentPos(chunk) {
|
|
@@ -1977,7 +1977,7 @@ class Tokenizer {
|
|
|
1977
1977
|
if (getTokenAttr(token, this.currentAttr.name) === null) {
|
|
1978
1978
|
token.attrs.push(this.currentAttr);
|
|
1979
1979
|
if (token.location && this.currentLocation) {
|
|
1980
|
-
const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !==
|
|
1980
|
+
const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== undefined ? _a : (_b.attrs = Object.create(null)));
|
|
1981
1981
|
attrLocations[this.currentAttr.name] = this.currentLocation;
|
|
1982
1982
|
// Set end location
|
|
1983
1983
|
this._leaveAttrValue();
|
|
@@ -5390,11 +5390,11 @@ class Parser {
|
|
|
5390
5390
|
if (this.onParseError) {
|
|
5391
5391
|
this.options.sourceCodeLocationInfo = true;
|
|
5392
5392
|
}
|
|
5393
|
-
this.document = document !== null && document !==
|
|
5393
|
+
this.document = document !== null && document !== undefined ? document : this.treeAdapter.createDocument();
|
|
5394
5394
|
this.tokenizer = new Tokenizer(this.options, this);
|
|
5395
5395
|
this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
|
|
5396
5396
|
this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
|
|
5397
|
-
this._setContextModes(fragmentContext !== null && fragmentContext !==
|
|
5397
|
+
this._setContextModes(fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : this.document, this.fragmentContextID);
|
|
5398
5398
|
this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
|
|
5399
5399
|
}
|
|
5400
5400
|
// API
|
|
@@ -5410,7 +5410,7 @@ class Parser {
|
|
|
5410
5410
|
};
|
|
5411
5411
|
//NOTE: use a <template> element as the fragment context if no context element was provided,
|
|
5412
5412
|
//so we will parse in a "forgiving" manner
|
|
5413
|
-
fragmentContext !== null && fragmentContext !==
|
|
5413
|
+
fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
|
|
5414
5414
|
//NOTE: create a fake element which will be used as the `document` for fragment parsing.
|
|
5415
5415
|
//This is important for jsdom, where a new `document` cannot be created. This led to
|
|
5416
5416
|
//fragment parsing messing with the main `document`.
|
|
@@ -5437,7 +5437,7 @@ class Parser {
|
|
|
5437
5437
|
var _a;
|
|
5438
5438
|
if (!this.onParseError)
|
|
5439
5439
|
return;
|
|
5440
|
-
const loc = (_a = token.location) !== null && _a !==
|
|
5440
|
+
const loc = (_a = token.location) !== null && _a !== undefined ? _a : BASE_LOC;
|
|
5441
5441
|
const err = {
|
|
5442
5442
|
code,
|
|
5443
5443
|
startLine: loc.startLine,
|
|
@@ -5453,7 +5453,7 @@ class Parser {
|
|
|
5453
5453
|
/** @internal */
|
|
5454
5454
|
onItemPush(node, tid, isTop) {
|
|
5455
5455
|
var _a, _b;
|
|
5456
|
-
(_b = (_a = this.treeAdapter).onItemPush) === null || _b ===
|
|
5456
|
+
(_b = (_a = this.treeAdapter).onItemPush) === null || _b === undefined ? undefined : _b.call(_a, node);
|
|
5457
5457
|
if (isTop && this.openElements.stackTop > 0)
|
|
5458
5458
|
this._setContextModes(node, tid);
|
|
5459
5459
|
}
|
|
@@ -5463,7 +5463,7 @@ class Parser {
|
|
|
5463
5463
|
if (this.options.sourceCodeLocationInfo) {
|
|
5464
5464
|
this._setEndLocation(node, this.currentToken);
|
|
5465
5465
|
}
|
|
5466
|
-
(_b = (_a = this.treeAdapter).onItemPop) === null || _b ===
|
|
5466
|
+
(_b = (_a = this.treeAdapter).onItemPop) === null || _b === undefined ? undefined : _b.call(_a, node, this.openElements.current);
|
|
5467
5467
|
if (isTop) {
|
|
5468
5468
|
let current;
|
|
5469
5469
|
let currentTagId;
|
|
@@ -7625,7 +7625,7 @@ function eofInBody(p, token) {
|
|
|
7625
7625
|
function endTagInText(p, token) {
|
|
7626
7626
|
var _a;
|
|
7627
7627
|
if (token.tagID === TAG_ID.SCRIPT) {
|
|
7628
|
-
(_a = p.scriptHandler) === null || _a ===
|
|
7628
|
+
(_a = p.scriptHandler) === null || _a === undefined ? undefined : _a.call(p, p.openElements.current);
|
|
7629
7629
|
}
|
|
7630
7630
|
p.openElements.pop();
|
|
7631
7631
|
p.insertionMode = p.originalInsertionMode;
|
|
@@ -8353,7 +8353,7 @@ function endTagAfterBody(p, token) {
|
|
|
8353
8353
|
p._setEndLocation(p.openElements.items[0], token);
|
|
8354
8354
|
// Update the body element, if it doesn't have an end tag
|
|
8355
8355
|
const bodyElement = p.openElements.items[1];
|
|
8356
|
-
if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a ===
|
|
8356
|
+
if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === undefined ? undefined : _a.endTag)) {
|
|
8357
8357
|
p._setEndLocation(bodyElement, token);
|
|
8358
8358
|
}
|
|
8359
8359
|
}
|
|
@@ -14685,5 +14685,5 @@ function compile(source, filename, config) {
|
|
|
14685
14685
|
}
|
|
14686
14686
|
|
|
14687
14687
|
export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, compile, compile as default, generateScopeTokens, kebabcaseToCamelcase, parse, toPropertyName };
|
|
14688
|
-
/** version: 8.12.
|
|
14688
|
+
/** version: 8.12.3 */
|
|
14689
14689
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,3 +7,4 @@ export declare function isPotentialExpression(source: string): boolean;
|
|
|
7
7
|
export declare function validatePreparsedJsExpressions(ctx: ParserCtx): void;
|
|
8
8
|
export declare function parseExpression(ctx: ParserCtx, source: string, location: SourceLocation): Expression;
|
|
9
9
|
export declare function parseIdentifier(ctx: ParserCtx, source: string, location: SourceLocation): Identifier;
|
|
10
|
+
//# sourceMappingURL=expression.d.ts.map
|
package/dist/parser/html.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import type ParserCtx from './parser';
|
|
|
2
2
|
export declare function parseHTML(ctx: ParserCtx, source: string): import("parse5/dist/tree-adapters/default").DocumentFragment;
|
|
3
3
|
export declare function cleanTextNode(value: string): string;
|
|
4
4
|
export declare function decodeTextContent(source: string): string;
|
|
5
|
+
//# sourceMappingURL=html.d.ts.map
|
package/dist/parser/index.d.ts
CHANGED
package/dist/parser/parser.d.ts
CHANGED
package/dist/scopeTokens.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export type scopeTokens = {
|
|
|
11
11
|
* @param componentName - component name, e.g. 'foo' for `x/foo/foo.js`
|
|
12
12
|
*/
|
|
13
13
|
export declare function generateScopeTokens(filename: string, namespace: string | undefined, componentName: string | undefined): scopeTokens;
|
|
14
|
+
//# sourceMappingURL=scopeTokens.d.ts.map
|
package/dist/shared/ast.d.ts
CHANGED
|
@@ -70,3 +70,4 @@ export declare function isPreserveCommentsDirective(directive: RootDirective): d
|
|
|
70
70
|
export declare function isProperty(node: BaseNode): node is Property;
|
|
71
71
|
export declare function isScopedSlotFragment(node: BaseNode): node is ScopedSlotFragment;
|
|
72
72
|
export declare function isAttribute(node: BaseNode): node is Attribute;
|
|
73
|
+
//# sourceMappingURL=ast.d.ts.map
|
package/dist/shared/estree.d.ts
CHANGED
package/dist/shared/naming.d.ts
CHANGED
package/dist/shared/types.d.ts
CHANGED
package/dist/shared/utils.d.ts
CHANGED
package/dist/state.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
|
|
5
5
|
],
|
|
6
6
|
"name": "@lwc/template-compiler",
|
|
7
|
-
"version": "8.12.
|
|
7
|
+
"version": "8.12.3",
|
|
8
8
|
"description": "Template compiler package",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"lwc"
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"module": "dist/index.js",
|
|
30
30
|
"types": "dist/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
|
-
"dist"
|
|
32
|
+
"dist/**/*.js",
|
|
33
|
+
"dist/**/*.d.ts"
|
|
33
34
|
],
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "rollup --config ../../../scripts/rollup/rollup.config.js",
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@lwc/errors": "8.12.
|
|
49
|
-
"@lwc/shared": "8.12.
|
|
49
|
+
"@lwc/errors": "8.12.3",
|
|
50
|
+
"@lwc/shared": "8.12.3",
|
|
50
51
|
"acorn": "~8.14.0",
|
|
51
52
|
"astring": "~1.9.0",
|
|
52
53
|
"he": "~1.2.0"
|