oxc-parser 0.77.1 → 0.77.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.
@@ -5,20 +5,20 @@
5
5
 
6
6
  module.exports = deserialize;
7
7
 
8
- let uint8, uint32, float64, sourceText, sourceIsAscii, sourceLen;
8
+ let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen;
9
9
 
10
10
  const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }),
11
11
  decodeStr = textDecoder.decode.bind(textDecoder),
12
12
  { fromCodePoint } = String;
13
13
 
14
- function deserialize(buffer, sourceTextInput, sourceLenInput) {
14
+ function deserialize(buffer, sourceTextInput, sourceByteLenInput) {
15
15
  uint8 = buffer;
16
16
  uint32 = buffer.uint32;
17
17
  float64 = buffer.float64;
18
18
 
19
19
  sourceText = sourceTextInput;
20
- sourceLen = sourceLenInput;
21
- sourceIsAscii = sourceText.length === sourceLen;
20
+ sourceByteLen = sourceByteLenInput;
21
+ sourceIsAscii = sourceText.length === sourceByteLen;
22
22
 
23
23
  const data = deserializeRawTransferData(uint32[536870906]);
24
24
 
@@ -4026,7 +4026,7 @@ function deserializeStr(pos) {
4026
4026
  if (len === 0) return '';
4027
4027
 
4028
4028
  pos = uint32[pos32];
4029
- if (sourceIsAscii && pos < sourceLen) return sourceText.substr(pos, len);
4029
+ if (sourceIsAscii && pos < sourceByteLen) return sourceText.substr(pos, len);
4030
4030
 
4031
4031
  // Longer strings use `TextDecoder`
4032
4032
  // TODO: Find best switch-over point
@@ -5,20 +5,20 @@
5
5
 
6
6
  module.exports = deserialize;
7
7
 
8
- let uint8, uint32, float64, sourceText, sourceIsAscii, sourceLen;
8
+ let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen;
9
9
 
10
10
  const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }),
11
11
  decodeStr = textDecoder.decode.bind(textDecoder),
12
12
  { fromCodePoint } = String;
13
13
 
14
- function deserialize(buffer, sourceTextInput, sourceLenInput) {
14
+ function deserialize(buffer, sourceTextInput, sourceByteLenInput) {
15
15
  uint8 = buffer;
16
16
  uint32 = buffer.uint32;
17
17
  float64 = buffer.float64;
18
18
 
19
19
  sourceText = sourceTextInput;
20
- sourceLen = sourceLenInput;
21
- sourceIsAscii = sourceText.length === sourceLen;
20
+ sourceByteLen = sourceByteLenInput;
21
+ sourceIsAscii = sourceText.length === sourceByteLen;
22
22
 
23
23
  const data = deserializeRawTransferData(uint32[536870906]);
24
24
 
@@ -4157,7 +4157,7 @@ function deserializeStr(pos) {
4157
4157
  if (len === 0) return '';
4158
4158
 
4159
4159
  pos = uint32[pos32];
4160
- if (sourceIsAscii && pos < sourceLen) return sourceText.substr(pos, len);
4160
+ if (sourceIsAscii && pos < sourceByteLen) return sourceText.substr(pos, len);
4161
4161
 
4162
4162
  // Longer strings use `TextDecoder`
4163
4163
  // TODO: Find best switch-over point
@@ -12480,7 +12480,7 @@ function constructStr(pos, ast) {
12480
12480
  if (len === 0) return '';
12481
12481
 
12482
12482
  pos = uint32[pos32];
12483
- if (ast.sourceIsAscii && pos < ast.sourceLen) return ast.sourceText.substr(pos, len);
12483
+ if (ast.sourceIsAscii && pos < ast.sourceByteLen) return ast.sourceText.substr(pos, len);
12484
12484
 
12485
12485
  // Longer strings use `TextDecoder`
12486
12486
  // TODO: Find best switch-over point
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-parser",
3
- "version": "0.77.1",
3
+ "version": "0.77.2",
4
4
  "main": "index.js",
5
5
  "browser": "wasm.mjs",
6
6
  "engines": {
@@ -50,7 +50,7 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@oxc-project/types": "^0.77.1"
53
+ "@oxc-project/types": "^0.77.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@codspeed/vitest-plugin": "^4.0.0",
@@ -90,21 +90,21 @@
90
90
  "dtsHeaderFile": "header.js"
91
91
  },
92
92
  "optionalDependencies": {
93
- "@oxc-parser/binding-win32-x64-msvc": "0.77.1",
94
- "@oxc-parser/binding-win32-arm64-msvc": "0.77.1",
95
- "@oxc-parser/binding-linux-x64-gnu": "0.77.1",
96
- "@oxc-parser/binding-linux-x64-musl": "0.77.1",
97
- "@oxc-parser/binding-freebsd-x64": "0.77.1",
98
- "@oxc-parser/binding-linux-arm64-gnu": "0.77.1",
99
- "@oxc-parser/binding-linux-arm64-musl": "0.77.1",
100
- "@oxc-parser/binding-linux-arm-gnueabihf": "0.77.1",
101
- "@oxc-parser/binding-linux-arm-musleabihf": "0.77.1",
102
- "@oxc-parser/binding-linux-s390x-gnu": "0.77.1",
103
- "@oxc-parser/binding-linux-riscv64-gnu": "0.77.1",
104
- "@oxc-parser/binding-darwin-x64": "0.77.1",
105
- "@oxc-parser/binding-darwin-arm64": "0.77.1",
106
- "@oxc-parser/binding-android-arm64": "0.77.1",
107
- "@oxc-parser/binding-wasm32-wasi": "0.77.1"
93
+ "@oxc-parser/binding-win32-x64-msvc": "0.77.2",
94
+ "@oxc-parser/binding-win32-arm64-msvc": "0.77.2",
95
+ "@oxc-parser/binding-linux-x64-gnu": "0.77.2",
96
+ "@oxc-parser/binding-linux-x64-musl": "0.77.2",
97
+ "@oxc-parser/binding-freebsd-x64": "0.77.2",
98
+ "@oxc-parser/binding-linux-arm64-gnu": "0.77.2",
99
+ "@oxc-parser/binding-linux-arm64-musl": "0.77.2",
100
+ "@oxc-parser/binding-linux-arm-gnueabihf": "0.77.2",
101
+ "@oxc-parser/binding-linux-arm-musleabihf": "0.77.2",
102
+ "@oxc-parser/binding-linux-s390x-gnu": "0.77.2",
103
+ "@oxc-parser/binding-linux-riscv64-gnu": "0.77.2",
104
+ "@oxc-parser/binding-darwin-x64": "0.77.2",
105
+ "@oxc-parser/binding-darwin-arm64": "0.77.2",
106
+ "@oxc-parser/binding-android-arm64": "0.77.2",
107
+ "@oxc-parser/binding-wasm32-wasi": "0.77.2"
108
108
  },
109
109
  "scripts": {
110
110
  "build-dev": "napi build --platform --js bindings.js",
@@ -93,10 +93,10 @@ const bufferRecycleRegistry = typeof FinalizationRegistry === 'undefined'
93
93
  * @returns {Object} - Object with property getters for `program`, `module`, `comments`, and `errors`,
94
94
  * and `dispose` and `visit` methods
95
95
  */
96
- function construct(buffer, sourceText, sourceLen) {
96
+ function construct(buffer, sourceText, sourceByteLen) {
97
97
  // Create AST object
98
- const sourceIsAscii = sourceText.length === sourceLen;
99
- const ast = { buffer, sourceText, sourceLen, sourceIsAscii, nodes: new Map(), token: TOKEN };
98
+ const sourceIsAscii = sourceText.length === sourceByteLen;
99
+ const ast = { buffer, sourceText, sourceByteLen, sourceIsAscii, nodes: new Map(), token: TOKEN };
100
100
 
101
101
  // Register `ast` with the recycle registry so buffer is returned to cache
102
102
  // when `ast` is garbage collected