yuku-parser 0.5.38 → 0.5.41

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.
Files changed (2) hide show
  1. package/decode.js +13 -15
  2. package/package.json +12 -12
package/decode.js CHANGED
@@ -296,19 +296,20 @@ function decode(buffer, source) {
296
296
  if (s === e) return "";
297
297
  if (s >= _srcLen) return _poolDecode(s, e);
298
298
  if (e <= _firstNa) return _src.slice(s, e);
299
- const ss = s < _firstNa ? s : pm[s - _firstNa];
300
- return _src.slice(ss, pm[e - _firstNa]);
299
+ return _src.slice(s < _firstNa ? s : pm[s - _firstNa], pm[e - _firstNa]);
301
300
  };
302
301
  function nodeArr(s, len) {
303
- const r = Array.from({ length: len });
304
- for (let j = 0; j < len; j++) r[j] = node(_u32[_extraBase + s + j]);
302
+ const r = [];
303
+ const base = _extraBase + s;
304
+ for (let j = 0; j < len; j++) r.push(node(_u32[base + j]));
305
305
  return r;
306
306
  }
307
307
  function nodeArrHoles(s, len) {
308
- const r = Array.from({ length: len });
308
+ const r = [];
309
+ const base = _extraBase + s;
309
310
  for (let j = 0; j < len; j++) {
310
- const x = _u32[_extraBase + s + j];
311
- r[j] = x !== NULL ? node(x) : null;
311
+ const x = _u32[base + j];
312
+ r.push(x !== NULL ? node(x) : null);
312
313
  }
313
314
  return r;
314
315
  }
@@ -348,11 +349,11 @@ function decode(buffer, source) {
348
349
  return r;
349
350
  }
350
351
  function _decode(i) {
351
- const o = _nodesOff + i * 48;
352
- const tag = _u8[o];
353
- const flags = _u8[o + 2] | (_u8[o + 3] << 8);
354
- const f0 = _u8[o + 4] | (_u8[o + 5] << 8);
355
- const b = o >> 2;
352
+ const b = (_nodesOff + i * 48) >> 2;
353
+ const h0 = _u32[b];
354
+ const tag = h0 & 255;
355
+ const flags = h0 >>> 16;
356
+ const f0 = _u32[b + 1] & 65535;
356
357
  const f1 = _u32[b + 2], f2 = _u32[b + 3],
357
358
  f3 = _u32[b + 4], f4 = _u32[b + 5],
358
359
  f5 = _u32[b + 6], f6 = _u32[b + 7],
@@ -777,9 +778,6 @@ function decode(buffer, source) {
777
778
  }
778
779
  }
779
780
  const node = _attached ? nodeWithComments : _decode;
780
- const _nodesU32 = _nodesOff >> 2;
781
- function startOf(i) { return _p(_u32[_nodesU32 + i * 12 + 10]); }
782
- function endOf(i) { return _p(_u32[_nodesU32 + i * 12 + 11]); }
783
781
  const lsOff = _cOff + commentCount * 20;
784
782
  const dOff = lsOff + lineStartsCount * 4;
785
783
  function _decodeComments() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuku-parser",
3
- "version": "0.5.38",
3
+ "version": "0.5.41",
4
4
  "description": "High-performance JavaScript/TypeScript parser",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,17 +18,17 @@
18
18
  "walk.js"
19
19
  ],
20
20
  "optionalDependencies": {
21
- "@yuku-parser/binding-linux-x64-gnu": "0.5.38",
22
- "@yuku-parser/binding-linux-arm64-gnu": "0.5.38",
23
- "@yuku-parser/binding-linux-arm-gnu": "0.5.38",
24
- "@yuku-parser/binding-linux-x64-musl": "0.5.38",
25
- "@yuku-parser/binding-linux-arm64-musl": "0.5.38",
26
- "@yuku-parser/binding-linux-arm-musl": "0.5.38",
27
- "@yuku-parser/binding-darwin-x64": "0.5.38",
28
- "@yuku-parser/binding-darwin-arm64": "0.5.38",
29
- "@yuku-parser/binding-win32-x64": "0.5.38",
30
- "@yuku-parser/binding-win32-arm64": "0.5.38",
31
- "@yuku-parser/binding-freebsd-x64": "0.5.38"
21
+ "@yuku-parser/binding-linux-x64-gnu": "0.5.41",
22
+ "@yuku-parser/binding-linux-arm64-gnu": "0.5.41",
23
+ "@yuku-parser/binding-linux-arm-gnu": "0.5.41",
24
+ "@yuku-parser/binding-linux-x64-musl": "0.5.41",
25
+ "@yuku-parser/binding-linux-arm64-musl": "0.5.41",
26
+ "@yuku-parser/binding-linux-arm-musl": "0.5.41",
27
+ "@yuku-parser/binding-darwin-x64": "0.5.41",
28
+ "@yuku-parser/binding-darwin-arm64": "0.5.41",
29
+ "@yuku-parser/binding-win32-x64": "0.5.41",
30
+ "@yuku-parser/binding-win32-arm64": "0.5.41",
31
+ "@yuku-parser/binding-freebsd-x64": "0.5.41"
32
32
  },
33
33
  "dependencies": {
34
34
  "@yuku-toolchain/types": "0.5.37"