@marko/compiler 5.39.1 → 5.39.2
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/babel-utils.d.ts +14 -38
- package/dist/babel-utils/loc.js +7 -0
- package/package.json +2 -2
package/babel-utils.d.ts
CHANGED
|
@@ -246,69 +246,45 @@ export function withLoc<T extends t.Node>(
|
|
|
246
246
|
export function parseStatements<T extends t.Statement[]>(
|
|
247
247
|
file: t.BabelFile,
|
|
248
248
|
str: string,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
str: string,
|
|
253
|
-
sourceStart: number,
|
|
254
|
-
sourceEnd: number,
|
|
255
|
-
sourceOffset?: number,
|
|
249
|
+
sourceStart?: null | number,
|
|
250
|
+
sourceEnd?: null | number,
|
|
251
|
+
sourceOffset?: null | number,
|
|
256
252
|
): T;
|
|
257
253
|
|
|
258
254
|
export function parseExpression<T extends t.Expression>(
|
|
259
255
|
file: t.BabelFile,
|
|
260
256
|
str: string,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
str: string,
|
|
265
|
-
sourceStart: number,
|
|
266
|
-
sourceEnd: number,
|
|
267
|
-
sourceOffset?: number,
|
|
257
|
+
sourceStart?: null | number,
|
|
258
|
+
sourceEnd?: null | number,
|
|
259
|
+
sourceOffset?: null | number,
|
|
268
260
|
): T;
|
|
269
261
|
|
|
270
262
|
export function parseParams(
|
|
271
263
|
file: t.BabelFile,
|
|
272
264
|
str: string,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
file: t.BabelFile,
|
|
276
|
-
str: string,
|
|
277
|
-
sourceStart: number,
|
|
278
|
-
sourceEnd: number,
|
|
265
|
+
sourceStart?: null | number,
|
|
266
|
+
sourceEnd?: null | number,
|
|
279
267
|
): t.Function["params"];
|
|
280
268
|
|
|
281
269
|
export function parseArgs(
|
|
282
270
|
file: t.BabelFile,
|
|
283
271
|
str: string,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
file: t.BabelFile,
|
|
287
|
-
str: string,
|
|
288
|
-
sourceStart: number,
|
|
289
|
-
sourceEnd: number,
|
|
272
|
+
sourceStart?: null | number,
|
|
273
|
+
sourceEnd?: null | number,
|
|
290
274
|
): t.CallExpression["arguments"];
|
|
291
275
|
|
|
292
276
|
export function parseVar(
|
|
293
277
|
file: t.BabelFile,
|
|
294
278
|
str: string,
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
file: t.BabelFile,
|
|
298
|
-
str: string,
|
|
299
|
-
sourceStart: number,
|
|
300
|
-
sourceEnd: number,
|
|
279
|
+
sourceStart?: null | number,
|
|
280
|
+
sourceEnd?: null | number,
|
|
301
281
|
): t.VariableDeclarator["id"];
|
|
302
282
|
|
|
303
283
|
export function parseTemplateLiteral(
|
|
304
284
|
file: t.BabelFile,
|
|
305
285
|
str: string,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
file: t.BabelFile,
|
|
309
|
-
str: string,
|
|
310
|
-
sourceStart: number,
|
|
311
|
-
sourceEnd: number,
|
|
286
|
+
sourceStart?: null | number,
|
|
287
|
+
sourceEnd?: null | number,
|
|
312
288
|
): t.TemplateLiteral;
|
|
313
289
|
|
|
314
290
|
export function resolveRelativePath(file: t.BabelFile, request: string): string;
|
package/dist/babel-utils/loc.js
CHANGED
|
@@ -75,6 +75,13 @@ function getLineIndexes(file) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function findLoc(lineIndexes, startLine, index) {
|
|
78
|
+
if (index <= 0) {
|
|
79
|
+
return {
|
|
80
|
+
line: 1,
|
|
81
|
+
column: 0
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
const endLine = lineIndexes.length - 1;
|
|
79
86
|
let max = endLine;
|
|
80
87
|
let line = startLine;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
|
-
"version": "5.39.
|
|
3
|
+
"version": "5.39.2",
|
|
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.2"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|