@marko/compiler 5.39.4 → 5.39.6
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.
|
@@ -204,7 +204,17 @@ Object.assign(_printer.default.prototype, {
|
|
|
204
204
|
if (attributes.length) {
|
|
205
205
|
if (tagName === "script") {
|
|
206
206
|
for (let i = attributes.length; i--;) {
|
|
207
|
-
|
|
207
|
+
const attr = attributes[i];
|
|
208
|
+
if (
|
|
209
|
+
attr.name === "value" && (
|
|
210
|
+
attr.value.type === "ArrowFunctionExpression" ||
|
|
211
|
+
attr.value.type === "FunctionExpression") &&
|
|
212
|
+
!(
|
|
213
|
+
attr.value.generator ||
|
|
214
|
+
attr.value.returnType ||
|
|
215
|
+
attr.value.typeParameters))
|
|
216
|
+
|
|
217
|
+
{
|
|
208
218
|
bodyOverride = attributes[i].value.body.body;
|
|
209
219
|
attributes = toSpliced(attributes, i);
|
|
210
220
|
break;
|
|
@@ -75,7 +75,7 @@ function parseTemplateLiteral(file, str, sourceStart, sourceEnd) {
|
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
if (parsed.type === "TemplateLiteral") {
|
|
78
|
-
return parsed;
|
|
78
|
+
return _compiler.types.templateLiteral(parsed.quasis, parsed.expressions);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
return ensureParseError(file, parsed, sourceStart, sourceEnd);
|
|
@@ -119,11 +119,19 @@ sourceOffset)
|
|
|
119
119
|
const { parserOpts } = file.opts;
|
|
120
120
|
|
|
121
121
|
if (typeof sourceStart === "number") {
|
|
122
|
-
const
|
|
123
|
-
const
|
|
122
|
+
const startLoc = (0, _loc.getLoc)(file, sourceStart);
|
|
123
|
+
const startLine = startLoc.line;
|
|
124
|
+
let startIndex = sourceStart;
|
|
125
|
+
let startColumn = startLoc.column;
|
|
126
|
+
|
|
127
|
+
if (sourceOffset) {
|
|
128
|
+
startIndex -= sourceOffset;
|
|
129
|
+
startColumn -= sourceOffset;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
parserOpts.startLine = startLine;
|
|
124
133
|
parserOpts.startIndex = startIndex;
|
|
125
|
-
parserOpts.startColumn =
|
|
126
|
-
parserOpts.startLine = startLoc.line;
|
|
134
|
+
parserOpts.startColumn = startColumn;
|
|
127
135
|
|
|
128
136
|
try {
|
|
129
137
|
return isExpression ?
|
package/dist/babel-utils/tags.js
CHANGED
|
@@ -319,7 +319,7 @@ function resolveMarkoFile(file, filename) {
|
|
|
319
319
|
const idCache = new WeakMap();
|
|
320
320
|
const templateIdHashOpts = { outputLength: 5 };
|
|
321
321
|
function getTemplateId(opts, request, child) {
|
|
322
|
-
const id = (0, _path.relative)(ROOT, request);
|
|
322
|
+
const id = (0, _path.relative)(ROOT, request).replace(/[^a-zA-Z0-9_$./-]/g, "/");
|
|
323
323
|
const optimize = typeof opts === "object" ? opts.optimize : opts;
|
|
324
324
|
|
|
325
325
|
if (optimize) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
|
-
"version": "5.39.
|
|
3
|
+
"version": "5.39.6",
|
|
4
4
|
"description": "Marko template to JS compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"source-map-support": "^0.5.21"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"marko": "^5.37.
|
|
89
|
+
"marko": "^5.37.7"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|