From 634c148aa782a6eb2d2aa8bd2f7c1c9c5d789eea Mon Sep 17 00:00:00 2001 From: John Hefferman Date: Wed, 27 Aug 2025 14:23:38 -0600 Subject: [PATCH 01/15] feat: use default parse5 implementation --- .../directive-if/template-expression/.only | 0 .../template-expression/config.json | 2 +- .../boolean-literal-attribute/actual.html | 3 + .../valid/boolean-literal-attribute/ast.json | 1 + .../boolean-literal-attribute/config.json | 3 + .../boolean-literal-attribute/expected.js | 0 .../boolean-literal-attribute/metadata.json | 3 + .../valid/boolean-literal/actual.html | 5 +- .../valid/boolean-literal/ast.json | 265 +++--------------- .../valid/boolean-literal/expected.js | 28 +- .../src/parser/expression-complex/html.ts | 1 + .../src/parser/expression.ts | 1 + .../@lwc/template-compiler/src/parser/html.ts | 5 +- .../template-compiler/src/parser/index.ts | 7 +- 14 files changed, 66 insertions(+), 258 deletions(-) create mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/.only create mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html create mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json create mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json create mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/expected.js create mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/.only b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/.only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/config.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/config.json index 1f1b15380f..43117cc7f0 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/config.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/config.json @@ -1,3 +1,3 @@ { - "experimentalComplexExpressions": true + "experimentalComplexExpressions": false } diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html new file mode 100644 index 0000000000..eeaa34b19d --- /dev/null +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html @@ -0,0 +1,3 @@ + diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json new file mode 100644 index 0000000000..1f1b15380f --- /dev/null +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json @@ -0,0 +1,3 @@ +{ + "experimentalComplexExpressions": true +} diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/expected.js b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/expected.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json new file mode 100644 index 0000000000..51ec5f799c --- /dev/null +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json @@ -0,0 +1,3 @@ +{ + "warnings": [] +} \ No newline at end of file diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/actual.html index 5c35107920..dae9743dea 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/actual.html @@ -1,6 +1,3 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/ast.json index f2b7c2141f..8060a187d5 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/ast.json @@ -4,10 +4,10 @@ "location": { "startLine": 1, "startColumn": 1, - "endLine": 6, + "endLine": 3, "endColumn": 12, "start": 0, - "end": 141, + "end": 50, "startTag": { "startLine": 1, "startColumn": 1, @@ -17,42 +17,42 @@ "end": 10 }, "endTag": { - "startLine": 6, + "startLine": 3, "startColumn": 1, - "endLine": 6, + "endLine": 3, "endColumn": 12, - "start": 130, - "end": 141 + "start": 39, + "end": 50 } }, "directives": [], "children": [ { - "type": "Element", - "name": "section", + "type": "Component", + "name": "x-pert", "namespace": "http://www.w3.org/1999/xhtml", "location": { "startLine": 2, "startColumn": 5, - "endLine": 5, - "endColumn": 15, + "endLine": 2, + "endColumn": 28, "start": 15, - "end": 129, + "end": 38, "startTag": { "startLine": 2, "startColumn": 5, "endLine": 2, - "endColumn": 14, + "endColumn": 13, "start": 15, - "end": 24 + "end": 23 }, "endTag": { - "startLine": 5, - "startColumn": 5, - "endLine": 5, - "endColumn": 15, - "start": 119, - "end": 129 + "startLine": 2, + "startColumn": 19, + "endLine": 2, + "endColumn": 28, + "start": 29, + "end": 38 } }, "attributes": [], @@ -61,214 +61,31 @@ "listeners": [], "children": [ { - "type": "Component", - "name": "x-pert", - "namespace": "http://www.w3.org/1999/xhtml", - "location": { - "startLine": 3, - "startColumn": 9, - "endLine": 3, - "endColumn": 44, - "start": 33, - "end": 68, - "startTag": { - "startLine": 3, - "startColumn": 9, - "endLine": 3, - "endColumn": 29, - "start": 33, - "end": 53 - }, - "endTag": { - "startLine": 3, - "startColumn": 35, - "endLine": 3, - "endColumn": 44, - "start": 59, - "end": 68 + "type": "Text", + "raw": "{true}", + "value": { + "type": "Literal", + "start": 1, + "end": 5, + "value": true, + "raw": "true", + "location": { + "startLine": 2, + "startColumn": 13, + "endLine": 2, + "endColumn": 19, + "start": 23, + "end": 29 } }, - "attributes": [], - "properties": [ - { - "type": "Property", - "name": "attr", - "attributeName": "attr", - "value": { - "type": "Literal", - "start": 1, - "end": 5, - "value": true, - "raw": "true", - "location": { - "startLine": 3, - "startColumn": 17, - "endLine": 3, - "endColumn": 28, - "start": 41, - "end": 52 - } - }, - "location": { - "startLine": 3, - "startColumn": 17, - "endLine": 3, - "endColumn": 28, - "start": 41, - "end": 52 - } - } - ], - "directives": [], - "listeners": [], - "children": [ - { - "type": "Text", - "raw": "{true}", - "value": { - "type": "Literal", - "start": 54, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 29 - }, - "end": { - "line": 3, - "column": 33 - } - }, - "range": [ - 54, - 58 - ], - "value": true, - "raw": "true", - "location": { - "startLine": 3, - "startColumn": 29, - "endLine": 3, - "endColumn": 35, - "start": 53, - "end": 59 - } - }, - "location": { - "startLine": 3, - "startColumn": 29, - "endLine": 3, - "endColumn": 35, - "start": 53, - "end": 59 - } - } - ] - }, - { - "type": "Component", - "name": "x-pert", - "namespace": "http://www.w3.org/1999/xhtml", "location": { - "startLine": 4, - "startColumn": 9, - "endLine": 4, - "endColumn": 46, - "start": 77, - "end": 114, - "startTag": { - "startLine": 4, - "startColumn": 9, - "endLine": 4, - "endColumn": 30, - "start": 77, - "end": 98 - }, - "endTag": { - "startLine": 4, - "startColumn": 37, - "endLine": 4, - "endColumn": 46, - "start": 105, - "end": 114 - } - }, - "attributes": [], - "properties": [ - { - "type": "Property", - "name": "attr", - "attributeName": "attr", - "value": { - "type": "Literal", - "start": 1, - "end": 6, - "value": false, - "raw": "false", - "location": { - "startLine": 4, - "startColumn": 17, - "endLine": 4, - "endColumn": 29, - "start": 85, - "end": 97 - } - }, - "location": { - "startLine": 4, - "startColumn": 17, - "endLine": 4, - "endColumn": 29, - "start": 85, - "end": 97 - } - } - ], - "directives": [], - "listeners": [], - "children": [ - { - "type": "Text", - "raw": "{false}", - "value": { - "type": "Literal", - "start": 99, - "end": 104, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 99, - 104 - ], - "value": false, - "raw": "false", - "location": { - "startLine": 4, - "startColumn": 30, - "endLine": 4, - "endColumn": 37, - "start": 98, - "end": 105 - } - }, - "location": { - "startLine": 4, - "startColumn": 30, - "endLine": 4, - "endColumn": 37, - "start": 98, - "end": 105 - } - } - ] + "startLine": 2, + "startColumn": 13, + "endLine": 2, + "endColumn": 19, + "start": 23, + "end": 29 + } } ] } diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/expected.js b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/expected.js index eb15d095b5..95cca10166 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/expected.js +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal/expected.js @@ -5,33 +5,11 @@ import { freezeTemplate, registerTemplate } from "lwc"; const stc0 = { key: 0, }; -const stc1 = { - props: { - attr: true, - }, - key: 1, -}; -const stc2 = { - props: { - attr: false, - }, - key: 2, -}; function tmpl($api, $cmp, $slotset, $ctx) { - const { - d: api_dynamic_text, - t: api_text, - c: api_custom_element, - h: api_element, - } = $api; + const { d: api_dynamic_text, t: api_text, c: api_custom_element } = $api; return [ - api_element("section", stc0, [ - api_custom_element("x-pert", _xPert, stc1, [ - api_text(api_dynamic_text(true)), - ]), - api_custom_element("x-pert", _xPert, stc2, [ - api_text(api_dynamic_text(false)), - ]), + api_custom_element("x-pert", _xPert, stc0, [ + api_text(api_dynamic_text(true)), ]), ]; /*LWC compiler vX.X.X*/ diff --git a/packages/@lwc/template-compiler/src/parser/expression-complex/html.ts b/packages/@lwc/template-compiler/src/parser/expression-complex/html.ts index a6d6559b9c..7c3515e7fc 100644 --- a/packages/@lwc/template-compiler/src/parser/expression-complex/html.ts +++ b/packages/@lwc/template-compiler/src/parser/expression-complex/html.ts @@ -122,6 +122,7 @@ class TemplateHtmlTokenizer extends Tokenizer { } parseTemplateExpression() { + debugger; const expressionStart: number = this.preprocessor.pos; const html = this.preprocessor.html; diff --git a/packages/@lwc/template-compiler/src/parser/expression.ts b/packages/@lwc/template-compiler/src/parser/expression.ts index cfd1257b25..a4b7c29578 100644 --- a/packages/@lwc/template-compiler/src/parser/expression.ts +++ b/packages/@lwc/template-compiler/src/parser/expression.ts @@ -128,6 +128,7 @@ export function parseExpression( source: string, location: SourceLocation ): Expression { + debugger; const { ecmaVersion } = ctx; return ctx.withErrorWrapping( () => { diff --git a/packages/@lwc/template-compiler/src/parser/html.ts b/packages/@lwc/template-compiler/src/parser/html.ts index 561be74621..aff529cd05 100644 --- a/packages/@lwc/template-compiler/src/parser/html.ts +++ b/packages/@lwc/template-compiler/src/parser/html.ts @@ -12,7 +12,7 @@ import { APIFeature, isAPIFeatureEnabled } from '@lwc/shared'; import { sourceLocation } from '../shared/ast'; import { errorCodesToErrorOn, errorCodesToWarnOnInOlderAPIVersions } from './parse5Errors'; -import { parseFragment } from './expression-complex'; +//import { parseFragment } from './expression-complex'; import type { DocumentFragment } from '@parse5/tools'; import type ParserCtx from './parser'; @@ -46,13 +46,14 @@ export function parseHTML(ctx: ParserCtx, source: string): DocumentFragment { }; // TODO [#3370]: remove experimental template expression flag + /* if (ctx.config.experimentalComplexExpressions) { return parseFragment(source, { ctx, sourceCodeLocationInfo: true, onParseError, }); - } + }*/ return parse5.parseFragment(source, { sourceCodeLocationInfo: true, diff --git a/packages/@lwc/template-compiler/src/parser/index.ts b/packages/@lwc/template-compiler/src/parser/index.ts index 92fb6544d5..2044daaa2f 100644 --- a/packages/@lwc/template-compiler/src/parser/index.ts +++ b/packages/@lwc/template-compiler/src/parser/index.ts @@ -461,6 +461,7 @@ function parseChildren( } function parseText(ctx: ParserCtx, parse5Text: parse5Tools.TextNode): Text[] { + debugger; const parsedTextNodes: Text[] = []; const location = parse5Text.sourceCodeLocation; @@ -493,11 +494,13 @@ function parseText(ctx: ParserCtx, parse5Text: parse5Tools.TextNode): Text[] { the HTML whitespace while preserving text content whitespace, while also taking into account how comments are sometimes preserved (in which case we need to keep the HTML whitespace). */ - if (!rawText.trim().length && !ctx.config.experimentalComplexExpressions) { + //if (!rawText.trim().length && !ctx.config.experimentalComplexExpressions) { + if (!rawText.trim().length) { return parsedTextNodes; } // TODO [#3370]: remove experimental template expression flag + /* if (ctx.config.experimentalComplexExpressions && isExpression(rawText)) { // Implementation of the lexer ensures that each text-node template expression // will be contained in its own text node. Adjacent static text will be in @@ -512,7 +515,7 @@ function parseText(ctx: ParserCtx, parse5Text: parse5Tools.TextNode): Text[] { location: ast.sourceLocation(location), }; return [ast.text(rawText, value, location)]; - } + }*/ // Split the text node content arround expression and create node for each const tokenizedContent = rawText.split(EXPRESSION_RE); From 7f9c1073c4717a7dbcac721cbffca2667ac204f8 Mon Sep 17 00:00:00 2001 From: John Hefferman Date: Wed, 27 Aug 2025 14:39:19 -0600 Subject: [PATCH 02/15] fix: directive-if/template-expression --- .../directive-if/template-expression/.only | 0 .../directive-if/template-expression/ast.json | 88 ++++++++----------- .../template-expression/expected.js | 4 +- 3 files changed, 41 insertions(+), 51 deletions(-) delete mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/.only diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/.only b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/.only deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/ast.json index c5ea53b27b..964085551d 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/ast.json @@ -112,39 +112,41 @@ "raw": "{foo}", "value": { "type": "Identifier", - "start": 80, - "end": 83, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 16 - } - }, - "range": [ - 80, - 83 - ], + "start": 1, + "end": 4, "name": "foo", "location": { - "startLine": 4, - "startColumn": 13, - "endLine": 5, - "endColumn": 13, - "start": 79, - "end": 97 + "startLine": 3, + "startColumn": 42, + "endLine": 6, + "endColumn": 9, + "start": 66, + "end": 111 } }, "location": { - "startLine": 4, - "startColumn": 13, - "endLine": 5, - "endColumn": 13, - "start": 79, - "end": 97 + "startLine": 3, + "startColumn": 42, + "endLine": 6, + "endColumn": 9, + "start": 66, + "end": 111 + } + }, + { + "type": "Text", + "raw": " ", + "value": { + "type": "Literal", + "value": " " + }, + "location": { + "startLine": 3, + "startColumn": 42, + "endLine": 6, + "endColumn": 9, + "start": 66, + "end": 111 } }, { @@ -152,38 +154,24 @@ "raw": "{bar}", "value": { "type": "Identifier", - "start": 98, - "end": 101, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 16 - } - }, - "range": [ - 98, - 101 - ], + "start": 1, + "end": 4, "name": "bar", "location": { - "startLine": 5, - "startColumn": 13, + "startLine": 3, + "startColumn": 42, "endLine": 6, "endColumn": 9, - "start": 97, + "start": 66, "end": 111 } }, "location": { - "startLine": 5, - "startColumn": 13, + "startLine": 3, + "startColumn": 42, "endLine": 6, "endColumn": 9, - "start": 97, + "start": 66, "end": 111 } } diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/expected.js b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/expected.js index 7486a6129e..3d0477e12e 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/expected.js +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/expected.js @@ -9,7 +9,9 @@ function tmpl($api, $cmp, $slotset, $ctx) { return [ api_element("section", stc0, [ $cmp.state.isTrue - ? api_text(api_dynamic_text($cmp.foo) + api_dynamic_text($cmp.bar)) + ? api_text( + api_dynamic_text($cmp.foo) + " " + api_dynamic_text($cmp.bar) + ) : null, ]), ]; From d6db47f77bf170f822bb0d64a647e42fe0fba2e4 Mon Sep 17 00:00:00 2001 From: John Hefferman Date: Thu, 28 Aug 2025 10:04:22 -0600 Subject: [PATCH 03/15] chore: fixture updates --- .../invalid/arrow-function-async/actual.html | 2 +- .../arrow-function-async/metadata.json | 6 +- .../arrow-function-block-body/actual.html | 2 +- .../arrow-function-block-body/metadata.json | 6 +- .../assignment-outside-arrow/actual.html | 2 +- .../assignment-outside-arrow/metadata.json | 6 +- .../invalid/await/actual.html | 2 +- .../invalid/await/metadata.json | 6 +- .../invalid/bigint-literal/actual.html | 2 +- .../invalid/bigint-literal/metadata.json | 6 +- .../invalid/class-expr/actual.html | 4 +- .../invalid/class-expr/metadata.json | 8 +- .../invalid/comma-operator/actual.html | 2 +- .../invalid/comma-operator/metadata.json | 8 +- .../invalid/delete-operator/actual.html | 2 +- .../invalid/delete-operator/metadata.json | 6 +- .../invalid/function-expr/actual.html | 2 +- .../invalid/function-expr/metadata.json | 6 +- .../invalid/import-meta/actual.html | 2 +- .../invalid/import-meta/metadata.json | 8 +- .../invalid/import/actual.html | 2 +- .../invalid/import/metadata.json | 6 +- .../invalid/new-operator/actual.html | 2 +- .../invalid/new-operator/metadata.json | 6 +- .../invalid/regexp-literal/actual.html | 2 +- .../invalid/regexp-literal/metadata.json | 6 +- .../invalid/super/actual.html | 2 +- .../invalid/this/actual.html | 2 +- .../invalid/this/metadata.json | 6 +- .../invalid/throw/actual.html | 2 +- .../attribute/actual.html | 2 +- .../attribute/metadata.json | 6 +- .../text-content/metadata.json | 4 +- .../invalid/yield/actual.html | 2 +- .../valid/array-expr/actual.html | 2 +- .../valid/array-expr/ast.json | 204 ++------ .../valid/arrowfn-scoped-vars/actual.html | 4 +- .../valid/arrowfn-scoped-vars/ast.json | 22 +- .../valid/assignment-inside-arrow/actual.html | 2 +- .../valid/assignment-inside-arrow/ast.json | 36 +- .../valid/binary-expr-arithmetic/actual.html | 8 +- .../valid/binary-expr-arithmetic/ast.json | 412 +++++----------- .../valid/binary-expr-bit-shift/actual.html | 6 +- .../valid/binary-expr-bit-shift/ast.json | 100 ++-- .../valid/binary-expr-bitwise/actual.html | 6 +- .../valid/binary-expr-bitwise/ast.json | 310 ++++-------- .../valid/binary-expr-logical/actual.html | 4 +- .../valid/binary-expr-logical/ast.json | 208 +++----- .../valid/binary-expr-relational/actual.html | 4 +- .../valid/binary-expr-relational/ast.json | 378 +------------- .../valid/binary-expr-relational/expected.js | 53 -- .../boolean-literal-attribute/actual.html | 3 - .../valid/boolean-literal-attribute/ast.json | 1 - .../boolean-literal-attribute/config.json | 3 - .../boolean-literal-attribute/expected.js | 0 .../boolean-literal-attribute/metadata.json | 3 - .../valid/call-expr/actual.html | 2 +- .../valid/call-expr/ast.json | 88 ++-- .../valid/computed-property/actual.html | 2 +- .../valid/computed-property/ast.json | 436 ++++------------- .../valid/identifier/actual.html | 8 +- .../valid/identifier/ast.json | 276 +++++------ .../valid/iterator/actual.html | 2 +- .../valid/iterator/ast.json | 38 +- .../valid/member-expr/actual.html | 4 +- .../valid/member-expr/ast.json | 244 +++------ .../valid/null-literal/actual.html | 2 +- .../valid/null-literal/ast.json | 70 ++- .../valid/numeric-literal-int/actual.html | 2 +- .../valid/numeric-literal-int/ast.json | 70 ++- .../valid/object-expr/ast.json | 321 +----------- .../valid/object-expr/expected.js | 45 -- .../valid/optional-call-expr/actual.html | 2 +- .../valid/optional-call-expr/ast.json | 160 ++---- .../valid/string-literal/actual.html | 2 +- .../valid/string-literal/ast.json | 70 ++- .../valid/template-literal-tagged/actual.html | 2 +- .../valid/template-literal-tagged/ast.json | 321 +----------- .../valid/template-literal-tagged/expected.js | 43 -- .../valid/template-literal/actual.html | 2 +- .../valid/template-literal/ast.json | 331 +------------ .../valid/template-literal/expected.js | 42 -- .../valid/ternary/actual.html | 6 +- .../expression-complex/valid/ternary/ast.json | 418 ++++------------ .../valid/text-node-adjacency/ast.json | 462 +++++------------- .../valid/typeof-operator/actual.html | 2 +- .../valid/typeof-operator/ast.json | 36 +- .../valid/unary-expr-bitwise/actual.html | 2 +- .../valid/unary-expr-bitwise/ast.json | 88 ++-- .../valid/update-inside-arrow/actual.html | 2 +- .../valid/update-inside-arrow/ast.json | 36 +- .../valid/void-operator/actual.html | 2 +- .../valid/void-operator/ast.json | 36 +- 93 files changed, 1261 insertions(+), 4321 deletions(-) delete mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html delete mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json delete mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json delete mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/expected.js delete mode 100644 packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/actual.html index 7b9d86cc8b..98c17f9430 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/metadata.json index 072ad08348..125a391f66 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 25 + "column": 17, + "start": 41, + "length": 37 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/actual.html index 83c8c6fd6e..4119f90fe5 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/metadata.json index 834029698c..13f365157e 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 24 + "column": 17, + "start": 41, + "length": 36 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/actual.html index 5372eeb66a..462eb584fa 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/metadata.json index 1afa9ed630..42d78ad3e4 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/assignment-outside-arrow/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 15 + "column": 17, + "start": 41, + "length": 27 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/actual.html index 443d261dfe..8b79924f62 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/metadata.json index 7cd08ff00b..c72b606d59 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/await/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 11 + "column": 17, + "start": 41, + "length": 23 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/actual.html index df48808c74..c1bbb84453 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/metadata.json index c98ec2989a..ac275cc1e9 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/bigint-literal/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 22, - "start": 47, - "length": 19 + "column": 18, + "start": 42, + "length": 27 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/actual.html index 904ab24ee9..2014e4c04c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/actual.html @@ -1,9 +1,9 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/metadata.json index c855828f9a..dfbce8e407 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/class-expr/metadata.json @@ -5,10 +5,10 @@ "message": "Invalid expression {\n class Bar {\n method() {}\n }\n } - LWC1196: Use of classes is disallowed within template expressions.", "level": 1, "location": { - "line": 4, - "column": 12, - "start": 62, - "length": 53 + "line": 3, + "column": 16, + "start": 40, + "length": 87 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/actual.html index 8a19cbc670..7e4c3e9d56 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/metadata.json index da7a6c9568..2d44455d65 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comma-operator/metadata.json @@ -2,13 +2,13 @@ "warnings": [ { "code": 1196, - "message": "Invalid expression {(one(), two(), three(), iAmTheCount())} - LWC1196: Use of comma operators is disallowed within template expressions.", + "message": "Invalid expression {one(), two(), three(), iAmTheCount()} - LWC1196: Use of comma operators is disallowed within template expressions.", "level": 1, "location": { "line": 3, - "column": 26, - "start": 51, - "length": 36 + "column": 17, + "start": 41, + "length": 48 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/actual.html index 6bcb80ee5e..ada7d2e1eb 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/metadata.json index af2fa0e971..bb5a747c95 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/delete-operator/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 16 + "column": 17, + "start": 41, + "length": 28 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/actual.html index 28b8ea3fe9..b5cce8563d 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/metadata.json index fdcd8ef506..5ac6889b0d 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/function-expr/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 33, - "start": 58, - "length": 40 + "column": 18, + "start": 42, + "length": 59 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/actual.html index 84ff5ed962..bcb68ac353 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/metadata.json index 929441d4a4..75fcb100f3 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import-meta/metadata.json @@ -1,12 +1,14 @@ { "warnings": [ { - "code": 1052, - "message": "Unexpected compilation error: LWC1052: Error parsing attribute: Cannot use 'import.meta' outside a module (3:39)", + "code": 1083, + "message": "LWC1083: Error parsing template expression: Invalid expression {() => doThing(import.meta.env.SSR)} - Cannot use 'import.meta' outside a module (1:15)", "level": 1, "location": { "line": 3, - "column": 39 + "column": 17, + "start": 41, + "length": 46 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/actual.html index 2e433ccc0c..cfb4be22af 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/metadata.json index 022f61d079..8f5504f00c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/import/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 40 + "column": 17, + "start": 41, + "length": 52 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/actual.html index 7d707ee56d..4455ae723f 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/metadata.json index a1c04d87e7..3f63509ea2 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/new-operator/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 23, - "start": 48, - "length": 15 + "column": 16, + "start": 40, + "length": 26 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/actual.html index 80884d319c..0220011fed 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/metadata.json index 044f6cb402..9609d0a88f 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/regexp-literal/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 10 + "column": 18, + "start": 42, + "length": 21 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/super/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/super/actual.html index 7ddb82cacc..ad3588ca52 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/super/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/super/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/actual.html index f983765faa..c827c92ac8 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/metadata.json index 622b89a5ab..d6788165cd 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/this/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 21, - "start": 46, - "length": 8 + "column": 17, + "start": 41, + "length": 16 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/throw/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/throw/actual.html index 40674b5e76..efae0e536e 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/throw/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/throw/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/actual.html index 6bd8e6d6f1..ae69cb6f91 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/metadata.json index 6c64ab33ed..62bc290eed 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/attribute/metadata.json @@ -6,9 +6,9 @@ "level": 1, "location": { "line": 3, - "column": 25, - "start": 50, - "length": 5 + "column": 17, + "start": 41, + "length": 17 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/text-content/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/text-content/metadata.json index a0820de186..70275ffbdd 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/text-content/metadata.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/update-outside-arrow/text-content/metadata.json @@ -7,8 +7,8 @@ "location": { "line": 3, "column": 17, - "start": 42, - "length": 10 + "start": 41, + "length": 12 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/yield/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/yield/actual.html index 319c6e31cb..03d93b30ef 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/yield/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/yield/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/actual.html index 703e2345f4..4375831f07 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/actual.html @@ -1,6 +1,6 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/ast.json index 1077cc1416..244f5d23ab 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/array-expr/ast.json @@ -7,7 +7,7 @@ "endLine": 6, "endColumn": 12, "start": 0, - "end": 136, + "end": 138, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 6, "endColumn": 12, - "start": 125, - "end": 136 + "start": 127, + "end": 138 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 5, "endColumn": 15, "start": 15, - "end": 124, + "end": 126, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 5, "endColumn": 15, - "start": 114, - "end": 124 + "start": 116, + "end": 126 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 48, + "endColumn": 50, "start": 33, - "end": 72, + "end": 74, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 39, + "endColumn": 41, "start": 33, - "end": 63 + "end": 65 }, "endTag": { "startLine": 3, - "startColumn": 39, + "startColumn": 41, "endLine": 3, - "endColumn": 48, - "start": 63, - "end": 72 + "endColumn": 50, + "start": 65, + "end": 74 } }, "attributes": [], @@ -124,18 +124,18 @@ "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 38, + "endColumn": 40, "start": 41, - "end": 62 + "end": 64 } }, "location": { "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 38, + "endColumn": 40, "start": 41, - "end": 62 + "end": 64 } } ], @@ -148,118 +148,34 @@ "raw": "{['flop', floo, 2].join('')}", "value": { "type": "CallExpression", - "start": 82, - "end": 108, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 82, - 108 - ], + "start": 1, + "end": 27, "callee": { "type": "MemberExpression", - "start": 82, - "end": 104, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 31 - } - }, - "range": [ - 82, - 104 - ], + "start": 1, + "end": 23, "object": { "type": "ArrayExpression", - "start": 82, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 26 - } - }, - "range": [ - 82, - 99 - ], + "start": 1, + "end": 18, "elements": [ { "type": "Literal", - "start": 83, - "end": 89, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 16 - } - }, - "range": [ - 83, - 89 - ], + "start": 2, + "end": 8, "value": "flop", "raw": "'flop'" }, { "type": "Identifier", - "start": 91, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 22 - } - }, - "range": [ - 91, - 95 - ], + "start": 10, + "end": 14, "name": "floo" }, { "type": "Literal", - "start": 97, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 25 - } - }, - "range": [ - 97, - 98 - ], + "start": 16, + "end": 17, "value": 2, "raw": "2" } @@ -267,22 +183,8 @@ }, "property": { "type": "Identifier", - "start": 100, - "end": 104, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 31 - } - }, - "range": [ - 100, - 104 - ], + "start": 19, + "end": 23, "name": "join" }, "computed": false, @@ -291,43 +193,29 @@ "arguments": [ { "type": "Literal", - "start": 105, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "range": [ - 105, - 107 - ], + "start": 24, + "end": 26, "value": "", "raw": "''" } ], "optional": false, "location": { - "startLine": 4, - "startColumn": 9, - "endLine": 4, - "endColumn": 37, - "start": 81, - "end": 109 + "startLine": 3, + "startColumn": 50, + "endLine": 5, + "endColumn": 5, + "start": 74, + "end": 116 } }, "location": { - "startLine": 4, - "startColumn": 9, - "endLine": 4, - "endColumn": 37, - "start": 81, - "end": 109 + "startLine": 3, + "startColumn": 50, + "endLine": 5, + "endColumn": 5, + "start": 74, + "end": 116 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/actual.html index a3a103a836..7faed23141 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/actual.html @@ -1,10 +1,10 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/ast.json index 2d6f2180bb..ed667367ba 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/arrowfn-scoped-vars/ast.json @@ -7,7 +7,7 @@ "endLine": 10, "endColumn": 12, "start": 0, - "end": 188, + "end": 190, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 10, "endColumn": 12, - "start": 177, - "end": 188 + "start": 179, + "end": 190 } }, "directives": [], @@ -37,22 +37,22 @@ "endLine": 9, "endColumn": 15, "start": 15, - "end": 176, + "end": 178, "startTag": { "startLine": 2, "startColumn": 5, "endLine": 9, "endColumn": 6, "start": 15, - "end": 167 + "end": 169 }, "endTag": { "startLine": 9, "startColumn": 6, "endLine": 9, "endColumn": 15, - "start": 167, - "end": 176 + "start": 169, + "end": 178 } }, "attributes": [], @@ -178,18 +178,18 @@ "startLine": 3, "startColumn": 9, "endLine": 8, - "endColumn": 11, + "endColumn": 12, "start": 31, - "end": 161 + "end": 163 } }, "location": { "startLine": 3, "startColumn": 9, "endLine": 8, - "endColumn": 11, + "endColumn": 12, "start": 31, - "end": 161 + "end": 163 } } ], diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/actual.html index 6a2cc5fce1..f8eaca1ae9 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/ast.json index 98640a30a1..c0cf7aefcd 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/assignment-inside-arrow/ast.json @@ -7,7 +7,7 @@ "endLine": 5, "endColumn": 12, "start": 0, - "end": 109, + "end": 111, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 5, "endColumn": 12, - "start": 98, - "end": 109 + "start": 100, + "end": 111 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 4, "endColumn": 15, "start": 15, - "end": 97, + "end": 99, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 4, "endColumn": 15, - "start": 87, - "end": 97 + "start": 89, + "end": 99 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 58, + "endColumn": 60, "start": 33, - "end": 82, + "end": 84, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 49, + "endColumn": 51, "start": 33, - "end": 73 + "end": 75 }, "endTag": { "startLine": 3, - "startColumn": 49, + "startColumn": 51, "endLine": 3, - "endColumn": 58, - "start": 73, - "end": 82 + "endColumn": 60, + "start": 75, + "end": 84 } }, "attributes": [], @@ -127,18 +127,18 @@ "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 48, + "endColumn": 50, "start": 41, - "end": 72 + "end": 74 } }, "location": { "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 48, + "endColumn": 50, "start": 41, - "end": 72 + "end": 74 } } ], diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/actual.html index 4dfe3589c4..fddd0ca932 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/actual.html @@ -1,8 +1,8 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/ast.json index 481bf10998..5e3ca422c5 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-arithmetic/ast.json @@ -7,7 +7,7 @@ "endLine": 8, "endColumn": 12, "start": 0, - "end": 269, + "end": 277, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 8, "endColumn": 12, - "start": 258, - "end": 269 + "start": 266, + "end": 277 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 7, "endColumn": 15, "start": 15, - "end": 257, + "end": 265, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 7, "endColumn": 15, - "start": 247, - "end": 257 + "start": 255, + "end": 265 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 54, + "endColumn": 56, "start": 33, - "end": 78, + "end": 80, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 34, + "endColumn": 36, "start": 33, - "end": 58 + "end": 60 }, "endTag": { "startLine": 3, - "startColumn": 45, + "startColumn": 47, "endLine": 3, - "endColumn": 54, - "start": 69, - "end": 78 + "endColumn": 56, + "start": 71, + "end": 80 } }, "attributes": [], @@ -115,18 +115,18 @@ "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 33, + "endColumn": 35, "start": 41, - "end": 57 + "end": 59 } }, "location": { "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 33, + "endColumn": 35, "start": 41, - "end": 57 + "end": 59 } } ], @@ -138,79 +138,37 @@ "raw": "{foo + bar}", "value": { "type": "BinaryExpression", - "start": 59, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 59, - 68 - ], + "start": 1, + "end": 10, "left": { "type": "Identifier", - "start": 59, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 37 - } - }, - "range": [ - 59, - 62 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "+", "right": { "type": "Identifier", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 65, - 68 - ], + "start": 7, + "end": 10, "name": "bar" }, "location": { "startLine": 3, - "startColumn": 34, + "startColumn": 36, "endLine": 3, - "endColumn": 45, - "start": 58, - "end": 69 + "endColumn": 47, + "start": 60, + "end": 71 } }, "location": { "startLine": 3, - "startColumn": 34, + "startColumn": 36, "endLine": 3, - "endColumn": 45, - "start": 58, - "end": 69 + "endColumn": 47, + "start": 60, + "end": 71 } } ] @@ -223,24 +181,24 @@ "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 54, - "start": 87, - "end": 132, + "endColumn": 56, + "start": 89, + "end": 136, "startTag": { "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 34, - "start": 87, - "end": 112 + "endColumn": 36, + "start": 89, + "end": 116 }, "endTag": { "startLine": 4, - "startColumn": 45, + "startColumn": 47, "endLine": 4, - "endColumn": 54, - "start": 123, - "end": 132 + "endColumn": 56, + "start": 127, + "end": 136 } }, "attributes": [], @@ -270,18 +228,18 @@ "startLine": 4, "startColumn": 17, "endLine": 4, - "endColumn": 33, - "start": 95, - "end": 111 + "endColumn": 35, + "start": 97, + "end": 115 } }, "location": { "startLine": 4, "startColumn": 17, "endLine": 4, - "endColumn": 33, - "start": 95, - "end": 111 + "endColumn": 35, + "start": 97, + "end": 115 } } ], @@ -293,79 +251,37 @@ "raw": "{foo / bar}", "value": { "type": "BinaryExpression", - "start": 113, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 113, - 122 - ], + "start": 1, + "end": 10, "left": { "type": "Identifier", - "start": 113, - "end": 116, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 37 - } - }, - "range": [ - 113, - 116 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "/", "right": { "type": "Identifier", - "start": 119, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 40 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 119, - 122 - ], + "start": 7, + "end": 10, "name": "bar" }, "location": { "startLine": 4, - "startColumn": 34, + "startColumn": 36, "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 + "endColumn": 47, + "start": 116, + "end": 127 } }, "location": { "startLine": 4, - "startColumn": 34, + "startColumn": 36, "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 + "endColumn": 47, + "start": 116, + "end": 127 } } ] @@ -378,24 +294,24 @@ "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 56, - "start": 141, - "end": 188, + "endColumn": 58, + "start": 145, + "end": 194, "startTag": { "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 35, - "start": 141, - "end": 167 + "endColumn": 37, + "start": 145, + "end": 173 }, "endTag": { "startLine": 5, - "startColumn": 47, + "startColumn": 49, "endLine": 5, - "endColumn": 56, - "start": 179, - "end": 188 + "endColumn": 58, + "start": 185, + "end": 194 } }, "attributes": [], @@ -425,18 +341,18 @@ "startLine": 5, "startColumn": 17, "endLine": 5, - "endColumn": 34, - "start": 149, - "end": 166 + "endColumn": 36, + "start": 153, + "end": 172 } }, "location": { "startLine": 5, "startColumn": 17, "endLine": 5, - "endColumn": 34, - "start": 149, - "end": 166 + "endColumn": 36, + "start": 153, + "end": 172 } } ], @@ -448,79 +364,37 @@ "raw": "{foo ** bar}", "value": { "type": "BinaryExpression", - "start": 168, - "end": 178, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 45 - } - }, - "range": [ - 168, - 178 - ], + "start": 1, + "end": 11, "left": { "type": "Identifier", - "start": 168, - "end": 171, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 38 - } - }, - "range": [ - 168, - 171 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "**", "right": { "type": "Identifier", - "start": 175, - "end": 178, - "loc": { - "start": { - "line": 5, - "column": 42 - }, - "end": { - "line": 5, - "column": 45 - } - }, - "range": [ - 175, - 178 - ], + "start": 8, + "end": 11, "name": "bar" }, "location": { "startLine": 5, - "startColumn": 35, + "startColumn": 37, "endLine": 5, - "endColumn": 47, - "start": 167, - "end": 179 + "endColumn": 49, + "start": 173, + "end": 185 } }, "location": { "startLine": 5, - "startColumn": 35, + "startColumn": 37, "endLine": 5, - "endColumn": 47, - "start": 167, - "end": 179 + "endColumn": 49, + "start": 173, + "end": 185 } } ] @@ -533,24 +407,24 @@ "startLine": 6, "startColumn": 9, "endLine": 6, - "endColumn": 54, - "start": 197, - "end": 242, + "endColumn": 56, + "start": 203, + "end": 250, "startTag": { "startLine": 6, "startColumn": 9, "endLine": 6, - "endColumn": 34, - "start": 197, - "end": 222 + "endColumn": 36, + "start": 203, + "end": 230 }, "endTag": { "startLine": 6, - "startColumn": 45, + "startColumn": 47, "endLine": 6, - "endColumn": 54, - "start": 233, - "end": 242 + "endColumn": 56, + "start": 241, + "end": 250 } }, "attributes": [], @@ -580,18 +454,18 @@ "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 33, - "start": 205, - "end": 221 + "endColumn": 35, + "start": 211, + "end": 229 } }, "location": { "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 33, - "start": 205, - "end": 221 + "endColumn": 35, + "start": 211, + "end": 229 } } ], @@ -603,79 +477,37 @@ "raw": "{foo - bar}", "value": { "type": "BinaryExpression", - "start": 223, - "end": 232, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 43 - } - }, - "range": [ - 223, - 232 - ], + "start": 1, + "end": 10, "left": { "type": "Identifier", - "start": 223, - "end": 226, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 37 - } - }, - "range": [ - 223, - 226 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "-", "right": { "type": "Identifier", - "start": 229, - "end": 232, - "loc": { - "start": { - "line": 6, - "column": 40 - }, - "end": { - "line": 6, - "column": 43 - } - }, - "range": [ - 229, - 232 - ], + "start": 7, + "end": 10, "name": "bar" }, "location": { "startLine": 6, - "startColumn": 34, + "startColumn": 36, "endLine": 6, - "endColumn": 45, - "start": 222, - "end": 233 + "endColumn": 47, + "start": 230, + "end": 241 } }, "location": { "startLine": 6, - "startColumn": 34, + "startColumn": 36, "endLine": 6, - "endColumn": 45, - "start": 222, - "end": 233 + "endColumn": 47, + "start": 230, + "end": 241 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/actual.html index fb7858046c..302bc9f9c4 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/actual.html @@ -1,7 +1,7 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/ast.json index b9656bd8a8..dbfb86a83c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bit-shift/ast.json @@ -7,7 +7,7 @@ "endLine": 7, "endColumn": 12, "start": 0, - "end": 190, + "end": 196, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 7, "endColumn": 12, - "start": 179, - "end": 190 + "start": 185, + "end": 196 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 6, "endColumn": 15, "start": 15, - "end": 178, + "end": 184, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 6, "endColumn": 15, - "start": 168, - "end": 178 + "start": 174, + "end": 184 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 46, + "endColumn": 48, "start": 33, - "end": 70, + "end": 72, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 36, + "endColumn": 38, "start": 33, - "end": 60 + "end": 62 }, "endTag": { "startLine": 3, - "startColumn": 36, + "startColumn": 38, "endLine": 3, - "endColumn": 46, - "start": 60, - "end": 70 + "endColumn": 48, + "start": 62, + "end": 72 } }, "attributes": [], @@ -115,18 +115,18 @@ "startLine": 3, "startColumn": 18, "endLine": 3, - "endColumn": 35, + "endColumn": 37, "start": 42, - "end": 59 + "end": 61 } }, "location": { "startLine": 3, "startColumn": 18, "endLine": 3, - "endColumn": 35, + "endColumn": 37, "start": 42, - "end": 59 + "end": 61 } } ], @@ -142,24 +142,24 @@ "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 46, - "start": 79, - "end": 116, + "endColumn": 48, + "start": 81, + "end": 120, "startTag": { "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 36, - "start": 79, - "end": 106 + "endColumn": 38, + "start": 81, + "end": 110 }, "endTag": { "startLine": 4, - "startColumn": 36, + "startColumn": 38, "endLine": 4, - "endColumn": 46, - "start": 106, - "end": 116 + "endColumn": 48, + "start": 110, + "end": 120 } }, "attributes": [], @@ -189,18 +189,18 @@ "startLine": 4, "startColumn": 18, "endLine": 4, - "endColumn": 35, - "start": 88, - "end": 105 + "endColumn": 37, + "start": 90, + "end": 109 } }, "location": { "startLine": 4, "startColumn": 18, "endLine": 4, - "endColumn": 35, - "start": 88, - "end": 105 + "endColumn": 37, + "start": 90, + "end": 109 } } ], @@ -216,24 +216,24 @@ "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 47, - "start": 125, - "end": 163, + "endColumn": 49, + "start": 129, + "end": 169, "startTag": { "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 37, - "start": 125, - "end": 153 + "endColumn": 39, + "start": 129, + "end": 159 }, "endTag": { "startLine": 5, - "startColumn": 37, + "startColumn": 39, "endLine": 5, - "endColumn": 47, - "start": 153, - "end": 163 + "endColumn": 49, + "start": 159, + "end": 169 } }, "attributes": [], @@ -263,18 +263,18 @@ "startLine": 5, "startColumn": 18, "endLine": 5, - "endColumn": 36, - "start": 134, - "end": 152 + "endColumn": 38, + "start": 138, + "end": 158 } }, "location": { "startLine": 5, "startColumn": 18, "endLine": 5, - "endColumn": 36, - "start": 134, - "end": 152 + "endColumn": 38, + "start": 138, + "end": 158 } } ], diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/actual.html index a2627f0f3e..c05cd3307b 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/actual.html @@ -1,7 +1,7 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/ast.json index fcb1bd4e1c..bb84d2a90e 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-bitwise/ast.json @@ -7,7 +7,7 @@ "endLine": 7, "endColumn": 12, "start": 0, - "end": 219, + "end": 225, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 7, "endColumn": 12, - "start": 208, - "end": 219 + "start": 214, + "end": 225 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 6, "endColumn": 15, "start": 15, - "end": 207, + "end": 213, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 6, "endColumn": 15, - "start": 197, - "end": 207 + "start": 203, + "end": 213 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 56, + "endColumn": 58, "start": 33, - "end": 80, + "end": 82, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 35, + "endColumn": 37, "start": 33, - "end": 59 + "end": 61 }, "endTag": { "startLine": 3, - "startColumn": 46, + "startColumn": 48, "endLine": 3, - "endColumn": 56, - "start": 70, - "end": 80 + "endColumn": 58, + "start": 72, + "end": 82 } }, "attributes": [], @@ -115,18 +115,18 @@ "startLine": 3, "startColumn": 18, "endLine": 3, - "endColumn": 34, + "endColumn": 36, "start": 42, - "end": 58 + "end": 60 } }, "location": { "startLine": 3, "startColumn": 18, "endLine": 3, - "endColumn": 34, + "endColumn": 36, "start": 42, - "end": 58 + "end": 60 } } ], @@ -138,79 +138,37 @@ "raw": "{foo & bar}", "value": { "type": "BinaryExpression", - "start": 60, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 44 - } - }, - "range": [ - 60, - 69 - ], + "start": 1, + "end": 10, "left": { "type": "Identifier", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 38 - } - }, - "range": [ - 60, - 63 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "&", "right": { "type": "Identifier", - "start": 66, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 41 - }, - "end": { - "line": 3, - "column": 44 - } - }, - "range": [ - 66, - 69 - ], + "start": 7, + "end": 10, "name": "bar" }, "location": { "startLine": 3, - "startColumn": 35, + "startColumn": 37, "endLine": 3, - "endColumn": 46, - "start": 59, - "end": 70 + "endColumn": 48, + "start": 61, + "end": 72 } }, "location": { "startLine": 3, - "startColumn": 35, + "startColumn": 37, "endLine": 3, - "endColumn": 46, - "start": 59, - "end": 70 + "endColumn": 48, + "start": 61, + "end": 72 } } ] @@ -223,24 +181,24 @@ "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 56, - "start": 89, - "end": 136, + "endColumn": 58, + "start": 91, + "end": 140, "startTag": { "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 35, - "start": 89, - "end": 115 + "endColumn": 37, + "start": 91, + "end": 119 }, "endTag": { "startLine": 4, - "startColumn": 46, + "startColumn": 48, "endLine": 4, - "endColumn": 56, - "start": 126, - "end": 136 + "endColumn": 58, + "start": 130, + "end": 140 } }, "attributes": [], @@ -270,18 +228,18 @@ "startLine": 4, "startColumn": 18, "endLine": 4, - "endColumn": 34, - "start": 98, - "end": 114 + "endColumn": 36, + "start": 100, + "end": 118 } }, "location": { "startLine": 4, "startColumn": 18, "endLine": 4, - "endColumn": 34, - "start": 98, - "end": 114 + "endColumn": 36, + "start": 100, + "end": 118 } } ], @@ -293,79 +251,37 @@ "raw": "{foo | bar}", "value": { "type": "BinaryExpression", - "start": 116, - "end": 125, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 44 - } - }, - "range": [ - 116, - 125 - ], + "start": 1, + "end": 10, "left": { "type": "Identifier", - "start": 116, - "end": 119, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 38 - } - }, - "range": [ - 116, - 119 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "|", "right": { "type": "Identifier", - "start": 122, - "end": 125, - "loc": { - "start": { - "line": 4, - "column": 41 - }, - "end": { - "line": 4, - "column": 44 - } - }, - "range": [ - 122, - 125 - ], + "start": 7, + "end": 10, "name": "bar" }, "location": { "startLine": 4, - "startColumn": 35, + "startColumn": 37, "endLine": 4, - "endColumn": 46, - "start": 115, - "end": 126 + "endColumn": 48, + "start": 119, + "end": 130 } }, "location": { "startLine": 4, - "startColumn": 35, + "startColumn": 37, "endLine": 4, - "endColumn": 46, - "start": 115, - "end": 126 + "endColumn": 48, + "start": 119, + "end": 130 } } ] @@ -378,24 +294,24 @@ "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 56, - "start": 145, - "end": 192, + "endColumn": 58, + "start": 149, + "end": 198, "startTag": { "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 35, - "start": 145, - "end": 171 + "endColumn": 37, + "start": 149, + "end": 177 }, "endTag": { "startLine": 5, - "startColumn": 46, + "startColumn": 48, "endLine": 5, - "endColumn": 56, - "start": 182, - "end": 192 + "endColumn": 58, + "start": 188, + "end": 198 } }, "attributes": [], @@ -425,18 +341,18 @@ "startLine": 5, "startColumn": 18, "endLine": 5, - "endColumn": 34, - "start": 154, - "end": 170 + "endColumn": 36, + "start": 158, + "end": 176 } }, "location": { "startLine": 5, "startColumn": 18, "endLine": 5, - "endColumn": 34, - "start": 154, - "end": 170 + "endColumn": 36, + "start": 158, + "end": 176 } } ], @@ -448,79 +364,37 @@ "raw": "{foo ^ bar}", "value": { "type": "BinaryExpression", - "start": 172, - "end": 181, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 44 - } - }, - "range": [ - 172, - 181 - ], + "start": 1, + "end": 10, "left": { "type": "Identifier", - "start": 172, - "end": 175, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 38 - } - }, - "range": [ - 172, - 175 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "^", "right": { "type": "Identifier", - "start": 178, - "end": 181, - "loc": { - "start": { - "line": 5, - "column": 41 - }, - "end": { - "line": 5, - "column": 44 - } - }, - "range": [ - 178, - 181 - ], + "start": 7, + "end": 10, "name": "bar" }, "location": { "startLine": 5, - "startColumn": 35, + "startColumn": 37, "endLine": 5, - "endColumn": 46, - "start": 171, - "end": 182 + "endColumn": 48, + "start": 177, + "end": 188 } }, "location": { "startLine": 5, - "startColumn": 35, + "startColumn": 37, "endLine": 5, - "endColumn": 46, - "start": 171, - "end": 182 + "endColumn": 48, + "start": 177, + "end": 188 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/actual.html index 2cf4c0826d..ac4be05d34 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/actual.html @@ -1,6 +1,6 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/ast.json index b86f36d766..db136b7671 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-logical/ast.json @@ -7,7 +7,7 @@ "endLine": 6, "endColumn": 12, "start": 0, - "end": 163, + "end": 167, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 6, "endColumn": 12, - "start": 152, - "end": 163 + "start": 156, + "end": 167 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 5, "endColumn": 15, "start": 15, - "end": 151, + "end": 155, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 5, "endColumn": 15, - "start": 141, - "end": 151 + "start": 145, + "end": 155 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 56, + "endColumn": 58, "start": 33, - "end": 80, + "end": 82, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 35, + "endColumn": 37, "start": 33, - "end": 59 + "end": 61 }, "endTag": { "startLine": 3, - "startColumn": 47, + "startColumn": 49, "endLine": 3, - "endColumn": 56, - "start": 71, - "end": 80 + "endColumn": 58, + "start": 73, + "end": 82 } }, "attributes": [], @@ -115,18 +115,18 @@ "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 34, + "endColumn": 36, "start": 41, - "end": 58 + "end": 60 } }, "location": { "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 34, + "endColumn": 36, "start": 41, - "end": 58 + "end": 60 } } ], @@ -138,79 +138,37 @@ "raw": "{foo || bar}", "value": { "type": "LogicalExpression", - "start": 60, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 45 - } - }, - "range": [ - 60, - 70 - ], + "start": 1, + "end": 11, "left": { "type": "Identifier", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 38 - } - }, - "range": [ - 60, - 63 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "||", "right": { "type": "Identifier", - "start": 67, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 42 - }, - "end": { - "line": 3, - "column": 45 - } - }, - "range": [ - 67, - 70 - ], + "start": 8, + "end": 11, "name": "bar" }, "location": { "startLine": 3, - "startColumn": 35, + "startColumn": 37, "endLine": 3, - "endColumn": 47, - "start": 59, - "end": 71 + "endColumn": 49, + "start": 61, + "end": 73 } }, "location": { "startLine": 3, - "startColumn": 35, + "startColumn": 37, "endLine": 3, - "endColumn": 47, - "start": 59, - "end": 71 + "endColumn": 49, + "start": 61, + "end": 73 } } ] @@ -223,24 +181,24 @@ "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 56, - "start": 89, - "end": 136, + "endColumn": 58, + "start": 91, + "end": 140, "startTag": { "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 35, - "start": 89, - "end": 115 + "endColumn": 37, + "start": 91, + "end": 119 }, "endTag": { "startLine": 4, - "startColumn": 47, + "startColumn": 49, "endLine": 4, - "endColumn": 56, - "start": 127, - "end": 136 + "endColumn": 58, + "start": 131, + "end": 140 } }, "attributes": [], @@ -270,18 +228,18 @@ "startLine": 4, "startColumn": 17, "endLine": 4, - "endColumn": 34, - "start": 97, - "end": 114 + "endColumn": 36, + "start": 99, + "end": 118 } }, "location": { "startLine": 4, "startColumn": 17, "endLine": 4, - "endColumn": 34, - "start": 97, - "end": 114 + "endColumn": 36, + "start": 99, + "end": 118 } } ], @@ -293,79 +251,37 @@ "raw": "{foo && bar}", "value": { "type": "LogicalExpression", - "start": 116, - "end": 126, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 45 - } - }, - "range": [ - 116, - 126 - ], + "start": 1, + "end": 11, "left": { "type": "Identifier", - "start": 116, - "end": 119, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 38 - } - }, - "range": [ - 116, - 119 - ], + "start": 1, + "end": 4, "name": "foo" }, "operator": "&&", "right": { "type": "Identifier", - "start": 123, - "end": 126, - "loc": { - "start": { - "line": 4, - "column": 42 - }, - "end": { - "line": 4, - "column": 45 - } - }, - "range": [ - 123, - 126 - ], + "start": 8, + "end": 11, "name": "bar" }, "location": { "startLine": 4, - "startColumn": 35, + "startColumn": 37, "endLine": 4, - "endColumn": 47, - "start": 115, - "end": 127 + "endColumn": 49, + "start": 119, + "end": 131 } }, "location": { "startLine": 4, - "startColumn": 35, + "startColumn": 37, "endLine": 4, - "endColumn": 47, - "start": 115, - "end": 127 + "endColumn": 49, + "start": 119, + "end": 131 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/actual.html index 0a33a38fef..0953e1e726 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/actual.html @@ -1,6 +1,6 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/ast.json index 0b63da31df..9e26dfeeb6 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/ast.json @@ -1,377 +1 @@ -{ - "root": { - "type": "Root", - "location": { - "startLine": 1, - "startColumn": 1, - "endLine": 6, - "endColumn": 12, - "start": 0, - "end": 159, - "startTag": { - "startLine": 1, - "startColumn": 1, - "endLine": 1, - "endColumn": 11, - "start": 0, - "end": 10 - }, - "endTag": { - "startLine": 6, - "startColumn": 1, - "endLine": 6, - "endColumn": 12, - "start": 148, - "end": 159 - } - }, - "directives": [], - "children": [ - { - "type": "Element", - "name": "section", - "namespace": "http://www.w3.org/1999/xhtml", - "location": { - "startLine": 2, - "startColumn": 5, - "endLine": 5, - "endColumn": 15, - "start": 15, - "end": 147, - "startTag": { - "startLine": 2, - "startColumn": 5, - "endLine": 2, - "endColumn": 14, - "start": 15, - "end": 24 - }, - "endTag": { - "startLine": 5, - "startColumn": 5, - "endLine": 5, - "endColumn": 15, - "start": 137, - "end": 147 - } - }, - "attributes": [], - "properties": [], - "directives": [], - "listeners": [], - "children": [ - { - "type": "Component", - "name": "x-pert", - "namespace": "http://www.w3.org/1999/xhtml", - "location": { - "startLine": 3, - "startColumn": 9, - "endLine": 3, - "endColumn": 54, - "start": 33, - "end": 78, - "startTag": { - "startLine": 3, - "startColumn": 9, - "endLine": 3, - "endColumn": 34, - "start": 33, - "end": 58 - }, - "endTag": { - "startLine": 3, - "startColumn": 45, - "endLine": 3, - "endColumn": 54, - "start": 69, - "end": 78 - } - }, - "attributes": [], - "properties": [ - { - "type": "Property", - "name": "attr", - "attributeName": "attr", - "value": { - "type": "BinaryExpression", - "start": 1, - "end": 10, - "left": { - "type": "Identifier", - "start": 1, - "end": 4, - "name": "foo" - }, - "operator": ">", - "right": { - "type": "Identifier", - "start": 7, - "end": 10, - "name": "bar" - }, - "location": { - "startLine": 3, - "startColumn": 17, - "endLine": 3, - "endColumn": 33, - "start": 41, - "end": 57 - } - }, - "location": { - "startLine": 3, - "startColumn": 17, - "endLine": 3, - "endColumn": 33, - "start": 41, - "end": 57 - } - } - ], - "directives": [], - "listeners": [], - "children": [ - { - "type": "Text", - "raw": "{foo > bar}", - "value": { - "type": "BinaryExpression", - "start": 59, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 59, - 68 - ], - "left": { - "type": "Identifier", - "start": 59, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 37 - } - }, - "range": [ - 59, - 62 - ], - "name": "foo" - }, - "operator": ">", - "right": { - "type": "Identifier", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 65, - 68 - ], - "name": "bar" - }, - "location": { - "startLine": 3, - "startColumn": 34, - "endLine": 3, - "endColumn": 45, - "start": 58, - "end": 69 - } - }, - "location": { - "startLine": 3, - "startColumn": 34, - "endLine": 3, - "endColumn": 45, - "start": 58, - "end": 69 - } - } - ] - }, - { - "type": "Component", - "name": "x-pert", - "namespace": "http://www.w3.org/1999/xhtml", - "location": { - "startLine": 4, - "startColumn": 9, - "endLine": 4, - "endColumn": 54, - "start": 87, - "end": 132, - "startTag": { - "startLine": 4, - "startColumn": 9, - "endLine": 4, - "endColumn": 34, - "start": 87, - "end": 112 - }, - "endTag": { - "startLine": 4, - "startColumn": 45, - "endLine": 4, - "endColumn": 54, - "start": 123, - "end": 132 - } - }, - "attributes": [], - "properties": [ - { - "type": "Property", - "name": "attr", - "attributeName": "attr", - "value": { - "type": "BinaryExpression", - "start": 1, - "end": 10, - "left": { - "type": "Identifier", - "start": 1, - "end": 4, - "name": "foo" - }, - "operator": "<", - "right": { - "type": "Identifier", - "start": 7, - "end": 10, - "name": "bar" - }, - "location": { - "startLine": 4, - "startColumn": 17, - "endLine": 4, - "endColumn": 33, - "start": 95, - "end": 111 - } - }, - "location": { - "startLine": 4, - "startColumn": 17, - "endLine": 4, - "endColumn": 33, - "start": 95, - "end": 111 - } - } - ], - "directives": [], - "listeners": [], - "children": [ - { - "type": "Text", - "raw": "{foo < bar}", - "value": { - "type": "BinaryExpression", - "start": 113, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 113, - 122 - ], - "left": { - "type": "Identifier", - "start": 113, - "end": 116, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 37 - } - }, - "range": [ - 113, - 116 - ], - "name": "foo" - }, - "operator": "<", - "right": { - "type": "Identifier", - "start": 119, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 40 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 119, - 122 - ], - "name": "bar" - }, - "location": { - "startLine": 4, - "startColumn": 34, - "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 - } - }, - "location": { - "startLine": 4, - "startColumn": 34, - "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 - } - } - ] - } - ] - } - ] - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/expected.js b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/expected.js index bf577106fe..e69de29bb2 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/expected.js +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/binary-expr-relational/expected.js @@ -1,53 +0,0 @@ -import _implicitStylesheets from "./binary-expr-relational.css"; -import _implicitScopedStylesheets from "./binary-expr-relational.scoped.css?scoped=true"; -import _xPert from "x/pert"; -import { freezeTemplate, registerTemplate } from "lwc"; -const stc0 = { - key: 0, -}; -function tmpl($api, $cmp, $slotset, $ctx) { - const { - d: api_dynamic_text, - t: api_text, - c: api_custom_element, - h: api_element, - } = $api; - return [ - api_element("section", stc0, [ - api_custom_element( - "x-pert", - _xPert, - { - props: { - attr: $cmp.foo > $cmp.bar, - }, - key: 1, - }, - [api_text(api_dynamic_text($cmp.foo > $cmp.bar))] - ), - api_custom_element( - "x-pert", - _xPert, - { - props: { - attr: $cmp.foo < $cmp.bar, - }, - key: 2, - }, - [api_text(api_dynamic_text($cmp.foo < $cmp.bar))] - ), - ]), - ]; - /*LWC compiler vX.X.X*/ -} -export default registerTemplate(tmpl); -tmpl.stylesheets = []; -tmpl.stylesheetToken = "lwc-39eucbo25ji"; -tmpl.legacyStylesheetToken = "x-binary-expr-relational_binary-expr-relational"; -if (_implicitStylesheets) { - tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitStylesheets); -} -if (_implicitScopedStylesheets) { - tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitScopedStylesheets); -} -freezeTemplate(tmpl); diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html deleted file mode 100644 index eeaa34b19d..0000000000 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/actual.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/ast.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json deleted file mode 100644 index 1f1b15380f..0000000000 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "experimentalComplexExpressions": true -} diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/expected.js b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/expected.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json deleted file mode 100644 index 51ec5f799c..0000000000 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/boolean-literal-attribute/metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "warnings": [] -} \ No newline at end of file diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/actual.html index 87d57d81b8..f0e76a6e56 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/actual.html @@ -1,5 +1,5 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/ast.json index 61be6f3ead..fe2840d84a 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/call-expr/ast.json @@ -7,7 +7,7 @@ "endLine": 5, "endColumn": 12, "start": 0, - "end": 103, + "end": 105, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 5, "endColumn": 12, - "start": 92, - "end": 103 + "start": 94, + "end": 105 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 4, "endColumn": 15, "start": 15, - "end": 91, + "end": 93, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 4, "endColumn": 15, - "start": 81, - "end": 91 + "start": 83, + "end": 93 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 52, + "endColumn": 54, "start": 33, - "end": 76, + "end": 78, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 33, + "endColumn": 35, "start": 33, - "end": 57 + "end": 59 }, "endTag": { "startLine": 3, - "startColumn": 43, + "startColumn": 45, "endLine": 3, - "endColumn": 52, - "start": 67, - "end": 76 + "endColumn": 54, + "start": 69, + "end": 78 } }, "attributes": [], @@ -110,18 +110,18 @@ "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 32, + "endColumn": 34, "start": 41, - "end": 56 + "end": 58 } }, "location": { "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 32, + "endColumn": 34, "start": 41, - "end": 56 + "end": 58 } } ], @@ -133,60 +133,32 @@ "raw": "{getBaz()}", "value": { "type": "CallExpression", - "start": 58, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 41 - } - }, - "range": [ - 58, - 66 - ], + "start": 1, + "end": 9, "callee": { "type": "Identifier", - "start": 58, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 39 - } - }, - "range": [ - 58, - 64 - ], + "start": 1, + "end": 7, "name": "getBaz" }, "arguments": [], "optional": false, "location": { "startLine": 3, - "startColumn": 33, + "startColumn": 35, "endLine": 3, - "endColumn": 43, - "start": 57, - "end": 67 + "endColumn": 45, + "start": 59, + "end": 69 } }, "location": { "startLine": 3, - "startColumn": 33, + "startColumn": 35, "endLine": 3, - "endColumn": 43, - "start": 57, - "end": 67 + "endColumn": 45, + "start": 59, + "end": 69 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/actual.html index b6b8ed78d9..0dc80e2b6f 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/actual.html @@ -1,3 +1,3 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/ast.json index 5fd09af8f9..19111a0db2 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/computed-property/ast.json @@ -7,7 +7,7 @@ "endLine": 3, "endColumn": 12, "start": 0, - "end": 123, + "end": 125, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 3, "endColumn": 12, - "start": 112, - "end": 123 + "start": 114, + "end": 125 } }, "directives": [], @@ -35,24 +35,24 @@ "startLine": 2, "startColumn": 5, "endLine": 2, - "endColumn": 101, + "endColumn": 103, "start": 15, - "end": 111, + "end": 113, "startTag": { "startLine": 2, "startColumn": 5, "endLine": 2, - "endColumn": 37, + "endColumn": 39, "start": 15, - "end": 47 + "end": 49 }, "endTag": { "startLine": 2, - "startColumn": 91, + "startColumn": 93, "endLine": 2, - "endColumn": 101, - "start": 101, - "end": 111 + "endColumn": 103, + "start": 103, + "end": 113 } }, "attributes": [], @@ -97,18 +97,18 @@ "startLine": 2, "startColumn": 14, "endLine": 2, - "endColumn": 36, + "endColumn": 38, "start": 24, - "end": 46 + "end": 48 } }, "location": { "startLine": 2, "startColumn": 14, "endLine": 2, - "endColumn": 36, + "endColumn": 38, "start": 24, - "end": 46 + "end": 48 } } ], @@ -118,78 +118,22 @@ "raw": "{bar.arr[baz]}", "value": { "type": "MemberExpression", - "start": 48, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 49 - } - }, - "range": [ - 48, - 60 - ], + "start": 1, + "end": 13, "object": { "type": "MemberExpression", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 44 - } - }, - "range": [ - 48, - 55 - ], + "start": 1, + "end": 8, "object": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 40 - } - }, - "range": [ - 48, - 51 - ], + "start": 1, + "end": 4, "name": "bar" }, "property": { "type": "Identifier", - "start": 52, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 44 - } - }, - "range": [ - 52, - 55 - ], + "start": 5, + "end": 8, "name": "arr" }, "computed": false, @@ -197,42 +141,28 @@ }, "property": { "type": "Identifier", - "start": 56, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 45 - }, - "end": { - "line": 2, - "column": 48 - } - }, - "range": [ - 56, - 59 - ], + "start": 9, + "end": 12, "name": "baz" }, "computed": true, "optional": false, "location": { "startLine": 2, - "startColumn": 37, + "startColumn": 39, "endLine": 2, - "endColumn": 51, - "start": 47, - "end": 61 + "endColumn": 93, + "start": 49, + "end": 103 } }, "location": { "startLine": 2, - "startColumn": 37, + "startColumn": 39, "endLine": 2, - "endColumn": 51, - "start": 47, - "end": 61 + "endColumn": 93, + "start": 49, + "end": 103 } }, { @@ -244,11 +174,11 @@ }, "location": { "startLine": 2, - "startColumn": 51, + "startColumn": 39, "endLine": 2, - "endColumn": 52, - "start": 61, - "end": 62 + "endColumn": 93, + "start": 49, + "end": 103 } }, { @@ -256,96 +186,26 @@ "raw": "{bar.baz.arr[quux]}", "value": { "type": "MemberExpression", - "start": 63, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 69 - } - }, - "range": [ - 63, - 80 - ], + "start": 1, + "end": 18, "object": { "type": "MemberExpression", - "start": 63, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 63 - } - }, - "range": [ - 63, - 74 - ], + "start": 1, + "end": 12, "object": { "type": "MemberExpression", - "start": 63, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 59 - } - }, - "range": [ - 63, - 70 - ], + "start": 1, + "end": 8, "object": { "type": "Identifier", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 55 - } - }, - "range": [ - 63, - 66 - ], + "start": 1, + "end": 4, "name": "bar" }, "property": { "type": "Identifier", - "start": 67, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 56 - }, - "end": { - "line": 2, - "column": 59 - } - }, - "range": [ - 67, - 70 - ], + "start": 5, + "end": 8, "name": "baz" }, "computed": false, @@ -353,22 +213,8 @@ }, "property": { "type": "Identifier", - "start": 71, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 60 - }, - "end": { - "line": 2, - "column": 63 - } - }, - "range": [ - 71, - 74 - ], + "start": 9, + "end": 12, "name": "arr" }, "computed": false, @@ -376,42 +222,28 @@ }, "property": { "type": "Identifier", - "start": 75, - "end": 79, - "loc": { - "start": { - "line": 2, - "column": 64 - }, - "end": { - "line": 2, - "column": 68 - } - }, - "range": [ - 75, - 79 - ], + "start": 13, + "end": 17, "name": "quux" }, "computed": true, "optional": false, "location": { "startLine": 2, - "startColumn": 52, + "startColumn": 39, "endLine": 2, - "endColumn": 71, - "start": 62, - "end": 81 + "endColumn": 93, + "start": 49, + "end": 103 } }, "location": { "startLine": 2, - "startColumn": 52, + "startColumn": 39, "endLine": 2, - "endColumn": 71, - "start": 62, - "end": 81 + "endColumn": 93, + "start": 49, + "end": 103 } }, { @@ -423,11 +255,11 @@ }, "location": { "startLine": 2, - "startColumn": 71, + "startColumn": 39, "endLine": 2, - "endColumn": 72, - "start": 81, - "end": 82 + "endColumn": 93, + "start": 49, + "end": 103 } }, { @@ -435,78 +267,22 @@ "raw": "{bar.arr[baz.quux]}", "value": { "type": "MemberExpression", - "start": 83, - "end": 100, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 89 - } - }, - "range": [ - 83, - 100 - ], + "start": 1, + "end": 18, "object": { "type": "MemberExpression", - "start": 83, - "end": 90, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 79 - } - }, - "range": [ - 83, - 90 - ], + "start": 1, + "end": 8, "object": { "type": "Identifier", - "start": 83, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 75 - } - }, - "range": [ - 83, - 86 - ], + "start": 1, + "end": 4, "name": "bar" }, "property": { "type": "Identifier", - "start": 87, - "end": 90, - "loc": { - "start": { - "line": 2, - "column": 76 - }, - "end": { - "line": 2, - "column": 79 - } - }, - "range": [ - 87, - 90 - ], + "start": 5, + "end": 8, "name": "arr" }, "computed": false, @@ -514,60 +290,18 @@ }, "property": { "type": "MemberExpression", - "start": 91, - "end": 99, - "loc": { - "start": { - "line": 2, - "column": 80 - }, - "end": { - "line": 2, - "column": 88 - } - }, - "range": [ - 91, - 99 - ], + "start": 9, + "end": 17, "object": { "type": "Identifier", - "start": 91, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 80 - }, - "end": { - "line": 2, - "column": 83 - } - }, - "range": [ - 91, - 94 - ], + "start": 9, + "end": 12, "name": "baz" }, "property": { "type": "Identifier", - "start": 95, - "end": 99, - "loc": { - "start": { - "line": 2, - "column": 84 - }, - "end": { - "line": 2, - "column": 88 - } - }, - "range": [ - 95, - 99 - ], + "start": 13, + "end": 17, "name": "quux" }, "computed": false, @@ -577,20 +311,20 @@ "optional": false, "location": { "startLine": 2, - "startColumn": 72, + "startColumn": 39, "endLine": 2, - "endColumn": 91, - "start": 82, - "end": 101 + "endColumn": 93, + "start": 49, + "end": 103 } }, "location": { "startLine": 2, - "startColumn": 72, + "startColumn": 39, "endLine": 2, - "endColumn": 91, - "start": 82, - "end": 101 + "endColumn": 93, + "start": 49, + "end": 103 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/actual.html index 377329abac..539e57b89e 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/actual.html @@ -1,8 +1,8 @@ diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/ast.json index dc3eebe9b1..ba35e43be6 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/identifier/ast.json @@ -7,7 +7,7 @@ "endLine": 8, "endColumn": 12, "start": 0, - "end": 235, + "end": 246, "startTag": { "startLine": 1, "startColumn": 1, @@ -21,8 +21,8 @@ "startColumn": 1, "endLine": 8, "endColumn": 12, - "start": 224, - "end": 235 + "start": 235, + "end": 246 } }, "directives": [], @@ -37,7 +37,7 @@ "endLine": 7, "endColumn": 15, "start": 15, - "end": 223, + "end": 234, "startTag": { "startLine": 2, "startColumn": 5, @@ -51,8 +51,8 @@ "startColumn": 5, "endLine": 7, "endColumn": 15, - "start": 213, - "end": 223 + "start": 224, + "end": 234 } }, "attributes": [], @@ -68,24 +68,24 @@ "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 42, + "endColumn": 44, "start": 33, - "end": 66, + "end": 68, "startTag": { "startLine": 3, "startColumn": 9, "endLine": 3, - "endColumn": 28, + "endColumn": 30, "start": 33, - "end": 52 + "end": 54 }, "endTag": { "startLine": 3, - "startColumn": 33, + "startColumn": 35, "endLine": 3, - "endColumn": 42, - "start": 57, - "end": 66 + "endColumn": 44, + "start": 59, + "end": 68 } }, "attributes": [], @@ -103,18 +103,18 @@ "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 27, + "endColumn": 29, "start": 41, - "end": 51 + "end": 53 } }, "location": { "startLine": 3, "startColumn": 17, "endLine": 3, - "endColumn": 27, + "endColumn": 29, "start": 41, - "end": 51 + "end": 53 } } ], @@ -126,39 +126,25 @@ "raw": "{foo}", "value": { "type": "Identifier", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 31 - } - }, - "range": [ - 53, - 56 - ], + "start": 1, + "end": 4, "name": "foo", "location": { "startLine": 3, - "startColumn": 28, + "startColumn": 30, "endLine": 3, - "endColumn": 33, - "start": 52, - "end": 57 + "endColumn": 35, + "start": 54, + "end": 59 } }, "location": { "startLine": 3, - "startColumn": 28, + "startColumn": 30, "endLine": 3, - "endColumn": 33, - "start": 52, - "end": 57 + "endColumn": 35, + "start": 54, + "end": 59 } } ] @@ -171,24 +157,24 @@ "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 46, - "start": 75, - "end": 112, + "endColumn": 48, + "start": 77, + "end": 116, "startTag": { "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 30, - "start": 75, - "end": 96 + "endColumn": 32, + "start": 77, + "end": 100 }, "endTag": { "startLine": 4, - "startColumn": 37, + "startColumn": 39, "endLine": 4, - "endColumn": 46, - "start": 103, - "end": 112 + "endColumn": 48, + "start": 107, + "end": 116 } }, "attributes": [], @@ -206,18 +192,18 @@ "startLine": 4, "startColumn": 17, "endLine": 4, - "endColumn": 29, - "start": 83, - "end": 95 + "endColumn": 31, + "start": 85, + "end": 99 } }, "location": { "startLine": 4, "startColumn": 17, "endLine": 4, - "endColumn": 29, - "start": 83, - "end": 95 + "endColumn": 31, + "start": 85, + "end": 99 } } ], @@ -229,39 +215,25 @@ "raw": "{ foo }", "value": { "type": "Identifier", - "start": 98, - "end": 101, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "range": [ - 98, - 101 - ], + "start": 2, + "end": 5, "name": "foo", "location": { "startLine": 4, - "startColumn": 30, + "startColumn": 32, "endLine": 4, - "endColumn": 37, - "start": 96, - "end": 103 + "endColumn": 39, + "start": 100, + "end": 107 } }, "location": { "startLine": 4, - "startColumn": 30, + "startColumn": 32, "endLine": 4, - "endColumn": 37, - "start": 96, - "end": 103 + "endColumn": 39, + "start": 100, + "end": 107 } } ] @@ -274,24 +246,24 @@ "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 48, - "start": 121, - "end": 160, + "endColumn": 52, + "start": 125, + "end": 168, "startTag": { "startLine": 5, "startColumn": 9, "endLine": 5, - "endColumn": 30, - "start": 121, - "end": 142 + "endColumn": 34, + "start": 125, + "end": 150 }, "endTag": { "startLine": 5, - "startColumn": 39, + "startColumn": 43, "endLine": 5, - "endColumn": 48, - "start": 151, - "end": 160 + "endColumn": 52, + "start": 159, + "end": 168 } }, "attributes": [], @@ -302,25 +274,25 @@ "attributeName": "attr", "value": { "type": "Identifier", - "start": 2, - "end": 5, + "start": 3, + "end": 6, "name": "foo", "location": { "startLine": 5, "startColumn": 17, "endLine": 5, - "endColumn": 29, - "start": 129, - "end": 141 + "endColumn": 33, + "start": 133, + "end": 149 } }, "location": { "startLine": 5, "startColumn": 17, "endLine": 5, - "endColumn": 29, - "start": 129, - "end": 141 + "endColumn": 33, + "start": 133, + "end": 149 } } ], @@ -332,39 +304,25 @@ "raw": "{ (foo )}", "value": { "type": "Identifier", - "start": 145, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 32 - }, - "end": { - "line": 5, - "column": 35 - } - }, - "range": [ - 145, - 148 - ], + "start": 3, + "end": 6, "name": "foo", "location": { "startLine": 5, - "startColumn": 30, + "startColumn": 34, "endLine": 5, - "endColumn": 39, - "start": 142, - "end": 151 + "endColumn": 43, + "start": 150, + "end": 159 } }, "location": { "startLine": 5, - "startColumn": 30, + "startColumn": 34, "endLine": 5, - "endColumn": 39, - "start": 142, - "end": 151 + "endColumn": 43, + "start": 150, + "end": 159 } } ] @@ -377,24 +335,24 @@ "startLine": 6, "startColumn": 9, "endLine": 6, - "endColumn": 48, - "start": 169, - "end": 208, + "endColumn": 51, + "start": 177, + "end": 219, "startTag": { "startLine": 6, "startColumn": 9, "endLine": 6, - "endColumn": 31, - "start": 169, - "end": 191 + "endColumn": 34, + "start": 177, + "end": 202 }, "endTag": { "startLine": 6, - "startColumn": 39, + "startColumn": 42, "endLine": 6, - "endColumn": 48, - "start": 199, - "end": 208 + "endColumn": 51, + "start": 210, + "end": 219 } }, "attributes": [], @@ -405,25 +363,25 @@ "attributeName": "attr", "value": { "type": "Identifier", - "start": 2, - "end": 5, + "start": 3, + "end": 6, "name": "foo", "location": { "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 30, - "start": 177, - "end": 190 + "endColumn": 33, + "start": 185, + "end": 201 } }, "location": { "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 30, - "start": 177, - "end": 190 + "endColumn": 33, + "start": 185, + "end": 201 } } ], @@ -435,39 +393,25 @@ "raw": "{( foo)}", "value": { "type": "Identifier", - "start": 194, - "end": 197, - "loc": { - "start": { - "line": 6, - "column": 33 - }, - "end": { - "line": 6, - "column": 36 - } - }, - "range": [ - 194, - 197 - ], + "start": 3, + "end": 6, "name": "foo", "location": { "startLine": 6, - "startColumn": 31, + "startColumn": 34, "endLine": 6, - "endColumn": 39, - "start": 191, - "end": 199 + "endColumn": 42, + "start": 202, + "end": 210 } }, "location": { "startLine": 6, - "startColumn": 31, + "startColumn": 34, "endLine": 6, - "endColumn": 39, - "start": 191, - "end": 199 + "endColumn": 42, + "start": 202, + "end": 210 } } ] diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/iterator/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/iterator/actual.html index e3570452ee..9756ba3835 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/iterator/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/iterator/actual.html @@ -1,7 +1,7 @@