diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/actual.html b/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/actual.html index 12a38685bb..f02b08de08 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/actual.html +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/actual.html @@ -5,4 +5,4 @@
  • {color}
  • - \ No newline at end of file + diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/ast.json index b9f4895340..809238454f 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/comments/directive-for-each/ast.json @@ -200,14 +200,16 @@ "raw": "{color}", "value": { "type": "Identifier", + "start": 152, + "end": 157, "name": "color", "location": { "startLine": 5, "startColumn": 29, "endLine": 5, - "endColumn": 36, - "start": 151, - "end": 158 + "endColumn": 34, + "start": 152, + "end": 157 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/dynamic-component/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/dynamic-component/ast.json index e7a6661b9d..daaea7cf33 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/dynamic-component/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/dynamic-component/ast.json @@ -211,28 +211,14 @@ "type": "Identifier", "start": 104, "end": 108, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 16 - } - }, - "range": [ - 104, - 108 - ], "name": "item", "location": { "startLine": 3, "startColumn": 12, "endLine": 3, - "endColumn": 18, - "start": 103, - "end": 109 + "endColumn": 16, + "start": 104, + "end": 108 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/foreach-with-if/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/foreach-with-if/ast.json index dfd431b07d..d7eee2f48c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/foreach-with-if/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/foreach-with-if/ast.json @@ -235,28 +235,14 @@ "type": "Identifier", "start": 128, "end": 132, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 128, - 132 - ], "name": "item", "location": { "startLine": 4, "startColumn": 31, "endLine": 4, - "endColumn": 37, - "start": 127, - "end": 133 + "endColumn": 35, + "start": 128, + "end": 132 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-index/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-index/ast.json index b34daeed9f..50597fb1e8 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-index/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-index/ast.json @@ -197,28 +197,14 @@ "type": "Identifier", "start": 111, "end": 116, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } - }, - "range": [ - 111, - 116 - ], "name": "index", "location": { "startLine": 4, "startColumn": 13, "endLine": 4, - "endColumn": 20, - "start": 110, - "end": 117 + "endColumn": 18, + "start": 111, + "end": 116 } }, "location": { @@ -253,28 +239,14 @@ "type": "Identifier", "start": 121, "end": 125, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 27 - } - }, - "range": [ - 121, - 125 - ], "name": "item", "location": { "startLine": 4, "startColumn": 23, "endLine": 4, - "endColumn": 29, - "start": 120, - "end": 126 + "endColumn": 27, + "start": 121, + "end": 125 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-item/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-item/ast.json index 998a47b89e..3b1daf3dde 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-item/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-item/ast.json @@ -235,28 +235,14 @@ "type": "Identifier", "start": 118, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "range": [ - 118, - 122 - ], "name": "item", "location": { "startLine": 4, "startColumn": 16, "endLine": 4, - "endColumn": 22, - "start": 117, - "end": 123 + "endColumn": 20, + "start": 118, + "end": 122 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-outside-scope-reference/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-outside-scope-reference/ast.json index 9fbbc2cd86..e70bd81ce9 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-outside-scope-reference/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-outside-scope-reference/ast.json @@ -235,28 +235,14 @@ "type": "Identifier", "start": 118, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "range": [ - 118, - 122 - ], "name": "item", "location": { "startLine": 4, "startColumn": 16, "endLine": 4, - "endColumn": 22, - "start": 117, - "end": 123 + "endColumn": 20, + "start": 118, + "end": 122 } }, "location": { @@ -310,28 +296,14 @@ "type": "Identifier", "start": 144, "end": 149, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 21 - } - }, - "range": [ - 144, - 149 - ], "name": "item2", "location": { "startLine": 5, "startColumn": 16, "endLine": 5, - "endColumn": 23, - "start": 143, - "end": 150 + "endColumn": 21, + "start": 144, + "end": 149 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-refence-item/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-refence-item/ast.json index fb742cd027..a15633911b 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-refence-item/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-refence-item/ast.json @@ -225,28 +225,14 @@ "type": "Identifier", "start": 95, "end": 99, - "loc": { - "start": { - "line": 3, - "column": 75 - }, - "end": { - "line": 3, - "column": 79 - } - }, - "range": [ - 95, - 99 - ], "name": "item", "location": { "startLine": 3, "startColumn": 75, "endLine": 3, - "endColumn": 81, - "start": 94, - "end": 100 + "endColumn": 79, + "start": 95, + "end": 99 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-sibling/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-sibling/ast.json index 4dee21a7f2..04898bf204 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-sibling/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/inline-sibling/ast.json @@ -225,28 +225,14 @@ "type": "Identifier", "start": 95, "end": 99, - "loc": { - "start": { - "line": 3, - "column": 75 - }, - "end": { - "line": 3, - "column": 79 - } - }, - "range": [ - 95, - 99 - ], "name": "item", "location": { "startLine": 3, "startColumn": 75, "endLine": 3, - "endColumn": 81, - "start": 94, - "end": 100 + "endColumn": 79, + "start": 95, + "end": 99 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-multiple-children/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-multiple-children/ast.json index e416cc0bc2..a80a7017fb 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-multiple-children/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-multiple-children/ast.json @@ -201,28 +201,14 @@ "type": "Identifier", "start": 112, "end": 116, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 39 - } - }, - "range": [ - 112, - 116 - ], "name": "item", "location": { "startLine": 4, "startColumn": 35, "endLine": 4, - "endColumn": 41, - "start": 111, - "end": 117 + "endColumn": 39, + "start": 112, + "end": 116 } }, "location": { @@ -332,28 +318,14 @@ "type": "Identifier", "start": 157, "end": 161, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 39 - } - }, - "range": [ - 157, - 161 - ], "name": "item", "location": { "startLine": 5, "startColumn": 35, "endLine": 5, - "endColumn": 41, - "start": 156, - "end": 162 + "endColumn": 39, + "start": 157, + "end": 161 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-outside-scope-reference/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-outside-scope-reference/ast.json index 7a17c71e32..d7afb135e4 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-outside-scope-reference/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-outside-scope-reference/ast.json @@ -201,28 +201,14 @@ "type": "Identifier", "start": 112, "end": 116, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 39 - } - }, - "range": [ - 112, - 116 - ], "name": "item", "location": { "startLine": 4, "startColumn": 35, "endLine": 4, - "endColumn": 41, - "start": 111, - "end": 117 + "endColumn": 39, + "start": 112, + "end": 116 } }, "location": { @@ -332,59 +318,33 @@ "type": "MemberExpression", "start": 157, "end": 165, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 43 - } - }, - "range": [ - 157, - 165 - ], "object": { "type": "Identifier", "start": 157, "end": 161, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 39 - } - }, - "range": [ - 157, - 161 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 5, + "startColumn": 35, + "endLine": 5, + "endColumn": 39, + "start": 157, + "end": 161 + } }, "property": { "type": "Identifier", "start": 162, "end": 165, - "loc": { - "start": { - "line": 5, - "column": 40 - }, - "end": { - "line": 5, - "column": 43 - } - }, - "range": [ - 162, - 165 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 5, + "startColumn": 40, + "endLine": 5, + "endColumn": 43, + "start": 162, + "end": 165 + } }, "computed": false, "optional": false, @@ -392,9 +352,9 @@ "startLine": 5, "startColumn": 35, "endLine": 5, - "endColumn": 45, - "start": 156, - "end": 166 + "endColumn": 43, + "start": 157, + "end": 165 } }, "location": { @@ -504,28 +464,14 @@ "type": "Identifier", "start": 208, "end": 213, - "loc": { - "start": { - "line": 6, - "column": 37 - }, - "end": { - "line": 6, - "column": 42 - } - }, - "range": [ - 208, - 213 - ], "name": "other", "location": { "startLine": 6, "startColumn": 37, "endLine": 6, - "endColumn": 44, - "start": 207, - "end": 214 + "endColumn": 42, + "start": 208, + "end": 213 } }, "location": { @@ -635,59 +581,33 @@ "type": "MemberExpression", "start": 255, "end": 264, - "loc": { - "start": { - "line": 7, - "column": 36 - }, - "end": { - "line": 7, - "column": 45 - } - }, - "range": [ - 255, - 264 - ], "object": { "type": "Identifier", "start": 255, "end": 260, - "loc": { - "start": { - "line": 7, - "column": 36 - }, - "end": { - "line": 7, - "column": 41 - } - }, - "range": [ - 255, - 260 - ], - "name": "other" + "name": "other", + "location": { + "startLine": 7, + "startColumn": 36, + "endLine": 7, + "endColumn": 41, + "start": 255, + "end": 260 + } }, "property": { "type": "Identifier", "start": 261, "end": 264, - "loc": { - "start": { - "line": 7, - "column": 42 - }, - "end": { - "line": 7, - "column": 45 - } - }, - "range": [ - 261, - 264 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 7, + "startColumn": 42, + "endLine": 7, + "endColumn": 45, + "start": 261, + "end": 264 + } }, "computed": false, "optional": false, @@ -695,9 +615,9 @@ "startLine": 7, "startColumn": 36, "endLine": 7, - "endColumn": 47, - "start": 254, - "end": 265 + "endColumn": 45, + "start": 255, + "end": 264 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-sibling/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-sibling/ast.json index 20225f761b..e409dc5225 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-sibling/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template-sibling/ast.json @@ -201,28 +201,14 @@ "type": "Identifier", "start": 108, "end": 112, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 108, - 112 - ], "name": "item", "location": { "startLine": 4, "startColumn": 31, "endLine": 4, - "endColumn": 37, - "start": 107, - "end": 113 + "endColumn": 35, + "start": 108, + "end": 112 } }, "location": { @@ -332,28 +318,14 @@ "type": "Identifier", "start": 155, "end": 159, - "loc": { - "start": { - "line": 5, - "column": 37 - }, - "end": { - "line": 5, - "column": 41 - } - }, - "range": [ - 155, - 159 - ], "name": "item", "location": { "startLine": 5, "startColumn": 37, "endLine": 5, - "endColumn": 43, - "start": 154, - "end": 160 + "endColumn": 41, + "start": 155, + "end": 159 } }, "location": { @@ -425,28 +397,14 @@ "type": "Identifier", "start": 198, "end": 202, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 17 - } - }, - "range": [ - 198, - 202 - ], "name": "item", "location": { "startLine": 7, "startColumn": 13, "endLine": 7, - "endColumn": 19, - "start": 197, - "end": 203 + "endColumn": 17, + "start": 198, + "end": 202 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template/ast.json index 9c190180b4..6eb6df057c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-for-each/template/ast.json @@ -201,28 +201,14 @@ "type": "Identifier", "start": 108, "end": 112, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 108, - 112 - ], "name": "item", "location": { "startLine": 4, "startColumn": 31, "endLine": 4, - "endColumn": 37, - "start": 107, - "end": 113 + "endColumn": 35, + "start": 108, + "end": 112 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-if/inline-sibling-static/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-if/inline-sibling-static/ast.json index f10db1052a..14271d3d09 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-if/inline-sibling-static/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-if/inline-sibling-static/ast.json @@ -154,28 +154,14 @@ "type": "Identifier", "start": 68, "end": 71, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 12 - } - }, - "range": [ - 68, - 71 - ], "name": "foo", "location": { "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 14, - "start": 67, - "end": 72 + "endColumn": 12, + "start": 68, + "end": 71 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/inline-iterator/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/inline-iterator/ast.json index 50b8c92dce..eed28a0120 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/inline-iterator/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/inline-iterator/ast.json @@ -326,59 +326,33 @@ "type": "MemberExpression", "start": 130, "end": 137, - "loc": { - "start": { - "line": 3, - "column": 105 - }, - "end": { - "line": 3, - "column": 112 - } - }, - "range": [ - 130, - 137 - ], "object": { "type": "Identifier", "start": 130, "end": 131, - "loc": { - "start": { - "line": 3, - "column": 105 - }, - "end": { - "line": 3, - "column": 106 - } - }, - "range": [ - 130, - 131 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 3, + "startColumn": 105, + "endLine": 3, + "endColumn": 106, + "start": 130, + "end": 131 + } }, "property": { "type": "Identifier", "start": 132, "end": 137, - "loc": { - "start": { - "line": 3, - "column": 107 - }, - "end": { - "line": 3, - "column": 112 - } - }, - "range": [ - 132, - 137 - ], - "name": "index" + "name": "index", + "location": { + "startLine": 3, + "startColumn": 107, + "endLine": 3, + "endColumn": 112, + "start": 132, + "end": 137 + } }, "computed": false, "optional": false, @@ -386,9 +360,9 @@ "startLine": 3, "startColumn": 105, "endLine": 3, - "endColumn": 114, - "start": 129, - "end": 138 + "endColumn": 112, + "start": 130, + "end": 137 } }, "location": { @@ -425,59 +399,33 @@ "type": "MemberExpression", "start": 155, "end": 162, - "loc": { - "start": { - "line": 3, - "column": 130 - }, - "end": { - "line": 3, - "column": 137 - } - }, - "range": [ - 155, - 162 - ], "object": { "type": "Identifier", "start": 155, "end": 156, - "loc": { - "start": { - "line": 3, - "column": 130 - }, - "end": { - "line": 3, - "column": 131 - } - }, - "range": [ - 155, - 156 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 3, + "startColumn": 130, + "endLine": 3, + "endColumn": 131, + "start": 155, + "end": 156 + } }, "property": { "type": "Identifier", "start": 157, "end": 162, - "loc": { - "start": { - "line": 3, - "column": 132 - }, - "end": { - "line": 3, - "column": 137 - } - }, - "range": [ - 157, - 162 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 3, + "startColumn": 132, + "endLine": 3, + "endColumn": 137, + "start": 157, + "end": 162 + } }, "computed": false, "optional": false, @@ -485,9 +433,9 @@ "startLine": 3, "startColumn": 130, "endLine": 3, - "endColumn": 139, - "start": 154, - "end": 163 + "endColumn": 137, + "start": 155, + "end": 162 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/iterator/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/iterator/ast.json index 9d7b295b0b..7f216a73a1 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/iterator/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-iterator/iterator/ast.json @@ -326,59 +326,33 @@ "type": "MemberExpression", "start": 153, "end": 160, - "loc": { - "start": { - "line": 4, - "column": 90 - }, - "end": { - "line": 4, - "column": 97 - } - }, - "range": [ - 153, - 160 - ], "object": { "type": "Identifier", "start": 153, "end": 154, - "loc": { - "start": { - "line": 4, - "column": 90 - }, - "end": { - "line": 4, - "column": 91 - } - }, - "range": [ - 153, - 154 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 90, + "endLine": 4, + "endColumn": 91, + "start": 153, + "end": 154 + } }, "property": { "type": "Identifier", "start": 155, "end": 160, - "loc": { - "start": { - "line": 4, - "column": 92 - }, - "end": { - "line": 4, - "column": 97 - } - }, - "range": [ - 155, - 160 - ], - "name": "index" + "name": "index", + "location": { + "startLine": 4, + "startColumn": 92, + "endLine": 4, + "endColumn": 97, + "start": 155, + "end": 160 + } }, "computed": false, "optional": false, @@ -386,9 +360,9 @@ "startLine": 4, "startColumn": 90, "endLine": 4, - "endColumn": 99, - "start": 152, - "end": 161 + "endColumn": 97, + "start": 153, + "end": 160 } }, "location": { @@ -425,59 +399,33 @@ "type": "MemberExpression", "start": 178, "end": 185, - "loc": { - "start": { - "line": 4, - "column": 115 - }, - "end": { - "line": 4, - "column": 122 - } - }, - "range": [ - 178, - 185 - ], "object": { "type": "Identifier", "start": 178, "end": 179, - "loc": { - "start": { - "line": 4, - "column": 115 - }, - "end": { - "line": 4, - "column": 116 - } - }, - "range": [ - 178, - 179 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 115, + "endLine": 4, + "endColumn": 116, + "start": 178, + "end": 179 + } }, "property": { "type": "Identifier", "start": 180, "end": 185, - "loc": { - "start": { - "line": 4, - "column": 117 - }, - "end": { - "line": 4, - "column": 122 - } - }, - "range": [ - 180, - 185 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 117, + "endLine": 4, + "endColumn": 122, + "start": 180, + "end": 185 + } }, "computed": false, "optional": false, @@ -485,9 +433,9 @@ "startLine": 4, "startColumn": 115, "endLine": 4, - "endColumn": 124, - "start": 177, - "end": 186 + "endColumn": 122, + "start": 178, + "end": 185 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/component/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/component/ast.json index 55342fa31e..c719523c67 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/component/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/component/ast.json @@ -185,59 +185,33 @@ "type": "MemberExpression", "start": 109, "end": 119, - "loc": { - "start": { - "line": 4, - "column": 37 - }, - "end": { - "line": 4, - "column": 47 - } - }, - "range": [ - 109, - 119 - ], "object": { "type": "Identifier", "start": 109, "end": 113, - "loc": { - "start": { - "line": 4, - "column": 37 - }, - "end": { - "line": 4, - "column": 41 - } - }, - "range": [ - 109, - 113 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 4, + "startColumn": 37, + "endLine": 4, + "endColumn": 41, + "start": 109, + "end": 113 + } }, "property": { "type": "Identifier", "start": 114, "end": 119, - "loc": { - "start": { - "line": 4, - "column": 42 - }, - "end": { - "line": 4, - "column": 47 - } - }, - "range": [ - 114, - 119 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 42, + "endLine": 4, + "endColumn": 47, + "start": 114, + "end": 119 + } }, "computed": false, "optional": false, @@ -245,9 +219,9 @@ "startLine": 4, "startColumn": 37, "endLine": 4, - "endColumn": 49, - "start": 108, - "end": 120 + "endColumn": 47, + "start": 109, + "end": 119 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/element/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/element/ast.json index 7bd79fc4f3..f112a6f6c7 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/element/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/element/ast.json @@ -185,59 +185,33 @@ "type": "MemberExpression", "start": 104, "end": 114, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 42 - } - }, - "range": [ - 104, - 114 - ], "object": { "type": "Identifier", "start": 104, "end": 108, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 36 - } - }, - "range": [ - 104, - 108 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 4, + "startColumn": 32, + "endLine": 4, + "endColumn": 36, + "start": 104, + "end": 108 + } }, "property": { "type": "Identifier", "start": 109, "end": 114, - "loc": { - "start": { - "line": 4, - "column": 37 - }, - "end": { - "line": 4, - "column": 42 - } - }, - "range": [ - 109, - 114 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 37, + "endLine": 4, + "endColumn": 42, + "start": 109, + "end": 114 + } }, "computed": false, "optional": false, @@ -245,9 +219,9 @@ "startLine": 4, "startColumn": 32, "endLine": 4, - "endColumn": 44, - "start": 103, - "end": 115 + "endColumn": 42, + "start": 104, + "end": 114 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/for-each/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/for-each/ast.json index 998a47b89e..3b1daf3dde 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/for-each/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/for-each/ast.json @@ -235,28 +235,14 @@ "type": "Identifier", "start": 118, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "range": [ - 118, - 122 - ], "name": "item", "location": { "startLine": 4, "startColumn": 16, "endLine": 4, - "endColumn": 22, - "start": 117, - "end": 123 + "endColumn": 20, + "start": 118, + "end": 122 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-identifier/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-identifier/ast.json index f910bdc674..ca4fd97c2c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-identifier/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-identifier/ast.json @@ -172,59 +172,33 @@ "type": "MemberExpression", "start": 89, "end": 96, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 33 - } - }, - "range": [ - 89, - 96 - ], "object": { "type": "Identifier", "start": 89, "end": 90, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 27 - } - }, - "range": [ - 89, - 90 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 26, + "endLine": 4, + "endColumn": 27, + "start": 89, + "end": 90 + } }, "property": { "type": "Identifier", "start": 91, "end": 96, - "loc": { - "start": { - "line": 4, - "column": 28 - }, - "end": { - "line": 4, - "column": 33 - } - }, - "range": [ - 91, - 96 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 28, + "endLine": 4, + "endColumn": 33, + "start": 91, + "end": 96 + } }, "computed": false, "optional": false, @@ -232,9 +206,9 @@ "startLine": 4, "startColumn": 26, "endLine": 4, - "endColumn": 35, - "start": 88, - "end": 97 + "endColumn": 33, + "start": 89, + "end": 96 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-member-expression/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-member-expression/ast.json index f4c8f18bd2..cc97bca752 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-member-expression/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-key-member-expression/ast.json @@ -185,59 +185,33 @@ "type": "MemberExpression", "start": 95, "end": 102, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 39 - } - }, - "range": [ - 95, - 102 - ], "object": { "type": "Identifier", "start": 95, "end": 96, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 33 - } - }, - "range": [ - 95, - 96 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 32, + "endLine": 4, + "endColumn": 33, + "start": 95, + "end": 96 + } }, "property": { "type": "Identifier", "start": 97, "end": 102, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 39 - } - }, - "range": [ - 97, - 102 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 34, + "endLine": 4, + "endColumn": 39, + "start": 97, + "end": 102 + } }, "computed": false, "optional": false, @@ -245,9 +219,9 @@ "startLine": 4, "startColumn": 32, "endLine": 4, - "endColumn": 41, - "start": 94, - "end": 103 + "endColumn": 39, + "start": 95, + "end": 102 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-nested-each/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-nested-each/ast.json index e1072e4609..a93b7a38ed 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-nested-each/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-nested-each/ast.json @@ -223,100 +223,62 @@ "type": "MemberExpression", "start": 184, "end": 203, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 36 - } - }, - "range": [ - 184, - 203 - ], "object": { "type": "MemberExpression", "start": 184, "end": 197, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 30 - } - }, - "range": [ - 184, - 197 - ], "object": { "type": "Identifier", "start": 184, "end": 191, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 24 - } - }, - "range": [ - 184, - 191 - ], - "name": "feature" + "name": "feature", + "location": { + "startLine": 5, + "startColumn": 17, + "endLine": 5, + "endColumn": 24, + "start": 184, + "end": 191 + } }, "property": { "type": "Identifier", "start": 192, "end": 197, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 30 - } - }, - "range": [ - 192, - 197 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 5, + "startColumn": 25, + "endLine": 5, + "endColumn": 30, + "start": 192, + "end": 197 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 5, + "startColumn": 17, + "endLine": 5, + "endColumn": 30, + "start": 184, + "end": 197 + } }, "property": { "type": "Identifier", "start": 198, "end": 203, - "loc": { - "start": { - "line": 5, - "column": 31 - }, - "end": { - "line": 5, - "column": 36 - } - }, - "range": [ - 198, - 203 - ], - "name": "label" + "name": "label", + "location": { + "startLine": 5, + "startColumn": 31, + "endLine": 5, + "endColumn": 36, + "start": 198, + "end": 203 + } }, "computed": false, "optional": false, @@ -324,9 +286,9 @@ "startLine": 5, "startColumn": 17, "endLine": 5, - "endColumn": 38, - "start": 183, - "end": 204 + "endColumn": 36, + "start": 184, + "end": 203 } }, "location": { @@ -345,59 +307,33 @@ "type": "MemberExpression", "start": 222, "end": 235, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 30 - } - }, - "range": [ - 222, - 235 - ], "object": { "type": "Identifier", "start": 222, "end": 229, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 24 - } - }, - "range": [ - 222, - 229 - ], - "name": "feature" + "name": "feature", + "location": { + "startLine": 6, + "startColumn": 17, + "endLine": 6, + "endColumn": 24, + "start": 222, + "end": 229 + } }, "property": { "type": "Identifier", "start": 230, "end": 235, - "loc": { - "start": { - "line": 6, - "column": 25 - }, - "end": { - "line": 6, - "column": 30 - } - }, - "range": [ - 230, - 235 - ], - "name": "label" + "name": "label", + "location": { + "startLine": 6, + "startColumn": 25, + "endLine": 6, + "endColumn": 30, + "start": 230, + "end": 235 + } }, "computed": false, "optional": false, @@ -405,9 +341,9 @@ "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 32, - "start": 221, - "end": 236 + "endColumn": 30, + "start": 222, + "end": 235 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-value-as-key/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-value-as-key/ast.json index 0f0fcf7a70..00140ef2ab 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-value-as-key/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/iterator-value-as-key/ast.json @@ -185,59 +185,33 @@ "type": "MemberExpression", "start": 93, "end": 100, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 37 - } - }, - "range": [ - 93, - 100 - ], "object": { "type": "Identifier", "start": 93, "end": 94, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 31 - } - }, - "range": [ - 93, - 94 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 30, + "endLine": 4, + "endColumn": 31, + "start": 93, + "end": 94 + } }, "property": { "type": "Identifier", "start": 95, "end": 100, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 37 - } - }, - "range": [ - 95, - 100 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 32, + "endLine": 4, + "endColumn": 37, + "start": 95, + "end": 100 + } }, "computed": false, "optional": false, @@ -245,9 +219,9 @@ "startLine": 4, "startColumn": 30, "endLine": 4, - "endColumn": 39, - "start": 92, - "end": 101 + "endColumn": 37, + "start": 93, + "end": 100 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/nested-iterator-if/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/nested-iterator-if/ast.json index f92fa4b884..7bd076e86d 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/nested-iterator-if/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/nested-iterator-if/ast.json @@ -326,59 +326,33 @@ "type": "MemberExpression", "start": 153, "end": 160, - "loc": { - "start": { - "line": 4, - "column": 90 - }, - "end": { - "line": 4, - "column": 97 - } - }, - "range": [ - 153, - 160 - ], "object": { "type": "Identifier", "start": 153, "end": 154, - "loc": { - "start": { - "line": 4, - "column": 90 - }, - "end": { - "line": 4, - "column": 91 - } - }, - "range": [ - 153, - 154 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 90, + "endLine": 4, + "endColumn": 91, + "start": 153, + "end": 154 + } }, "property": { "type": "Identifier", "start": 155, "end": 160, - "loc": { - "start": { - "line": 4, - "column": 92 - }, - "end": { - "line": 4, - "column": 97 - } - }, - "range": [ - 155, - 160 - ], - "name": "index" + "name": "index", + "location": { + "startLine": 4, + "startColumn": 92, + "endLine": 4, + "endColumn": 97, + "start": 155, + "end": 160 + } }, "computed": false, "optional": false, @@ -386,9 +360,9 @@ "startLine": 4, "startColumn": 90, "endLine": 4, - "endColumn": 99, - "start": 152, - "end": 161 + "endColumn": 97, + "start": 153, + "end": 160 } }, "location": { @@ -425,59 +399,33 @@ "type": "MemberExpression", "start": 178, "end": 185, - "loc": { - "start": { - "line": 4, - "column": 115 - }, - "end": { - "line": 4, - "column": 122 - } - }, - "range": [ - 178, - 185 - ], "object": { "type": "Identifier", "start": 178, "end": 179, - "loc": { - "start": { - "line": 4, - "column": 115 - }, - "end": { - "line": 4, - "column": 116 - } - }, - "range": [ - 178, - 179 - ], - "name": "x" + "name": "x", + "location": { + "startLine": 4, + "startColumn": 115, + "endLine": 4, + "endColumn": 116, + "start": 178, + "end": 179 + } }, "property": { "type": "Identifier", "start": 180, "end": 185, - "loc": { - "start": { - "line": 4, - "column": 117 - }, - "end": { - "line": 4, - "column": 122 - } - }, - "range": [ - 180, - 185 - ], - "name": "value" + "name": "value", + "location": { + "startLine": 4, + "startColumn": 117, + "endLine": 4, + "endColumn": 122, + "start": 180, + "end": 185 + } }, "computed": false, "optional": false, @@ -485,9 +433,9 @@ "startLine": 4, "startColumn": 115, "endLine": 4, - "endColumn": 124, - "start": 177, - "end": 186 + "endColumn": 122, + "start": 178, + "end": 185 } }, "location": { 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..98f4fabec1 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 @@ -150,165 +150,109 @@ "type": "CallExpression", "start": 82, "end": 108, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 82, - 108 - ], "callee": { "type": "MemberExpression", "start": 82, "end": 104, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 31 - } - }, - "range": [ - 82, - 104 - ], "object": { "type": "ArrayExpression", "start": 82, "end": 99, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 26 - } - }, - "range": [ - 82, - 99 - ], "elements": [ { "type": "Literal", "start": 83, "end": 89, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 16 - } - }, - "range": [ - 83, - 89 - ], "value": "flop", - "raw": "'flop'" + "raw": "'flop'", + "location": { + "startLine": 4, + "startColumn": 10, + "endLine": 4, + "endColumn": 16, + "start": 83, + "end": 89 + } }, { "type": "Identifier", "start": 91, "end": 95, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 22 - } - }, - "range": [ - 91, - 95 - ], - "name": "floo" + "name": "floo", + "location": { + "startLine": 4, + "startColumn": 18, + "endLine": 4, + "endColumn": 22, + "start": 91, + "end": 95 + } }, { "type": "Literal", "start": 97, "end": 98, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 25 - } - }, - "range": [ - 97, - 98 - ], "value": 2, - "raw": "2" + "raw": "2", + "location": { + "startLine": 4, + "startColumn": 24, + "endLine": 4, + "endColumn": 25, + "start": 97, + "end": 98 + } } - ] + ], + "location": { + "startLine": 4, + "startColumn": 9, + "endLine": 4, + "endColumn": 26, + "start": 82, + "end": 99 + } }, "property": { "type": "Identifier", "start": 100, "end": 104, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 31 - } - }, - "range": [ - 100, - 104 - ], - "name": "join" + "name": "join", + "location": { + "startLine": 4, + "startColumn": 27, + "endLine": 4, + "endColumn": 31, + "start": 100, + "end": 104 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 4, + "startColumn": 9, + "endLine": 4, + "endColumn": 31, + "start": 82, + "end": 104 + } }, "arguments": [ { "type": "Literal", "start": 105, "end": 107, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "range": [ - 105, - 107 - ], "value": "", - "raw": "''" + "raw": "''", + "location": { + "startLine": 4, + "startColumn": 32, + "endLine": 4, + "endColumn": 34, + "start": 105, + "end": 107 + } } ], "optional": false, @@ -316,9 +260,9 @@ "startLine": 4, "startColumn": 9, "endLine": 4, - "endColumn": 37, - "start": 81, - "end": 109 + "endColumn": 35, + "start": 82, + "end": 108 } }, "location": { 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..2cff094621 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 @@ -140,68 +140,42 @@ "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" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 34, + "endLine": 3, + "endColumn": 37, + "start": 59, + "end": 62 + } }, "operator": "+", "right": { "type": "Identifier", "start": 65, "end": 68, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 65, - 68 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 40, + "endLine": 3, + "endColumn": 43, + "start": 65, + "end": 68 + } }, "location": { "startLine": 3, "startColumn": 34, "endLine": 3, - "endColumn": 45, - "start": 58, - "end": 69 + "endColumn": 43, + "start": 59, + "end": 68 } }, "location": { @@ -295,68 +269,42 @@ "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" + "name": "foo", + "location": { + "startLine": 4, + "startColumn": 34, + "endLine": 4, + "endColumn": 37, + "start": 113, + "end": 116 + } }, "operator": "/", "right": { "type": "Identifier", "start": 119, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 40 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 119, - 122 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 4, + "startColumn": 40, + "endLine": 4, + "endColumn": 43, + "start": 119, + "end": 122 + } }, "location": { "startLine": 4, "startColumn": 34, "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 + "endColumn": 43, + "start": 113, + "end": 122 } }, "location": { @@ -450,68 +398,42 @@ "type": "BinaryExpression", "start": 168, "end": 178, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 45 - } - }, - "range": [ - 168, - 178 - ], "left": { "type": "Identifier", "start": 168, "end": 171, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 38 - } - }, - "range": [ - 168, - 171 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 5, + "startColumn": 35, + "endLine": 5, + "endColumn": 38, + "start": 168, + "end": 171 + } }, "operator": "**", "right": { "type": "Identifier", "start": 175, "end": 178, - "loc": { - "start": { - "line": 5, - "column": 42 - }, - "end": { - "line": 5, - "column": 45 - } - }, - "range": [ - 175, - 178 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 5, + "startColumn": 42, + "endLine": 5, + "endColumn": 45, + "start": 175, + "end": 178 + } }, "location": { "startLine": 5, "startColumn": 35, "endLine": 5, - "endColumn": 47, - "start": 167, - "end": 179 + "endColumn": 45, + "start": 168, + "end": 178 } }, "location": { @@ -605,68 +527,42 @@ "type": "BinaryExpression", "start": 223, "end": 232, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 43 - } - }, - "range": [ - 223, - 232 - ], "left": { "type": "Identifier", "start": 223, "end": 226, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 37 - } - }, - "range": [ - 223, - 226 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 6, + "startColumn": 34, + "endLine": 6, + "endColumn": 37, + "start": 223, + "end": 226 + } }, "operator": "-", "right": { "type": "Identifier", "start": 229, "end": 232, - "loc": { - "start": { - "line": 6, - "column": 40 - }, - "end": { - "line": 6, - "column": 43 - } - }, - "range": [ - 229, - 232 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 6, + "startColumn": 40, + "endLine": 6, + "endColumn": 43, + "start": 229, + "end": 232 + } }, "location": { "startLine": 6, "startColumn": 34, "endLine": 6, - "endColumn": 45, - "start": 222, - "end": 233 + "endColumn": 43, + "start": 223, + "end": 232 } }, "location": { 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..d6e44aec0d 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 @@ -140,68 +140,42 @@ "type": "BinaryExpression", "start": 60, "end": 69, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 44 - } - }, - "range": [ - 60, - 69 - ], "left": { "type": "Identifier", "start": 60, "end": 63, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 38 - } - }, - "range": [ - 60, - 63 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 35, + "endLine": 3, + "endColumn": 38, + "start": 60, + "end": 63 + } }, "operator": "&", "right": { "type": "Identifier", "start": 66, "end": 69, - "loc": { - "start": { - "line": 3, - "column": 41 - }, - "end": { - "line": 3, - "column": 44 - } - }, - "range": [ - 66, - 69 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 41, + "endLine": 3, + "endColumn": 44, + "start": 66, + "end": 69 + } }, "location": { "startLine": 3, "startColumn": 35, "endLine": 3, - "endColumn": 46, - "start": 59, - "end": 70 + "endColumn": 44, + "start": 60, + "end": 69 } }, "location": { @@ -295,68 +269,42 @@ "type": "BinaryExpression", "start": 116, "end": 125, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 44 - } - }, - "range": [ - 116, - 125 - ], "left": { "type": "Identifier", "start": 116, "end": 119, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 38 - } - }, - "range": [ - 116, - 119 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 4, + "startColumn": 35, + "endLine": 4, + "endColumn": 38, + "start": 116, + "end": 119 + } }, "operator": "|", "right": { "type": "Identifier", "start": 122, "end": 125, - "loc": { - "start": { - "line": 4, - "column": 41 - }, - "end": { - "line": 4, - "column": 44 - } - }, - "range": [ - 122, - 125 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 4, + "startColumn": 41, + "endLine": 4, + "endColumn": 44, + "start": 122, + "end": 125 + } }, "location": { "startLine": 4, "startColumn": 35, "endLine": 4, - "endColumn": 46, - "start": 115, - "end": 126 + "endColumn": 44, + "start": 116, + "end": 125 } }, "location": { @@ -450,68 +398,42 @@ "type": "BinaryExpression", "start": 172, "end": 181, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 44 - } - }, - "range": [ - 172, - 181 - ], "left": { "type": "Identifier", "start": 172, "end": 175, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 38 - } - }, - "range": [ - 172, - 175 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 5, + "startColumn": 35, + "endLine": 5, + "endColumn": 38, + "start": 172, + "end": 175 + } }, "operator": "^", "right": { "type": "Identifier", "start": 178, "end": 181, - "loc": { - "start": { - "line": 5, - "column": 41 - }, - "end": { - "line": 5, - "column": 44 - } - }, - "range": [ - 178, - 181 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 5, + "startColumn": 41, + "endLine": 5, + "endColumn": 44, + "start": 178, + "end": 181 + } }, "location": { "startLine": 5, "startColumn": 35, "endLine": 5, - "endColumn": 46, - "start": 171, - "end": 182 + "endColumn": 44, + "start": 172, + "end": 181 } }, "location": { 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..1541cf4a55 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 @@ -140,68 +140,42 @@ "type": "LogicalExpression", "start": 60, "end": 70, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 45 - } - }, - "range": [ - 60, - 70 - ], "left": { "type": "Identifier", "start": 60, "end": 63, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 38 - } - }, - "range": [ - 60, - 63 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 35, + "endLine": 3, + "endColumn": 38, + "start": 60, + "end": 63 + } }, "operator": "||", "right": { "type": "Identifier", "start": 67, "end": 70, - "loc": { - "start": { - "line": 3, - "column": 42 - }, - "end": { - "line": 3, - "column": 45 - } - }, - "range": [ - 67, - 70 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 42, + "endLine": 3, + "endColumn": 45, + "start": 67, + "end": 70 + } }, "location": { "startLine": 3, "startColumn": 35, "endLine": 3, - "endColumn": 47, - "start": 59, - "end": 71 + "endColumn": 45, + "start": 60, + "end": 70 } }, "location": { @@ -295,68 +269,42 @@ "type": "LogicalExpression", "start": 116, "end": 126, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 45 - } - }, - "range": [ - 116, - 126 - ], "left": { "type": "Identifier", "start": 116, "end": 119, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 38 - } - }, - "range": [ - 116, - 119 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 4, + "startColumn": 35, + "endLine": 4, + "endColumn": 38, + "start": 116, + "end": 119 + } }, "operator": "&&", "right": { "type": "Identifier", "start": 123, "end": 126, - "loc": { - "start": { - "line": 4, - "column": 42 - }, - "end": { - "line": 4, - "column": 45 - } - }, - "range": [ - 123, - 126 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 4, + "startColumn": 42, + "endLine": 4, + "endColumn": 45, + "start": 123, + "end": 126 + } }, "location": { "startLine": 4, "startColumn": 35, "endLine": 4, - "endColumn": 47, - "start": 115, - "end": 127 + "endColumn": 45, + "start": 116, + "end": 126 } }, "location": { 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..8d81c3092c 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 @@ -140,68 +140,42 @@ "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" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 34, + "endLine": 3, + "endColumn": 37, + "start": 59, + "end": 62 + } }, "operator": ">", "right": { "type": "Identifier", "start": 65, "end": 68, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 65, - 68 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 40, + "endLine": 3, + "endColumn": 43, + "start": 65, + "end": 68 + } }, "location": { "startLine": 3, "startColumn": 34, "endLine": 3, - "endColumn": 45, - "start": 58, - "end": 69 + "endColumn": 43, + "start": 59, + "end": 68 } }, "location": { @@ -295,68 +269,42 @@ "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" + "name": "foo", + "location": { + "startLine": 4, + "startColumn": 34, + "endLine": 4, + "endColumn": 37, + "start": 113, + "end": 116 + } }, "operator": "<", "right": { "type": "Identifier", "start": 119, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 40 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 119, - 122 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 4, + "startColumn": 40, + "endLine": 4, + "endColumn": 43, + "start": 119, + "end": 122 + } }, "location": { "startLine": 4, "startColumn": 34, "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 + "endColumn": 43, + "start": 113, + "end": 122 } }, "location": { 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..411e0b5108 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 @@ -129,29 +129,15 @@ "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 + "endColumn": 33, + "start": 54, + "end": 58 } }, "location": { @@ -234,29 +220,15 @@ "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 + "endColumn": 35, + "start": 99, + "end": 104 } }, "location": { 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..27ba6d6a76 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 @@ -135,39 +135,19 @@ "type": "CallExpression", "start": 58, "end": 66, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 41 - } - }, - "range": [ - 58, - 66 - ], "callee": { "type": "Identifier", "start": 58, "end": 64, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 39 - } - }, - "range": [ - 58, - 64 - ], - "name": "getBaz" + "name": "getBaz", + "location": { + "startLine": 3, + "startColumn": 33, + "endLine": 3, + "endColumn": 39, + "start": 58, + "end": 64 + } }, "arguments": [], "optional": false, @@ -175,9 +155,9 @@ "startLine": 3, "startColumn": 33, "endLine": 3, - "endColumn": 43, - "start": 57, - "end": 67 + "endColumn": 41, + "start": 58, + "end": 66 } }, "location": { 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..4b23819a48 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 @@ -120,100 +120,62 @@ "type": "MemberExpression", "start": 48, "end": 60, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 49 - } - }, - "range": [ - 48, - 60 - ], "object": { "type": "MemberExpression", "start": 48, "end": 55, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 44 - } - }, - "range": [ - 48, - 55 - ], "object": { "type": "Identifier", "start": 48, "end": 51, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 40 - } - }, - "range": [ - 48, - 51 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 2, + "startColumn": 37, + "endLine": 2, + "endColumn": 40, + "start": 48, + "end": 51 + } }, "property": { "type": "Identifier", "start": 52, "end": 55, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 44 - } - }, - "range": [ - 52, - 55 - ], - "name": "arr" + "name": "arr", + "location": { + "startLine": 2, + "startColumn": 41, + "endLine": 2, + "endColumn": 44, + "start": 52, + "end": 55 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 2, + "startColumn": 37, + "endLine": 2, + "endColumn": 44, + "start": 48, + "end": 55 + } }, "property": { "type": "Identifier", "start": 56, "end": 59, - "loc": { - "start": { - "line": 2, - "column": 45 - }, - "end": { - "line": 2, - "column": 48 - } - }, - "range": [ - 56, - 59 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 2, + "startColumn": 45, + "endLine": 2, + "endColumn": 48, + "start": 56, + "end": 59 + } }, "computed": true, "optional": false, @@ -221,9 +183,9 @@ "startLine": 2, "startColumn": 37, "endLine": 2, - "endColumn": 51, - "start": 47, - "end": 61 + "endColumn": 49, + "start": 48, + "end": 60 } }, "location": { @@ -258,141 +220,91 @@ "type": "MemberExpression", "start": 63, "end": 80, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 69 - } - }, - "range": [ - 63, - 80 - ], "object": { "type": "MemberExpression", "start": 63, "end": 74, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 63 - } - }, - "range": [ - 63, - 74 - ], "object": { "type": "MemberExpression", "start": 63, "end": 70, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 59 - } - }, - "range": [ - 63, - 70 - ], "object": { "type": "Identifier", "start": 63, "end": 66, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 55 - } - }, - "range": [ - 63, - 66 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 2, + "startColumn": 52, + "endLine": 2, + "endColumn": 55, + "start": 63, + "end": 66 + } }, "property": { "type": "Identifier", "start": 67, "end": 70, - "loc": { - "start": { - "line": 2, - "column": 56 - }, - "end": { - "line": 2, - "column": 59 - } - }, - "range": [ - 67, - 70 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 2, + "startColumn": 56, + "endLine": 2, + "endColumn": 59, + "start": 67, + "end": 70 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 2, + "startColumn": 52, + "endLine": 2, + "endColumn": 59, + "start": 63, + "end": 70 + } }, "property": { "type": "Identifier", "start": 71, "end": 74, - "loc": { - "start": { - "line": 2, - "column": 60 - }, - "end": { - "line": 2, - "column": 63 - } - }, - "range": [ - 71, - 74 - ], - "name": "arr" + "name": "arr", + "location": { + "startLine": 2, + "startColumn": 60, + "endLine": 2, + "endColumn": 63, + "start": 71, + "end": 74 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 2, + "startColumn": 52, + "endLine": 2, + "endColumn": 63, + "start": 63, + "end": 74 + } }, "property": { "type": "Identifier", "start": 75, "end": 79, - "loc": { - "start": { - "line": 2, - "column": 64 - }, - "end": { - "line": 2, - "column": 68 - } - }, - "range": [ - 75, - 79 - ], - "name": "quux" + "name": "quux", + "location": { + "startLine": 2, + "startColumn": 64, + "endLine": 2, + "endColumn": 68, + "start": 75, + "end": 79 + } }, "computed": true, "optional": false, @@ -400,9 +312,9 @@ "startLine": 2, "startColumn": 52, "endLine": 2, - "endColumn": 71, - "start": 62, - "end": 81 + "endColumn": 69, + "start": 63, + "end": 80 } }, "location": { @@ -437,141 +349,91 @@ "type": "MemberExpression", "start": 83, "end": 100, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 89 - } - }, - "range": [ - 83, - 100 - ], "object": { "type": "MemberExpression", "start": 83, "end": 90, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 79 - } - }, - "range": [ - 83, - 90 - ], "object": { "type": "Identifier", "start": 83, "end": 86, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 75 - } - }, - "range": [ - 83, - 86 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 2, + "startColumn": 72, + "endLine": 2, + "endColumn": 75, + "start": 83, + "end": 86 + } }, "property": { "type": "Identifier", "start": 87, "end": 90, - "loc": { - "start": { - "line": 2, - "column": 76 - }, - "end": { - "line": 2, - "column": 79 - } - }, - "range": [ - 87, - 90 - ], - "name": "arr" + "name": "arr", + "location": { + "startLine": 2, + "startColumn": 76, + "endLine": 2, + "endColumn": 79, + "start": 87, + "end": 90 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 2, + "startColumn": 72, + "endLine": 2, + "endColumn": 79, + "start": 83, + "end": 90 + } }, "property": { "type": "MemberExpression", "start": 91, "end": 99, - "loc": { - "start": { - "line": 2, - "column": 80 - }, - "end": { - "line": 2, - "column": 88 - } - }, - "range": [ - 91, - 99 - ], "object": { "type": "Identifier", "start": 91, "end": 94, - "loc": { - "start": { - "line": 2, - "column": 80 - }, - "end": { - "line": 2, - "column": 83 - } - }, - "range": [ - 91, - 94 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 2, + "startColumn": 80, + "endLine": 2, + "endColumn": 83, + "start": 91, + "end": 94 + } }, "property": { "type": "Identifier", "start": 95, "end": 99, - "loc": { - "start": { - "line": 2, - "column": 84 - }, - "end": { - "line": 2, - "column": 88 - } - }, - "range": [ - 95, - 99 - ], - "name": "quux" + "name": "quux", + "location": { + "startLine": 2, + "startColumn": 84, + "endLine": 2, + "endColumn": 88, + "start": 95, + "end": 99 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 2, + "startColumn": 80, + "endLine": 2, + "endColumn": 88, + "start": 91, + "end": 99 + } }, "computed": true, "optional": false, @@ -579,9 +441,9 @@ "startLine": 2, "startColumn": 72, "endLine": 2, - "endColumn": 91, - "start": 82, - "end": 101 + "endColumn": 89, + "start": 83, + "end": 100 } }, "location": { 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..07214eafb1 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 @@ -128,28 +128,14 @@ "type": "Identifier", "start": 53, "end": 56, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 31 - } - }, - "range": [ - 53, - 56 - ], "name": "foo", "location": { "startLine": 3, "startColumn": 28, "endLine": 3, - "endColumn": 33, - "start": 52, - "end": 57 + "endColumn": 31, + "start": 53, + "end": 56 } }, "location": { @@ -231,28 +217,14 @@ "type": "Identifier", "start": 98, "end": 101, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "range": [ - 98, - 101 - ], "name": "foo", "location": { "startLine": 4, - "startColumn": 30, + "startColumn": 31, "endLine": 4, - "endColumn": 37, - "start": 96, - "end": 103 + "endColumn": 34, + "start": 98, + "end": 101 } }, "location": { @@ -334,28 +306,14 @@ "type": "Identifier", "start": 145, "end": 148, - "loc": { - "start": { - "line": 5, - "column": 32 - }, - "end": { - "line": 5, - "column": 35 - } - }, - "range": [ - 145, - 148 - ], "name": "foo", "location": { "startLine": 5, - "startColumn": 30, + "startColumn": 32, "endLine": 5, - "endColumn": 39, - "start": 142, - "end": 151 + "endColumn": 35, + "start": 145, + "end": 148 } }, "location": { @@ -437,28 +395,14 @@ "type": "Identifier", "start": 194, "end": 197, - "loc": { - "start": { - "line": 6, - "column": 33 - }, - "end": { - "line": 6, - "column": 36 - } - }, - "range": [ - 194, - 197 - ], "name": "foo", "location": { "startLine": 6, - "startColumn": 31, + "startColumn": 33, "endLine": 6, - "endColumn": 39, - "start": 191, - "end": 199 + "endColumn": 36, + "start": 194, + "end": 197 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/member-expr/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/member-expr/ast.json index 3981cd75f1..aed71ee175 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/member-expr/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/member-expr/ast.json @@ -141,100 +141,62 @@ "type": "MemberExpression", "start": 57, "end": 68, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 57, - 68 - ], "object": { "type": "MemberExpression", "start": 57, "end": 64, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 39 - } - }, - "range": [ - 57, - 64 - ], "object": { "type": "Identifier", "start": 57, "end": 60, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 35 - } - }, - "range": [ - 57, - 60 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 32, + "endLine": 3, + "endColumn": 35, + "start": 57, + "end": 60 + } }, "property": { "type": "Identifier", "start": 61, "end": 64, - "loc": { - "start": { - "line": 3, - "column": 36 - }, - "end": { - "line": 3, - "column": 39 - } - }, - "range": [ - 61, - 64 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 36, + "endLine": 3, + "endColumn": 39, + "start": 61, + "end": 64 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 3, + "startColumn": 32, + "endLine": 3, + "endColumn": 39, + "start": 57, + "end": 64 + } }, "property": { "type": "Identifier", "start": 65, "end": 68, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 65, - 68 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 3, + "startColumn": 40, + "endLine": 3, + "endColumn": 43, + "start": 65, + "end": 68 + } }, "computed": false, "optional": false, @@ -242,9 +204,9 @@ "startLine": 3, "startColumn": 32, "endLine": 3, - "endColumn": 45, - "start": 56, - "end": 69 + "endColumn": 43, + "start": 57, + "end": 68 } }, "location": { @@ -339,59 +301,33 @@ "type": "MemberExpression", "start": 113, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 113, - 122 - ], "object": { "type": "Identifier", "start": 114, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 38 - } - }, - "range": [ - 114, - 117 - ], - "name": "biz" + "name": "biz", + "location": { + "startLine": 4, + "startColumn": 35, + "endLine": 4, + "endColumn": 38, + "start": 114, + "end": 117 + } }, "property": { "type": "Identifier", "start": 119, "end": 122, - "loc": { - "start": { - "line": 4, - "column": 40 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 119, - 122 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 4, + "startColumn": 40, + "endLine": 4, + "endColumn": 43, + "start": 119, + "end": 122 + } }, "computed": false, "optional": false, @@ -399,9 +335,9 @@ "startLine": 4, "startColumn": 34, "endLine": 4, - "endColumn": 45, - "start": 112, - "end": 123 + "endColumn": 43, + "start": 113, + "end": 122 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/null-literal/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/null-literal/ast.json index 2d5828746e..afa3c906ba 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/null-literal/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/null-literal/ast.json @@ -129,29 +129,15 @@ "type": "Literal", "start": 54, "end": 58, - "loc": { - "start": { - "line": 3, - "column": 29 - }, - "end": { - "line": 3, - "column": 33 - } - }, - "range": [ - 54, - 58 - ], "value": null, "raw": "null", "location": { "startLine": 3, "startColumn": 29, "endLine": 3, - "endColumn": 35, - "start": 53, - "end": 59 + "endColumn": 33, + "start": 54, + "end": 58 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/numeric-literal-int/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/numeric-literal-int/ast.json index c781e8e398..7949a10689 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/numeric-literal-int/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/numeric-literal-int/ast.json @@ -129,29 +129,15 @@ "type": "Literal", "start": 52, "end": 54, - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 29 - } - }, - "range": [ - 52, - 54 - ], "value": 42, "raw": "42", "location": { "startLine": 3, "startColumn": 27, "endLine": 3, - "endColumn": 31, - "start": 51, - "end": 55 + "endColumn": 29, + "start": 52, + "end": 54 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/object-expr/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/object-expr/ast.json index 21d8288402..a110cf5c5b 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/object-expr/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/object-expr/ast.json @@ -151,75 +151,19 @@ "type": "CallExpression", "start": 70, "end": 100, - "loc": { - "start": { - "line": 3, - "column": 45 - }, - "end": { - "line": 3, - "column": 75 - } - }, - "range": [ - 70, - 100 - ], "callee": { "type": "MemberExpression", "start": 70, "end": 98, - "loc": { - "start": { - "line": 3, - "column": 45 - }, - "end": { - "line": 3, - "column": 73 - } - }, - "range": [ - 70, - 98 - ], "object": { "type": "ObjectExpression", "start": 71, "end": 88, - "loc": { - "start": { - "line": 3, - "column": 46 - }, - "end": { - "line": 3, - "column": 63 - } - }, - "range": [ - 71, - 88 - ], "properties": [ { "type": "Property", "start": 73, "end": 87, - "loc": { - "start": { - "line": 3, - "column": 48 - }, - "end": { - "line": 3, - "column": 62 - } - }, - "range": [ - 73, - 87 - ], "method": false, "shorthand": false, "computed": false, @@ -227,69 +171,75 @@ "type": "Identifier", "start": 73, "end": 76, - "loc": { - "start": { - "line": 3, - "column": 48 - }, - "end": { - "line": 3, - "column": 51 - } - }, - "range": [ - 73, - 76 - ], - "name": "obj" + "name": "obj", + "location": { + "startLine": 3, + "startColumn": 48, + "endLine": 3, + "endColumn": 51, + "start": 73, + "end": 76 + } }, "value": { "type": "Literal", "start": 78, "end": 87, - "loc": { - "start": { - "line": 3, - "column": 53 - }, - "end": { - "line": 3, - "column": 62 - } - }, - "range": [ - 78, - 87 - ], "value": "literal", - "raw": "'literal'" + "raw": "'literal'", + "location": { + "startLine": 3, + "startColumn": 53, + "endLine": 3, + "endColumn": 62, + "start": 78, + "end": 87 + } }, - "kind": "init" + "kind": "init", + "location": { + "startLine": 3, + "startColumn": 48, + "endLine": 3, + "endColumn": 62, + "start": 73, + "end": 87 + } } - ] + ], + "location": { + "startLine": 3, + "startColumn": 46, + "endLine": 3, + "endColumn": 63, + "start": 71, + "end": 88 + } }, "property": { "type": "Identifier", "start": 90, "end": 98, - "loc": { - "start": { - "line": 3, - "column": 65 - }, - "end": { - "line": 3, - "column": 73 - } - }, - "range": [ - 90, - 98 - ], - "name": "toString" + "name": "toString", + "location": { + "startLine": 3, + "startColumn": 65, + "endLine": 3, + "endColumn": 73, + "start": 90, + "end": 98 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 3, + "startColumn": 45, + "endLine": 3, + "endColumn": 73, + "start": 70, + "end": 98 + } }, "arguments": [], "optional": false, @@ -297,9 +247,9 @@ "startLine": 3, "startColumn": 45, "endLine": 3, - "endColumn": 77, - "start": 69, - "end": 101 + "endColumn": 75, + "start": 70, + "end": 100 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/optional-call-expr/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/optional-call-expr/ast.json index 75d6965173..27f446c5a8 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/optional-call-expr/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/optional-call-expr/ast.json @@ -147,131 +147,87 @@ "type": "ChainExpression", "start": 60, "end": 75, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 50 - } - }, - "range": [ - 60, - 75 - ], "expression": { "type": "CallExpression", "start": 60, "end": 75, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 50 - } - }, - "range": [ - 60, - 75 - ], "callee": { "type": "MemberExpression", "start": 60, "end": 69, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 44 - } - }, - "range": [ - 60, - 69 - ], "object": { "type": "Identifier", "start": 60, "end": 63, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 38 - } - }, - "range": [ - 60, - 63 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 3, + "startColumn": 35, + "endLine": 3, + "endColumn": 38, + "start": 60, + "end": 63 + } }, "property": { "type": "Identifier", "start": 65, "end": 69, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 44 - } - }, - "range": [ - 65, - 69 - ], - "name": "buzz" + "name": "buzz", + "location": { + "startLine": 3, + "startColumn": 40, + "endLine": 3, + "endColumn": 44, + "start": 65, + "end": 69 + } }, "computed": false, - "optional": true + "optional": true, + "location": { + "startLine": 3, + "startColumn": 35, + "endLine": 3, + "endColumn": 44, + "start": 60, + "end": 69 + } }, "arguments": [ { "type": "Literal", "start": 72, "end": 74, - "loc": { - "start": { - "line": 3, - "column": 47 - }, - "end": { - "line": 3, - "column": 49 - } - }, - "range": [ - 72, - 74 - ], "value": 42, - "raw": "42" + "raw": "42", + "location": { + "startLine": 3, + "startColumn": 47, + "endLine": 3, + "endColumn": 49, + "start": 72, + "end": 74 + } } ], - "optional": true + "optional": true, + "location": { + "startLine": 3, + "startColumn": 35, + "endLine": 3, + "endColumn": 50, + "start": 60, + "end": 75 + } }, "location": { "startLine": 3, "startColumn": 35, "endLine": 3, - "endColumn": 52, - "start": 59, - "end": 76 + "endColumn": 50, + "start": 60, + "end": 75 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/string-literal/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/string-literal/ast.json index 94b4031dea..c3e1a3b5b5 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/string-literal/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/string-literal/ast.json @@ -129,29 +129,15 @@ "type": "Literal", "start": 55, "end": 64, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 39 - } - }, - "range": [ - 55, - 64 - ], "value": "foo foo", "raw": "'foo foo'", "location": { "startLine": 3, "startColumn": 30, "endLine": 3, - "endColumn": 41, - "start": 54, - "end": 65 + "endColumn": 39, + "start": 55, + "end": 64 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal-tagged/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal-tagged/ast.json index 435a96d3a6..467d914939 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal-tagged/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal-tagged/ast.json @@ -168,78 +168,38 @@ "type": "TaggedTemplateExpression", "start": 74, "end": 98, - "loc": { - "start": { - "line": 3, - "column": 49 - }, - "end": { - "line": 3, - "column": 73 - } - }, - "range": [ - 74, - 98 - ], "tag": { "type": "Identifier", "start": 74, "end": 77, - "loc": { - "start": { - "line": 3, - "column": 49 - }, - "end": { - "line": 3, - "column": 52 - } - }, - "range": [ - 74, - 77 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 49, + "endLine": 3, + "endColumn": 52, + "start": 74, + "end": 77 + } }, "quasi": { "type": "TemplateLiteral", "start": 77, "end": 98, - "loc": { - "start": { - "line": 3, - "column": 52 - }, - "end": { - "line": 3, - "column": 73 - } - }, - "range": [ - 77, - 98 - ], "expressions": [ { "type": "Identifier", "start": 91, "end": 96, - "loc": { - "start": { - "line": 3, - "column": 66 - }, - "end": { - "line": 3, - "column": 71 - } - }, - "range": [ - 91, - 96 - ], - "name": "bizzy" + "name": "bizzy", + "location": { + "startLine": 3, + "startColumn": 66, + "endLine": 3, + "endColumn": 71, + "start": 91, + "end": 96 + } } ], "quasis": [ @@ -247,59 +207,55 @@ "type": "TemplateElement", "start": 78, "end": 89, - "loc": { - "start": { - "line": 3, - "column": 53 - }, - "end": { - "line": 3, - "column": 64 - } - }, - "range": [ - 78, - 89 - ], "value": { "raw": "barzy-bazzy", "cooked": "barzy-bazzy" }, - "tail": false + "tail": false, + "location": { + "startLine": 3, + "startColumn": 53, + "endLine": 3, + "endColumn": 64, + "start": 78, + "end": 89 + } }, { "type": "TemplateElement", "start": 97, "end": 97, - "loc": { - "start": { - "line": 3, - "column": 72 - }, - "end": { - "line": 3, - "column": 72 - } - }, - "range": [ - 97, - 97 - ], "value": { "raw": "", "cooked": "" }, - "tail": true + "tail": true, + "location": { + "startLine": 3, + "startColumn": 72, + "endLine": 3, + "endColumn": 72, + "start": 97, + "end": 97 + } } - ] + ], + "location": { + "startLine": 3, + "startColumn": 52, + "endLine": 3, + "endColumn": 73, + "start": 77, + "end": 98 + } }, "location": { "startLine": 3, "startColumn": 49, "endLine": 3, - "endColumn": 75, - "start": 73, - "end": 99 + "endColumn": 73, + "start": 74, + "end": 98 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal/ast.json index c26c157db5..2dce8c675e 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/template-literal/ast.json @@ -173,60 +173,34 @@ "type": "TemplateLiteral", "start": 74, "end": 98, - "loc": { - "start": { - "line": 3, - "column": 49 - }, - "end": { - "line": 3, - "column": 73 - } - }, - "range": [ - 74, - 98 - ], "expressions": [ { "type": "Identifier", "start": 77, "end": 81, - "loc": { - "start": { - "line": 3, - "column": 52 - }, - "end": { - "line": 3, - "column": 56 - } - }, - "range": [ - 77, - 81 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 3, + "startColumn": 52, + "endLine": 3, + "endColumn": 56, + "start": 77, + "end": 81 + } }, { "type": "Identifier", "start": 86, "end": 96, - "loc": { - "start": { - "line": 3, - "column": 61 - }, - "end": { - "line": 3, - "column": 71 - } - }, - "range": [ - 86, - 96 - ], - "name": "occupation" + "name": "occupation", + "location": { + "startLine": 3, + "startColumn": 61, + "endLine": 3, + "endColumn": 71, + "start": 86, + "end": 96 + } } ], "quasis": [ @@ -234,82 +208,64 @@ "type": "TemplateElement", "start": 75, "end": 75, - "loc": { - "start": { - "line": 3, - "column": 50 - }, - "end": { - "line": 3, - "column": 50 - } - }, - "range": [ - 75, - 75 - ], "value": { "raw": "", "cooked": "" }, - "tail": false + "tail": false, + "location": { + "startLine": 3, + "startColumn": 50, + "endLine": 3, + "endColumn": 50, + "start": 75, + "end": 75 + } }, { "type": "TemplateElement", "start": 82, "end": 84, - "loc": { - "start": { - "line": 3, - "column": 57 - }, - "end": { - "line": 3, - "column": 59 - } - }, - "range": [ - 82, - 84 - ], "value": { "raw": ": ", "cooked": ": " }, - "tail": false + "tail": false, + "location": { + "startLine": 3, + "startColumn": 57, + "endLine": 3, + "endColumn": 59, + "start": 82, + "end": 84 + } }, { "type": "TemplateElement", "start": 97, "end": 97, - "loc": { - "start": { - "line": 3, - "column": 72 - }, - "end": { - "line": 3, - "column": 72 - } - }, - "range": [ - 97, - 97 - ], "value": { "raw": "", "cooked": "" }, - "tail": true + "tail": true, + "location": { + "startLine": 3, + "startColumn": 72, + "endLine": 3, + "endColumn": 72, + "start": 97, + "end": 97 + } } ], "location": { "startLine": 3, "startColumn": 49, "endLine": 3, - "endColumn": 75, - "start": 73, - "end": 99 + "endColumn": 73, + "start": 74, + "end": 98 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/ternary/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/ternary/ast.json index 1be6734105..40ee253620 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/ternary/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/ternary/ast.json @@ -145,87 +145,55 @@ "type": "ConditionalExpression", "start": 65, "end": 80, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 55 - } - }, - "range": [ - 65, - 80 - ], "test": { "type": "Identifier", "start": 65, "end": 68, - "loc": { - "start": { - "line": 3, - "column": 40 - }, - "end": { - "line": 3, - "column": 43 - } - }, - "range": [ - 65, - 68 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 3, + "startColumn": 40, + "endLine": 3, + "endColumn": 43, + "start": 65, + "end": 68 + } }, "consequent": { "type": "Identifier", "start": 71, "end": 74, - "loc": { - "start": { - "line": 3, - "column": 46 - }, - "end": { - "line": 3, - "column": 49 - } - }, - "range": [ - 71, - 74 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 46, + "endLine": 3, + "endColumn": 49, + "start": 71, + "end": 74 + } }, "alternate": { "type": "Identifier", "start": 77, "end": 80, - "loc": { - "start": { - "line": 3, - "column": 52 - }, - "end": { - "line": 3, - "column": 55 - } - }, - "range": [ - 77, - 80 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 3, + "startColumn": 52, + "endLine": 3, + "endColumn": 55, + "start": 77, + "end": 80 + } }, "location": { "startLine": 3, "startColumn": 40, "endLine": 3, - "endColumn": 57, - "start": 64, - "end": 81 + "endColumn": 55, + "start": 65, + "end": 80 } }, "location": { @@ -324,87 +292,55 @@ "type": "ConditionalExpression", "start": 127, "end": 138, - "loc": { - "start": { - "line": 4, - "column": 36 - }, - "end": { - "line": 4, - "column": 47 - } - }, - "range": [ - 127, - 138 - ], "test": { "type": "Identifier", "start": 127, "end": 130, - "loc": { - "start": { - "line": 4, - "column": 36 - }, - "end": { - "line": 4, - "column": 39 - } - }, - "range": [ - 127, - 130 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 4, + "startColumn": 36, + "endLine": 4, + "endColumn": 39, + "start": 127, + "end": 130 + } }, "consequent": { "type": "Identifier", "start": 131, "end": 134, - "loc": { - "start": { - "line": 4, - "column": 40 - }, - "end": { - "line": 4, - "column": 43 - } - }, - "range": [ - 131, - 134 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 4, + "startColumn": 40, + "endLine": 4, + "endColumn": 43, + "start": 131, + "end": 134 + } }, "alternate": { "type": "Identifier", "start": 135, "end": 138, - "loc": { - "start": { - "line": 4, - "column": 44 - }, - "end": { - "line": 4, - "column": 47 - } - }, - "range": [ - 135, - 138 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 4, + "startColumn": 44, + "endLine": 4, + "endColumn": 47, + "start": 135, + "end": 138 + } }, "location": { "startLine": 4, "startColumn": 36, "endLine": 4, - "endColumn": 49, - "start": 126, - "end": 139 + "endColumn": 47, + "start": 127, + "end": 138 } }, "location": { @@ -520,146 +456,96 @@ "type": "ConditionalExpression", "start": 205, "end": 233, - "loc": { - "start": { - "line": 5, - "column": 56 - }, - "end": { - "line": 5, - "column": 84 - } - }, - "range": [ - 205, - 233 - ], "test": { "type": "Identifier", "start": 205, "end": 208, - "loc": { - "start": { - "line": 5, - "column": 56 - }, - "end": { - "line": 5, - "column": 59 - } - }, - "range": [ - 205, - 208 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 5, + "startColumn": 56, + "endLine": 5, + "endColumn": 59, + "start": 205, + "end": 208 + } }, "consequent": { "type": "Identifier", "start": 211, "end": 214, - "loc": { - "start": { - "line": 5, - "column": 62 - }, - "end": { - "line": 5, - "column": 65 - } - }, - "range": [ - 211, - 214 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 5, + "startColumn": 62, + "endLine": 5, + "endColumn": 65, + "start": 211, + "end": 214 + } }, "alternate": { "type": "ConditionalExpression", "start": 217, "end": 233, - "loc": { - "start": { - "line": 5, - "column": 68 - }, - "end": { - "line": 5, - "column": 84 - } - }, - "range": [ - 217, - 233 - ], "test": { "type": "Identifier", "start": 217, "end": 220, - "loc": { - "start": { - "line": 5, - "column": 68 - }, - "end": { - "line": 5, - "column": 71 - } - }, - "range": [ - 217, - 220 - ], - "name": "baz" + "name": "baz", + "location": { + "startLine": 5, + "startColumn": 68, + "endLine": 5, + "endColumn": 71, + "start": 217, + "end": 220 + } }, "consequent": { "type": "Identifier", "start": 223, "end": 226, - "loc": { - "start": { - "line": 5, - "column": 74 - }, - "end": { - "line": 5, - "column": 77 - } - }, - "range": [ - 223, - 226 - ], - "name": "biz" + "name": "biz", + "location": { + "startLine": 5, + "startColumn": 74, + "endLine": 5, + "endColumn": 77, + "start": 223, + "end": 226 + } }, "alternate": { "type": "Identifier", "start": 229, "end": 233, - "loc": { - "start": { - "line": 5, - "column": 80 - }, - "end": { - "line": 5, - "column": 84 - } - }, - "range": [ - 229, - 233 - ], - "name": "buzz" + "name": "buzz", + "location": { + "startLine": 5, + "startColumn": 80, + "endLine": 5, + "endColumn": 84, + "start": 229, + "end": 233 + } + }, + "location": { + "startLine": 5, + "startColumn": 68, + "endLine": 5, + "endColumn": 84, + "start": 217, + "end": 233 } }, "location": { "startLine": 5, - "startColumn": 55, + "startColumn": 56, "endLine": 5, - "endColumn": 87, - "start": 203, - "end": 235 + "endColumn": 84, + "start": 205, + "end": 233 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/text-node-adjacency/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/text-node-adjacency/ast.json index 1eebce1650..255a0c0e52 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/text-node-adjacency/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/text-node-adjacency/ast.json @@ -100,28 +100,14 @@ "type": "Identifier", "start": 39, "end": 46, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 21 - } - }, - "range": [ - 39, - 46 - ], "name": "noSpace", "location": { "startLine": 3, "startColumn": 14, "endLine": 3, - "endColumn": 23, - "start": 38, - "end": 47 + "endColumn": 21, + "start": 39, + "end": 46 } }, "location": { @@ -175,28 +161,14 @@ "type": "Identifier", "start": 68, "end": 78, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 24 - } - }, - "range": [ - 68, - 78 - ], "name": "spaceRight", "location": { "startLine": 4, "startColumn": 14, "endLine": 4, - "endColumn": 26, - "start": 67, - "end": 79 + "endColumn": 24, + "start": 68, + "end": 78 } }, "location": { @@ -282,28 +254,14 @@ "type": "Identifier", "start": 102, "end": 111, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 24 - } - }, - "range": [ - 102, - 111 - ], "name": "spaceLeft", "location": { "startLine": 5, "startColumn": 15, "endLine": 5, - "endColumn": 26, - "start": 101, - "end": 112 + "endColumn": 24, + "start": 102, + "end": 111 } }, "location": { @@ -357,28 +315,14 @@ "type": "Identifier", "start": 133, "end": 136, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 17 - } - }, - "range": [ - 133, - 136 - ], "name": "one", "location": { "startLine": 6, "startColumn": 14, "endLine": 6, - "endColumn": 19, - "start": 132, - "end": 137 + "endColumn": 17, + "start": 133, + "end": 136 } }, "location": { @@ -397,28 +341,14 @@ "type": "Identifier", "start": 138, "end": 141, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 22 - } - }, - "range": [ - 138, - 141 - ], "name": "two", "location": { "startLine": 6, "startColumn": 19, "endLine": 6, - "endColumn": 24, - "start": 137, - "end": 142 + "endColumn": 22, + "start": 138, + "end": 141 } }, "location": { @@ -488,28 +418,14 @@ "type": "Identifier", "start": 164, "end": 167, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 18 - } - }, - "range": [ - 164, - 167 - ], "name": "one", "location": { "startLine": 7, "startColumn": 15, "endLine": 7, - "endColumn": 20, - "start": 163, - "end": 168 + "endColumn": 18, + "start": 164, + "end": 167 } }, "location": { @@ -528,28 +444,14 @@ "type": "Identifier", "start": 169, "end": 172, - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 23 - } - }, - "range": [ - 169, - 172 - ], "name": "two", "location": { "startLine": 7, "startColumn": 20, "endLine": 7, - "endColumn": 25, - "start": 168, - "end": 173 + "endColumn": 23, + "start": 169, + "end": 172 } }, "location": { @@ -603,28 +505,14 @@ "type": "Identifier", "start": 194, "end": 197, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 17 - } - }, - "range": [ - 194, - 197 - ], "name": "one", "location": { "startLine": 8, "startColumn": 14, "endLine": 8, - "endColumn": 19, - "start": 193, - "end": 198 + "endColumn": 17, + "start": 194, + "end": 197 } }, "location": { @@ -643,28 +531,14 @@ "type": "Identifier", "start": 199, "end": 202, - "loc": { - "start": { - "line": 8, - "column": 19 - }, - "end": { - "line": 8, - "column": 22 - } - }, - "range": [ - 199, - 202 - ], "name": "two", "location": { "startLine": 8, "startColumn": 19, "endLine": 8, - "endColumn": 24, - "start": 198, - "end": 203 + "endColumn": 22, + "start": 199, + "end": 202 } }, "location": { @@ -734,28 +608,14 @@ "type": "Identifier", "start": 225, "end": 228, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 17 - } - }, - "range": [ - 225, - 228 - ], "name": "one", "location": { "startLine": 9, "startColumn": 14, "endLine": 9, - "endColumn": 19, - "start": 224, - "end": 229 + "endColumn": 17, + "start": 225, + "end": 228 } }, "location": { @@ -790,28 +650,14 @@ "type": "Identifier", "start": 231, "end": 234, - "loc": { - "start": { - "line": 9, - "column": 20 - }, - "end": { - "line": 9, - "column": 23 - } - }, - "range": [ - 231, - 234 - ], "name": "two", "location": { "startLine": 9, "startColumn": 20, "endLine": 9, - "endColumn": 25, - "start": 230, - "end": 235 + "endColumn": 23, + "start": 231, + "end": 234 } }, "location": { @@ -881,28 +727,14 @@ "type": "Identifier", "start": 257, "end": 260, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 18 - } - }, - "range": [ - 257, - 260 - ], "name": "one", "location": { "startLine": 10, "startColumn": 15, "endLine": 10, - "endColumn": 20, - "start": 256, - "end": 261 + "endColumn": 18, + "start": 257, + "end": 260 } }, "location": { @@ -937,28 +769,14 @@ "type": "Identifier", "start": 263, "end": 266, - "loc": { - "start": { - "line": 10, - "column": 21 - }, - "end": { - "line": 10, - "column": 24 - } - }, - "range": [ - 263, - 266 - ], "name": "two", "location": { "startLine": 10, "startColumn": 21, "endLine": 10, - "endColumn": 26, - "start": 262, - "end": 267 + "endColumn": 24, + "start": 263, + "end": 266 } }, "location": { @@ -1012,28 +830,14 @@ "type": "Identifier", "start": 288, "end": 291, - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 17 - } - }, - "range": [ - 288, - 291 - ], "name": "one", "location": { "startLine": 11, "startColumn": 14, "endLine": 11, - "endColumn": 19, - "start": 287, - "end": 292 + "endColumn": 17, + "start": 288, + "end": 291 } }, "location": { @@ -1068,28 +872,14 @@ "type": "Identifier", "start": 294, "end": 297, - "loc": { - "start": { - "line": 11, - "column": 20 - }, - "end": { - "line": 11, - "column": 23 - } - }, - "range": [ - 294, - 297 - ], "name": "two", "location": { "startLine": 11, "startColumn": 20, "endLine": 11, - "endColumn": 25, - "start": 293, - "end": 298 + "endColumn": 23, + "start": 294, + "end": 297 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/unary-expr-bitwise/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/unary-expr-bitwise/ast.json index 8c59fef184..77c29af638 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/unary-expr-bitwise/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/unary-expr-bitwise/ast.json @@ -135,49 +135,29 @@ "type": "UnaryExpression", "start": 54, "end": 58, - "loc": { - "start": { - "line": 3, - "column": 29 - }, - "end": { - "line": 3, - "column": 33 - } - }, - "range": [ - 54, - 58 - ], "operator": "~", "prefix": true, "argument": { "type": "Identifier", "start": 55, "end": 58, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 33 - } - }, - "range": [ - 55, - 58 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 3, + "startColumn": 30, + "endLine": 3, + "endColumn": 33, + "start": 55, + "end": 58 + } }, "location": { "startLine": 3, "startColumn": 29, "endLine": 3, - "endColumn": 35, - "start": 53, - "end": 59 + "endColumn": 33, + "start": 54, + "end": 58 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/error-method-call/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/error-method-call/ast.json index 90b054ebf9..a82a85354b 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/error-method-call/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/error-method-call/ast.json @@ -67,90 +67,58 @@ "type": "CallExpression", "start": 20, "end": 33, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 22 - } - }, - "range": [ - 20, - 33 - ], "callee": { "type": "MemberExpression", "start": 20, "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 20 - } - }, - "range": [ - 20, - 31 - ], "object": { "type": "Identifier", "start": 20, "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 13 - } - }, - "range": [ - 20, - 24 - ], - "name": "Math" + "name": "Math", + "location": { + "startLine": 2, + "startColumn": 9, + "endLine": 2, + "endColumn": 13, + "start": 20, + "end": 24 + } }, "property": { "type": "Identifier", "start": 25, "end": 31, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 20 - } - }, - "range": [ - 25, - 31 - ], - "name": "random" + "name": "random", + "location": { + "startLine": 2, + "startColumn": 14, + "endLine": 2, + "endColumn": 20, + "start": 25, + "end": 31 + } }, "computed": false, - "optional": false + "optional": false, + "location": { + "startLine": 2, + "startColumn": 9, + "endLine": 2, + "endColumn": 20, + "start": 20, + "end": 31 + } }, "arguments": [], "optional": false, "location": { "startLine": 2, - "startColumn": 8, + "startColumn": 9, "endLine": 2, - "endColumn": 25, - "start": 18, - "end": 35 + "endColumn": 22, + "start": 20, + "end": 33 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/parenthesis/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/parenthesis/ast.json index 5f6bc4e6d5..7eaa6965c8 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/parenthesis/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/parenthesis/ast.json @@ -67,28 +67,14 @@ "type": "Identifier", "start": 23, "end": 26, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - } - }, - "range": [ - 23, - 26 - ], "name": "foo", "location": { "startLine": 2, - "startColumn": 10, + "startColumn": 12, "endLine": 2, - "endColumn": 19, - "start": 20, - "end": 29 + "endColumn": 15, + "start": 23, + "end": 26 } }, "location": { @@ -142,28 +128,14 @@ "type": "Identifier", "start": 49, "end": 52, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 16 - } - }, - "range": [ - 49, - 52 - ], "name": "foo", "location": { "startLine": 3, - "startColumn": 10, + "startColumn": 13, "endLine": 3, - "endColumn": 21, - "start": 45, - "end": 56 + "endColumn": 16, + "start": 49, + "end": 52 } }, "location": { @@ -217,69 +189,43 @@ "type": "MemberExpression", "start": 76, "end": 83, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "range": [ - 76, - 83 - ], "object": { "type": "Identifier", "start": 76, "end": 79, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 16 - } - }, - "range": [ - 76, - 79 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 4, + "startColumn": 13, + "endLine": 4, + "endColumn": 16, + "start": 76, + "end": 79 + } }, "property": { "type": "Identifier", "start": 80, "end": 83, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "range": [ - 80, - 83 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 4, + "startColumn": 17, + "endLine": 4, + "endColumn": 20, + "start": 80, + "end": 83 + } }, "computed": false, "optional": false, "location": { "startLine": 4, - "startColumn": 10, + "startColumn": 13, "endLine": 4, - "endColumn": 25, - "start": 72, - "end": 87 + "endColumn": 20, + "start": 76, + "end": 83 } }, "location": { @@ -333,69 +279,43 @@ "type": "MemberExpression", "start": 106, "end": 115, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 21 - } - }, - "range": [ - 106, - 115 - ], "object": { "type": "Identifier", "start": 107, "end": 110, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 16 - } - }, - "range": [ - 107, - 110 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 5, + "startColumn": 13, + "endLine": 5, + "endColumn": 16, + "start": 107, + "end": 110 + } }, "property": { "type": "Identifier", "start": 112, "end": 115, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 21 - } - }, - "range": [ - 112, - 115 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 5, + "startColumn": 18, + "endLine": 5, + "endColumn": 21, + "start": 112, + "end": 115 + } }, "computed": false, "optional": false, "location": { "startLine": 5, - "startColumn": 10, + "startColumn": 12, "endLine": 5, - "endColumn": 25, - "start": 103, - "end": 118 + "endColumn": 21, + "start": 106, + "end": 115 } }, "location": { @@ -449,69 +369,43 @@ "type": "MemberExpression", "start": 137, "end": 146, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 21 - } - }, - "range": [ - 137, - 146 - ], "object": { "type": "Identifier", "start": 138, "end": 141, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 16 - } - }, - "range": [ - 138, - 141 - ], - "name": "foo" + "name": "foo", + "location": { + "startLine": 6, + "startColumn": 13, + "endLine": 6, + "endColumn": 16, + "start": 138, + "end": 141 + } }, "property": { "type": "Identifier", "start": 143, "end": 146, - "loc": { - "start": { - "line": 6, - "column": 18 - }, - "end": { - "line": 6, - "column": 21 - } - }, - "range": [ - 143, - 146 - ], - "name": "bar" + "name": "bar", + "location": { + "startLine": 6, + "startColumn": 18, + "endLine": 6, + "endColumn": 21, + "start": 143, + "end": 146 + } }, "computed": false, "optional": false, "location": { "startLine": 6, - "startColumn": 10, + "startColumn": 12, "endLine": 6, - "endColumn": 25, - "start": 134, - "end": 149 + "endColumn": 21, + "start": 137, + "end": 146 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/tag/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/tag/ast.json index beb54731e1..3ba945939b 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/tag/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/expression/tag/ast.json @@ -67,28 +67,14 @@ "type": "Identifier", "start": 19, "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - } - }, - "range": [ - 19, - 23 - ], "name": "text", "location": { "startLine": 2, "startColumn": 8, "endLine": 2, - "endColumn": 14, - "start": 18, - "end": 24 + "endColumn": 12, + "start": 19, + "end": 23 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/metadata/used-attrs/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/metadata/used-attrs/ast.json index bac63ea14d..8f63051f1c 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/metadata/used-attrs/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/metadata/used-attrs/ast.json @@ -100,59 +100,33 @@ "type": "MemberExpression", "start": 37, "end": 44, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 19 - } - }, - "range": [ - 37, - 44 - ], "object": { "type": "Identifier", "start": 37, "end": 40, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 15 - } - }, - "range": [ - 37, - 40 - ], - "name": "obj" + "name": "obj", + "location": { + "startLine": 3, + "startColumn": 12, + "endLine": 3, + "endColumn": 15, + "start": 37, + "end": 40 + } }, "property": { "type": "Identifier", "start": 41, "end": 44, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 19 - } - }, - "range": [ - 41, - 44 - ], - "name": "sub" + "name": "sub", + "location": { + "startLine": 3, + "startColumn": 16, + "endLine": 3, + "endColumn": 19, + "start": 41, + "end": 44 + } }, "computed": false, "optional": false, @@ -160,9 +134,9 @@ "startLine": 3, "startColumn": 12, "endLine": 3, - "endColumn": 21, - "start": 36, - "end": 45 + "endColumn": 19, + "start": 37, + "end": 44 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/parsing-errors/invalid-template-attribute/enableStrictTemplateSyntax-flag-disabled/mixed-valid-invalid-attributes/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/parsing-errors/invalid-template-attribute/enableStrictTemplateSyntax-flag-disabled/mixed-valid-invalid-attributes/ast.json index 908ae05b47..ad8d834259 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/parsing-errors/invalid-template-attribute/enableStrictTemplateSyntax-flag-disabled/mixed-valid-invalid-attributes/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/parsing-errors/invalid-template-attribute/enableStrictTemplateSyntax-flag-disabled/mixed-valid-invalid-attributes/ast.json @@ -235,28 +235,14 @@ "type": "Identifier", "start": 147, "end": 151, - "loc": { - "start": { - "line": 5, - "column": 31 - }, - "end": { - "line": 5, - "column": 35 - } - }, - "range": [ - 147, - 151 - ], "name": "item", "location": { "startLine": 5, "startColumn": 31, "endLine": 5, - "endColumn": 37, - "start": 146, - "end": 152 + "endColumn": 35, + "start": 147, + "end": 151 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/regression/handler-memoization/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/regression/handler-memoization/ast.json index f7ca8561b3..573af49ed2 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/regression/handler-memoization/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/regression/handler-memoization/ast.json @@ -263,59 +263,33 @@ "type": "MemberExpression", "start": 161, "end": 171, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 27 - } - }, - "range": [ - 161, - 171 - ], "object": { "type": "Identifier", "start": 161, "end": 165, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 21 - } - }, - "range": [ - 161, - 165 - ], - "name": "task" + "name": "task", + "location": { + "startLine": 6, + "startColumn": 17, + "endLine": 6, + "endColumn": 21, + "start": 161, + "end": 165 + } }, "property": { "type": "Identifier", "start": 166, "end": 171, - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 27 - } - }, - "range": [ - 166, - 171 - ], - "name": "title" + "name": "title", + "location": { + "startLine": 6, + "startColumn": 22, + "endLine": 6, + "endColumn": 27, + "start": 166, + "end": 171 + } }, "computed": false, "optional": false, @@ -323,9 +297,9 @@ "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 29, - "start": 160, - "end": 172 + "endColumn": 27, + "start": 161, + "end": 171 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/child-default-slot-content/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/child-default-slot-content/ast.json index 172f625063..ea086a7251 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/child-default-slot-content/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/child-default-slot-content/ast.json @@ -128,28 +128,14 @@ "type": "Identifier", "start": 80, "end": 84, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 17 - } - }, - "range": [ - 80, - 84 - ], "name": "item", "location": { "startLine": 3, "startColumn": 13, "endLine": 3, - "endColumn": 19, - "start": 79, - "end": 85 + "endColumn": 17, + "start": 80, + "end": 84 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/name-is-expression/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/name-is-expression/ast.json index 121047a049..756580d83b 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/name-is-expression/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/name-is-expression/ast.json @@ -119,59 +119,33 @@ "type": "MemberExpression", "start": 96, "end": 103, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 26 - } - }, - "range": [ - 96, - 103 - ], "object": { "type": "Identifier", "start": 96, "end": 100, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 23 - } - }, - "range": [ - 96, - 100 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 4, + "startColumn": 19, + "endLine": 4, + "endColumn": 23, + "start": 96, + "end": 100 + } }, "property": { "type": "Identifier", "start": 101, "end": 103, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 26 - } - }, - "range": [ - 101, - 103 - ], - "name": "id" + "name": "id", + "location": { + "startLine": 4, + "startColumn": 24, + "endLine": 4, + "endColumn": 26, + "start": 101, + "end": 103 + } }, "computed": false, "optional": false, @@ -179,9 +153,9 @@ "startLine": 4, "startColumn": 19, "endLine": 4, - "endColumn": 28, - "start": 95, - "end": 104 + "endColumn": 26, + "start": 96, + "end": 103 } }, "location": { @@ -216,59 +190,33 @@ "type": "MemberExpression", "start": 108, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 40 - } - }, - "range": [ - 108, - 117 - ], "object": { "type": "Identifier", "start": 108, "end": 112, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 108, - 112 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 4, + "startColumn": 31, + "endLine": 4, + "endColumn": 35, + "start": 108, + "end": 112 + } }, "property": { "type": "Identifier", "start": 113, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 36 - }, - "end": { - "line": 4, - "column": 40 - } - }, - "range": [ - 113, - 117 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 4, + "startColumn": 36, + "endLine": 4, + "endColumn": 40, + "start": 113, + "end": 117 + } }, "computed": false, "optional": false, @@ -276,9 +224,9 @@ "startLine": 4, "startColumn": 31, "endLine": 4, - "endColumn": 42, - "start": 107, - "end": 118 + "endColumn": 40, + "start": 108, + "end": 117 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/nested-scoped-slot/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/nested-scoped-slot/ast.json index bc948639ab..2a88d7dcbb 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/nested-scoped-slot/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/nested-scoped-slot/ast.json @@ -301,59 +301,33 @@ "type": "MemberExpression", "start": 328, "end": 338, - "loc": { - "start": { - "line": 7, - "column": 38 - }, - "end": { - "line": 7, - "column": 48 - } - }, - "range": [ - 328, - 338 - ], "object": { "type": "Identifier", "start": 328, "end": 331, - "loc": { - "start": { - "line": 7, - "column": 38 - }, - "end": { - "line": 7, - "column": 41 - } - }, - "range": [ - 328, - 331 - ], - "name": "row" + "name": "row", + "location": { + "startLine": 7, + "startColumn": 38, + "endLine": 7, + "endColumn": 41, + "start": 328, + "end": 331 + } }, "property": { "type": "Identifier", "start": 332, "end": 338, - "loc": { - "start": { - "line": 7, - "column": 42 - }, - "end": { - "line": 7, - "column": 48 - } - }, - "range": [ - 332, - 338 - ], - "name": "number" + "name": "number", + "location": { + "startLine": 7, + "startColumn": 42, + "endLine": 7, + "endColumn": 48, + "start": 332, + "end": 338 + } }, "computed": false, "optional": false, @@ -361,9 +335,9 @@ "startLine": 7, "startColumn": 38, "endLine": 7, - "endColumn": 50, - "start": 327, - "end": 339 + "endColumn": 48, + "start": 328, + "end": 338 } }, "location": { @@ -398,59 +372,33 @@ "type": "MemberExpression", "start": 343, "end": 356, - "loc": { - "start": { - "line": 7, - "column": 53 - }, - "end": { - "line": 7, - "column": 66 - } - }, - "range": [ - 343, - 356 - ], "object": { "type": "Identifier", "start": 343, "end": 349, - "loc": { - "start": { - "line": 7, - "column": 53 - }, - "end": { - "line": 7, - "column": 59 - } - }, - "range": [ - 343, - 349 - ], - "name": "column" + "name": "column", + "location": { + "startLine": 7, + "startColumn": 53, + "endLine": 7, + "endColumn": 59, + "start": 343, + "end": 349 + } }, "property": { "type": "Identifier", "start": 350, "end": 356, - "loc": { - "start": { - "line": 7, - "column": 60 - }, - "end": { - "line": 7, - "column": 66 - } - }, - "range": [ - 350, - 356 - ], - "name": "number" + "name": "number", + "location": { + "startLine": 7, + "startColumn": 60, + "endLine": 7, + "endColumn": 66, + "start": 350, + "end": 356 + } }, "computed": false, "optional": false, @@ -458,9 +406,9 @@ "startLine": 7, "startColumn": 53, "endLine": 7, - "endColumn": 68, - "start": 342, - "end": 357 + "endColumn": 66, + "start": 343, + "end": 356 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-default-slot/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-default-slot/ast.json index f331b6342d..bb5445620a 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-default-slot/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-default-slot/ast.json @@ -119,59 +119,33 @@ "type": "MemberExpression", "start": 84, "end": 91, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 26 - } - }, - "range": [ - 84, - 91 - ], "object": { "type": "Identifier", "start": 84, "end": 88, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 23 - } - }, - "range": [ - 84, - 88 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 4, + "startColumn": 19, + "endLine": 4, + "endColumn": 23, + "start": 84, + "end": 88 + } }, "property": { "type": "Identifier", "start": 89, "end": 91, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 26 - } - }, - "range": [ - 89, - 91 - ], - "name": "id" + "name": "id", + "location": { + "startLine": 4, + "startColumn": 24, + "endLine": 4, + "endColumn": 26, + "start": 89, + "end": 91 + } }, "computed": false, "optional": false, @@ -179,9 +153,9 @@ "startLine": 4, "startColumn": 19, "endLine": 4, - "endColumn": 28, - "start": 83, - "end": 92 + "endColumn": 26, + "start": 84, + "end": 91 } }, "location": { @@ -216,59 +190,33 @@ "type": "MemberExpression", "start": 96, "end": 105, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 40 - } - }, - "range": [ - 96, - 105 - ], "object": { "type": "Identifier", "start": 96, "end": 100, - "loc": { - "start": { - "line": 4, - "column": 31 - }, - "end": { - "line": 4, - "column": 35 - } - }, - "range": [ - 96, - 100 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 4, + "startColumn": 31, + "endLine": 4, + "endColumn": 35, + "start": 96, + "end": 100 + } }, "property": { "type": "Identifier", "start": 101, "end": 105, - "loc": { - "start": { - "line": 4, - "column": 36 - }, - "end": { - "line": 4, - "column": 40 - } - }, - "range": [ - 101, - 105 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 4, + "startColumn": 36, + "endLine": 4, + "endColumn": 40, + "start": 101, + "end": 105 + } }, "computed": false, "optional": false, @@ -276,9 +224,9 @@ "startLine": 4, "startColumn": 31, "endLine": 4, - "endColumn": 42, - "start": 95, - "end": 106 + "endColumn": 40, + "start": 96, + "end": 105 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-mixed-slot-content/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-mixed-slot-content/ast.json index 212a99189e..414a550377 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-mixed-slot-content/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-mixed-slot-content/ast.json @@ -119,59 +119,33 @@ "type": "MemberExpression", "start": 103, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "range": [ - 103, - 117 - ], "object": { "type": "Identifier", "start": 103, "end": 112, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 25 - } - }, - "range": [ - 103, - 112 - ], - "name": "slot1data" + "name": "slot1data", + "location": { + "startLine": 4, + "startColumn": 16, + "endLine": 4, + "endColumn": 25, + "start": 103, + "end": 112 + } }, "property": { "type": "Identifier", "start": 113, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "range": [ - 113, - 117 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 4, + "startColumn": 26, + "endLine": 4, + "endColumn": 30, + "start": 113, + "end": 117 + } }, "computed": false, "optional": false, @@ -179,9 +153,9 @@ "startLine": 4, "startColumn": 16, "endLine": 4, - "endColumn": 32, - "start": 102, - "end": 118 + "endColumn": 30, + "start": 103, + "end": 117 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-named-slot/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-named-slot/ast.json index 58d3e719c5..387815e170 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-named-slot/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-named-slot/ast.json @@ -119,59 +119,33 @@ "type": "MemberExpression", "start": 103, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "range": [ - 103, - 117 - ], "object": { "type": "Identifier", "start": 103, "end": 112, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 25 - } - }, - "range": [ - 103, - 112 - ], - "name": "slot1data" + "name": "slot1data", + "location": { + "startLine": 4, + "startColumn": 16, + "endLine": 4, + "endColumn": 25, + "start": 103, + "end": 112 + } }, "property": { "type": "Identifier", "start": 113, "end": 117, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "range": [ - 113, - 117 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 4, + "startColumn": 26, + "endLine": 4, + "endColumn": 30, + "start": 113, + "end": 117 + } }, "computed": false, "optional": false, @@ -179,9 +153,9 @@ "startLine": 4, "startColumn": 16, "endLine": 4, - "endColumn": 32, - "start": 102, - "end": 118 + "endColumn": 30, + "start": 103, + "end": 117 } }, "location": { @@ -284,59 +258,33 @@ "type": "MemberExpression", "start": 222, "end": 237, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 31 - } - }, - "range": [ - 222, - 237 - ], "object": { "type": "Identifier", "start": 222, "end": 231, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 25 - } - }, - "range": [ - 222, - 231 - ], - "name": "slot2data" + "name": "slot2data", + "location": { + "startLine": 8, + "startColumn": 16, + "endLine": 8, + "endColumn": 25, + "start": 222, + "end": 231 + } }, "property": { "type": "Identifier", "start": 232, "end": 237, - "loc": { - "start": { - "line": 8, - "column": 26 - }, - "end": { - "line": 8, - "column": 31 - } - }, - "range": [ - 232, - 237 - ], - "name": "title" + "name": "title", + "location": { + "startLine": 8, + "startColumn": 26, + "endLine": 8, + "endColumn": 31, + "start": 232, + "end": 237 + } }, "computed": false, "optional": false, @@ -344,9 +292,9 @@ "startLine": 8, "startColumn": 16, "endLine": 8, - "endColumn": 33, - "start": 221, - "end": 238 + "endColumn": 31, + "start": 222, + "end": 237 } }, "location": { @@ -449,59 +397,33 @@ "type": "MemberExpression", "start": 327, "end": 344, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 33 - } - }, - "range": [ - 327, - 344 - ], "object": { "type": "Identifier", "start": 327, "end": 338, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 27 - } - }, - "range": [ - 327, - 338 - ], - "name": "defaultdata" + "name": "defaultdata", + "location": { + "startLine": 12, + "startColumn": 16, + "endLine": 12, + "endColumn": 27, + "start": 327, + "end": 338 + } }, "property": { "type": "Identifier", "start": 339, "end": 344, - "loc": { - "start": { - "line": 12, - "column": 28 - }, - "end": { - "line": 12, - "column": 33 - } - }, - "range": [ - 339, - 344 - ], - "name": "title" + "name": "title", + "location": { + "startLine": 12, + "startColumn": 28, + "endLine": 12, + "endColumn": 33, + "start": 339, + "end": 344 + } }, "computed": false, "optional": false, @@ -509,9 +431,9 @@ "startLine": 12, "startColumn": 16, "endLine": 12, - "endColumn": 35, - "start": 326, - "end": 345 + "endColumn": 33, + "start": 327, + "end": 344 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-with-for/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-with-for/ast.json index 635327c524..c4616521fe 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-with-for/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/parent-with-for/ast.json @@ -191,28 +191,14 @@ "type": "Identifier", "start": 172, "end": 182, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 32 - } - }, - "range": [ - 172, - 182 - ], "name": "parentItem", "location": { "startLine": 5, "startColumn": 22, "endLine": 5, - "endColumn": 34, - "start": 171, - "end": 183 + "endColumn": 32, + "start": 172, + "end": 182 } }, "location": { @@ -266,59 +252,33 @@ "type": "MemberExpression", "start": 213, "end": 220, - "loc": { - "start": { - "line": 6, - "column": 23 - }, - "end": { - "line": 6, - "column": 30 - } - }, - "range": [ - 213, - 220 - ], "object": { "type": "Identifier", "start": 213, "end": 217, - "loc": { - "start": { - "line": 6, - "column": 23 - }, - "end": { - "line": 6, - "column": 27 - } - }, - "range": [ - 213, - 217 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 6, + "startColumn": 23, + "endLine": 6, + "endColumn": 27, + "start": 213, + "end": 217 + } }, "property": { "type": "Identifier", "start": 218, "end": 220, - "loc": { - "start": { - "line": 6, - "column": 28 - }, - "end": { - "line": 6, - "column": 30 - } - }, - "range": [ - 218, - 220 - ], - "name": "id" + "name": "id", + "location": { + "startLine": 6, + "startColumn": 28, + "endLine": 6, + "endColumn": 30, + "start": 218, + "end": 220 + } }, "computed": false, "optional": false, @@ -326,9 +286,9 @@ "startLine": 6, "startColumn": 23, "endLine": 6, - "endColumn": 32, - "start": 212, - "end": 221 + "endColumn": 30, + "start": 213, + "end": 220 } }, "location": { @@ -363,59 +323,33 @@ "type": "MemberExpression", "start": 225, "end": 234, - "loc": { - "start": { - "line": 6, - "column": 35 - }, - "end": { - "line": 6, - "column": 44 - } - }, - "range": [ - 225, - 234 - ], "object": { "type": "Identifier", "start": 225, "end": 229, - "loc": { - "start": { - "line": 6, - "column": 35 - }, - "end": { - "line": 6, - "column": 39 - } - }, - "range": [ - 225, - 229 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 6, + "startColumn": 35, + "endLine": 6, + "endColumn": 39, + "start": 225, + "end": 229 + } }, "property": { "type": "Identifier", "start": 230, "end": 234, - "loc": { - "start": { - "line": 6, - "column": 40 - }, - "end": { - "line": 6, - "column": 44 - } - }, - "range": [ - 230, - 234 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 6, + "startColumn": 40, + "endLine": 6, + "endColumn": 44, + "start": 230, + "end": 234 + } }, "computed": false, "optional": false, @@ -423,9 +357,9 @@ "startLine": 6, "startColumn": 35, "endLine": 6, - "endColumn": 46, - "start": 224, - "end": 235 + "endColumn": 44, + "start": 225, + "end": 234 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/text-non-direct-child/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/text-non-direct-child/ast.json index f48edf3778..022403bed1 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/text-non-direct-child/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/text-non-direct-child/ast.json @@ -132,59 +132,33 @@ "type": "MemberExpression", "start": 173, "end": 180, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 24 - } - }, - "range": [ - 173, - 180 - ], "object": { "type": "Identifier", "start": 173, "end": 177, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 21 - } - }, - "range": [ - 173, - 177 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 6, + "startColumn": 17, + "endLine": 6, + "endColumn": 21, + "start": 173, + "end": 177 + } }, "property": { "type": "Identifier", "start": 178, "end": 180, - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 24 - } - }, - "range": [ - 178, - 180 - ], - "name": "id" + "name": "id", + "location": { + "startLine": 6, + "startColumn": 22, + "endLine": 6, + "endColumn": 24, + "start": 178, + "end": 180 + } }, "computed": false, "optional": false, @@ -192,9 +166,9 @@ "startLine": 6, "startColumn": 17, "endLine": 6, - "endColumn": 26, - "start": 172, - "end": 181 + "endColumn": 24, + "start": 173, + "end": 180 } }, "location": { @@ -229,59 +203,33 @@ "type": "MemberExpression", "start": 185, "end": 194, - "loc": { - "start": { - "line": 6, - "column": 29 - }, - "end": { - "line": 6, - "column": 38 - } - }, - "range": [ - 185, - 194 - ], "object": { "type": "Identifier", "start": 185, "end": 189, - "loc": { - "start": { - "line": 6, - "column": 29 - }, - "end": { - "line": 6, - "column": 33 - } - }, - "range": [ - 185, - 189 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 6, + "startColumn": 29, + "endLine": 6, + "endColumn": 33, + "start": 185, + "end": 189 + } }, "property": { "type": "Identifier", "start": 190, "end": 194, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 38 - } - }, - "range": [ - 190, - 194 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 6, + "startColumn": 34, + "endLine": 6, + "endColumn": 38, + "start": 190, + "end": 194 + } }, "computed": false, "optional": false, @@ -289,9 +237,9 @@ "startLine": 6, "startColumn": 29, "endLine": 6, - "endColumn": 40, - "start": 184, - "end": 195 + "endColumn": 38, + "start": 185, + "end": 194 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/with-parent-bindings/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/with-parent-bindings/ast.json index 7b42a23526..d861b7d6a5 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/with-parent-bindings/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/scoped-slots/with-parent-bindings/ast.json @@ -119,28 +119,14 @@ "type": "Identifier", "start": 94, "end": 99, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 23 - } - }, - "range": [ - 94, - 99 - ], "name": "label", "location": { "startLine": 5, "startColumn": 18, "endLine": 5, - "endColumn": 25, - "start": 93, - "end": 100 + "endColumn": 23, + "start": 94, + "end": 99 } }, "location": { @@ -194,59 +180,33 @@ "type": "MemberExpression", "start": 126, "end": 133, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 26 - } - }, - "range": [ - 126, - 133 - ], "object": { "type": "Identifier", "start": 126, "end": 130, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 23 - } - }, - "range": [ - 126, - 130 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 6, + "startColumn": 19, + "endLine": 6, + "endColumn": 23, + "start": 126, + "end": 130 + } }, "property": { "type": "Identifier", "start": 131, "end": 133, - "loc": { - "start": { - "line": 6, - "column": 24 - }, - "end": { - "line": 6, - "column": 26 - } - }, - "range": [ - 131, - 133 - ], - "name": "id" + "name": "id", + "location": { + "startLine": 6, + "startColumn": 24, + "endLine": 6, + "endColumn": 26, + "start": 131, + "end": 133 + } }, "computed": false, "optional": false, @@ -254,9 +214,9 @@ "startLine": 6, "startColumn": 19, "endLine": 6, - "endColumn": 28, - "start": 125, - "end": 134 + "endColumn": 26, + "start": 126, + "end": 133 } }, "location": { @@ -291,59 +251,33 @@ "type": "MemberExpression", "start": 138, "end": 147, - "loc": { - "start": { - "line": 6, - "column": 31 - }, - "end": { - "line": 6, - "column": 40 - } - }, - "range": [ - 138, - 147 - ], "object": { "type": "Identifier", "start": 138, "end": 142, - "loc": { - "start": { - "line": 6, - "column": 31 - }, - "end": { - "line": 6, - "column": 35 - } - }, - "range": [ - 138, - 142 - ], - "name": "item" + "name": "item", + "location": { + "startLine": 6, + "startColumn": 31, + "endLine": 6, + "endColumn": 35, + "start": 138, + "end": 142 + } }, "property": { "type": "Identifier", "start": 143, "end": 147, - "loc": { - "start": { - "line": 6, - "column": 36 - }, - "end": { - "line": 6, - "column": 40 - } - }, - "range": [ - 143, - 147 - ], - "name": "name" + "name": "name", + "location": { + "startLine": 6, + "startColumn": 36, + "endLine": 6, + "endColumn": 40, + "start": 143, + "end": 147 + } }, "computed": false, "optional": false, @@ -351,9 +285,9 @@ "startLine": 6, "startColumn": 31, "endLine": 6, - "endColumn": 42, - "start": 137, - "end": 148 + "endColumn": 40, + "start": 138, + "end": 147 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/content/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/content/ast.json index 72fddd58a8..bebd4b27f6 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/content/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/content/ast.json @@ -128,28 +128,14 @@ "type": "Identifier", "start": 60, "end": 74, - "loc": { - "start": { - "line": 3, - "column": 38 - }, - "end": { - "line": 3, - "column": 52 - } - }, - "range": [ - 60, - 74 - ], "name": "defaultContent", "location": { "startLine": 3, "startColumn": 38, "endLine": 3, - "endColumn": 54, - "start": 59, - "end": 75 + "endColumn": 52, + "start": 60, + "end": 74 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/definition/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/definition/ast.json index cec9ef9652..a51378d866 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/definition/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/slots/dynamic-components/definition/ast.json @@ -161,28 +161,14 @@ "type": "Identifier", "start": 76, "end": 90, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "range": [ - 76, - 90 - ], "name": "defaultContent", "location": { "startLine": 4, "startColumn": 16, "endLine": 4, - "endColumn": 32, - "start": 75, - "end": 91 + "endColumn": 30, + "start": 76, + "end": 90 } }, "location": { diff --git a/packages/@lwc/template-compiler/src/__tests__/fixtures/static-content/template-string-escape/ast.json b/packages/@lwc/template-compiler/src/__tests__/fixtures/static-content/template-string-escape/ast.json index 0b82747453..1ae6b73f04 100644 --- a/packages/@lwc/template-compiler/src/__tests__/fixtures/static-content/template-string-escape/ast.json +++ b/packages/@lwc/template-compiler/src/__tests__/fixtures/static-content/template-string-escape/ast.json @@ -502,28 +502,14 @@ "type": "Identifier", "start": 323, "end": 325, - "loc": { - "start": { - "line": 12, - "column": 18 - }, - "end": { - "line": 12, - "column": 20 - } - }, - "range": [ - 323, - 325 - ], "name": "me", "location": { "startLine": 12, "startColumn": 18, "endLine": 12, - "endColumn": 22, - "start": 322, - "end": 326 + "endColumn": 20, + "start": 323, + "end": 325 } }, "location": {