@marko/compiler 5.21.4 → 5.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel-plugin/parser.js +11 -8
- package/package.json +3 -3
|
@@ -10,8 +10,9 @@ const noop = () => {};
|
|
|
10
10
|
const emptyRange = (part) => part.start === part.end;
|
|
11
11
|
const isAttrTag = (tag) => {var _tag$name$value;return ((_tag$name$value = tag.name.value) == null ? void 0 : _tag$name$value[0]) === "@";};
|
|
12
12
|
const toBabelPosition = ({ line, character }) => ({
|
|
13
|
+
// Babel lines start at 1 and use "column" instead of "character".
|
|
13
14
|
line: line + 1,
|
|
14
|
-
column: character
|
|
15
|
+
column: character });
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
function parseMarko(file) {
|
|
@@ -28,8 +29,6 @@ function parseMarko(file) {
|
|
|
28
29
|
let onNext = noop;
|
|
29
30
|
const positionAt = (index) => toBabelPosition(parser.positionAt(index));
|
|
30
31
|
const locationAt = (range) => {
|
|
31
|
-
// Babel columns start at 0, but that is silly.
|
|
32
|
-
// Here we normalize the parsers 1 based columns.
|
|
33
32
|
const { start, end } = parser.locationAt(range);
|
|
34
33
|
return {
|
|
35
34
|
start: toBabelPosition(start),
|
|
@@ -214,7 +213,7 @@ function parseMarko(file) {
|
|
|
214
213
|
|
|
215
214
|
|
|
216
215
|
},
|
|
217
|
-
|
|
216
|
+
onOpenTagName(part) {
|
|
218
217
|
const tagName = parseTemplateString(part);
|
|
219
218
|
const node = t.markoTag(tagName, [], t.markoTagBody());
|
|
220
219
|
let parseType = _htmljsParser.TagType.html;
|
|
@@ -335,7 +334,11 @@ function parseMarko(file) {
|
|
|
335
334
|
`${parser.read(part.params)}=>{}`,
|
|
336
335
|
part.params.start).
|
|
337
336
|
params,
|
|
338
|
-
(0, _babelUtils.
|
|
337
|
+
(0, _babelUtils.parseExpression)(
|
|
338
|
+
file,
|
|
339
|
+
`()=>${parser.read(part.body)}`,
|
|
340
|
+
part.params.start + "()=>".length).
|
|
341
|
+
body),
|
|
339
342
|
|
|
340
343
|
part);
|
|
341
344
|
|
|
@@ -437,13 +440,13 @@ function parseMarko(file) {
|
|
|
437
440
|
parseOptions.statement ||
|
|
438
441
|
parseOptions.openTagOnly)
|
|
439
442
|
{
|
|
440
|
-
this.
|
|
443
|
+
this.onCloseTagEnd(part);
|
|
441
444
|
}
|
|
442
445
|
} else if (part.selfClosed) {
|
|
443
|
-
this.
|
|
446
|
+
this.onCloseTagEnd(part);
|
|
444
447
|
}
|
|
445
448
|
},
|
|
446
|
-
|
|
449
|
+
onCloseTagEnd(part) {var _node$tagDef3;
|
|
447
450
|
const { node } = currentTag;
|
|
448
451
|
const parserPlugin = (_node$tagDef3 = node.tagDef) == null ? void 0 : _node$tagDef3.parser;
|
|
449
452
|
if (preservingWhitespaceUntil === node) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
3
|
"description": "Marko template to JS compiler.",
|
|
4
|
-
"version": "5.21.
|
|
4
|
+
"version": "5.21.7",
|
|
5
5
|
"author": "Dylan Piercey <dpiercey@ebay.com>",
|
|
6
6
|
"bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
|
|
7
7
|
"dependencies": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@marko/babel-utils": "^5.21.1",
|
|
17
17
|
"complain": "^1.6.0",
|
|
18
18
|
"he": "^1.2.0",
|
|
19
|
-
"htmljs-parser": "^
|
|
19
|
+
"htmljs-parser": "^5.0.0",
|
|
20
20
|
"jsesc": "^3.0.2",
|
|
21
21
|
"lasso-package-root": "^1.0.1",
|
|
22
22
|
"property-handlers": "^1.1.1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"strip-json-comments": "^3.1.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@marko/translator-default": "^5.21.
|
|
31
|
+
"@marko/translator-default": "^5.21.3"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|