yuku-parser 0.5.15 → 0.5.16
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/decode.js +3 -2
- package/index.d.ts +1 -0
- package/package.json +12 -12
package/decode.js
CHANGED
|
@@ -171,11 +171,11 @@ function decode(buffer, source) {
|
|
|
171
171
|
}
|
|
172
172
|
return out;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function nodeWithComments(i) {
|
|
175
175
|
const r = _decode(i);
|
|
176
176
|
// skip unwrap cases whose inner node already carries its own
|
|
177
177
|
// comments (e.g. formal_parameter returning its pattern)
|
|
178
|
-
if (
|
|
178
|
+
if (r && r.type !== undefined && r.comments === undefined) {
|
|
179
179
|
const off = _coOff + i * 4;
|
|
180
180
|
const a = dv.getUint32(off, true), e = dv.getUint32(off + 4, true);
|
|
181
181
|
if (a !== e) r.comments = _commentsOf(a, e);
|
|
@@ -609,6 +609,7 @@ function decode(buffer, source) {
|
|
|
609
609
|
case 170: return { type: "JSXSpreadChild", start, end, expression: f1 !== NULL ? node(f1) : null };
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
+
const node = _attachComments ? nodeWithComments : _decode;
|
|
612
613
|
const lsOff = _cOff + commentCount * 12;
|
|
613
614
|
const dOff = lsOff + lineStartsCount * 4;
|
|
614
615
|
function _decodeLineStarts() {
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuku-parser",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"description": "High-performance JavaScript/TypeScript parser",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"decode.js"
|
|
18
18
|
],
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@yuku-parser/binding-linux-x64-gnu": "0.5.
|
|
21
|
-
"@yuku-parser/binding-linux-arm64-gnu": "0.5.
|
|
22
|
-
"@yuku-parser/binding-linux-arm-gnu": "0.5.
|
|
23
|
-
"@yuku-parser/binding-linux-x64-musl": "0.5.
|
|
24
|
-
"@yuku-parser/binding-linux-arm64-musl": "0.5.
|
|
25
|
-
"@yuku-parser/binding-linux-arm-musl": "0.5.
|
|
26
|
-
"@yuku-parser/binding-darwin-x64": "0.5.
|
|
27
|
-
"@yuku-parser/binding-darwin-arm64": "0.5.
|
|
28
|
-
"@yuku-parser/binding-win32-x64": "0.5.
|
|
29
|
-
"@yuku-parser/binding-win32-arm64": "0.5.
|
|
30
|
-
"@yuku-parser/binding-freebsd-x64": "0.5.
|
|
20
|
+
"@yuku-parser/binding-linux-x64-gnu": "0.5.16",
|
|
21
|
+
"@yuku-parser/binding-linux-arm64-gnu": "0.5.16",
|
|
22
|
+
"@yuku-parser/binding-linux-arm-gnu": "0.5.16",
|
|
23
|
+
"@yuku-parser/binding-linux-x64-musl": "0.5.16",
|
|
24
|
+
"@yuku-parser/binding-linux-arm64-musl": "0.5.16",
|
|
25
|
+
"@yuku-parser/binding-linux-arm-musl": "0.5.16",
|
|
26
|
+
"@yuku-parser/binding-darwin-x64": "0.5.16",
|
|
27
|
+
"@yuku-parser/binding-darwin-arm64": "0.5.16",
|
|
28
|
+
"@yuku-parser/binding-win32-x64": "0.5.16",
|
|
29
|
+
"@yuku-parser/binding-win32-arm64": "0.5.16",
|
|
30
|
+
"@yuku-parser/binding-freebsd-x64": "0.5.16"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"acorn",
|